1.11.0 • Published 3 years ago

phaser-grid-movement-plugin v1.11.0

Weekly downloads
53
License
ISC
Repository
github
Last release
3 years ago

Welcome to the Grid Movement plugin! This Phaser 3 plugin adds grid-based movement to your tilemap game. Your characters will be able to only move in whole tile sizes, locked to the x-y grid!

This plugin is also compatible (and written in) TypeScript; enjoy full type support!

  • Grid-based movement, of course!
  • Tile-based collision detection
  • One-way collision detection
  • Support for multiple characters
  • Pathfinding (for both NPCs and the player)
  • Random movement (can also limit to a radius)
  • Following other characters
  • Isometric maps (Beta)

📖 Our most current documentation is here! ➡️ You can try/download a list of examples at this link here.

Installing the Grid Movement plugin is simple.

NPM

npm i --save phaser-grid-movement-plugin

Web

<!-- Download the .zip and copy GridMovementPlugin.min.js from dist/ -->
<script src="GridMovementPlugin.min.js"></script>

Then, inside your Phaser game config...

const gameConfig = {
  // ...

  plugins: {
    scene: [
      {
        key: "gridMovementPlugin",
        plugin: GridMovementPlugin,
        mapping: "gridMovementPlugin",
      },
    ],
  },

  // ...
};

const game = new Phaser.Game(gameConfig);

Now you're all set to start using Grid Movement in your scenes!

function create() {
  // ...

  const gridMovementConfig = {
    characters: [
      {
        id: "player",
        sprite: playerSprite,
        walkingAnimationMapping: 6,
      },
    ],
  };

  this.gridMovementPlugin.create(tilemap, gridMovementConfig);

  // ...
}
1.11.0

3 years ago

1.10.0

3 years ago

1.9.0

3 years ago

1.8.0

3 years ago

1.7.0

3 years ago

1.6.0

3 years ago

1.5.0

3 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago