Skip to content

ralmn/EasyStarJS-Superpowers-plugins

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Superpowers EasyStarJS plugin

This plugin for Superpowers, the extensible HTML5 2D+3D game engine brings a EasyStarJS path finding

Installation

Download the latest release and unzip it.

Rename the folder if you want then move it inside app/plugins/ralmn/.

Finally restart your server.

Exemple

let es = new EasyStar.js();
    
    let grid = [];
    
    for(let y = 0;  y < this.map.getHeight(); y++ ){
      let line = [];
      for(let x = 0; x < this.map.getWidth(); x++){
        line.push(this.map.getTileAt(1, x, y) == -1 ? 0 : 1);
      }
      grid.push(line);
    }
    es.setGrid(grid);
    
    es.setAcceptableTiles([-1]);
    es.findPath(this.posX, this.posY, endX, endX, (path: EasyStar.Position[]) => {
      if(path.length < 2) return;
      let newPos = path[1];
      }
      
    });
    es.calculate();
   

About

EasyStarJS Superpowers plugins

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published