rblopes / generator-phaser-plus

[🛑 DISCONTINUED] It has been a long journey but development of `generator-phaser-plus` is now over. I recommend you have a look and fork `yandeu/phaser-project-template` instead.
https://github.com/yandeu/phaser-project-template
MIT License
146 stars 13 forks source link

Defining a tilemap causes Phaser.Tilemap is not a constructor error #17

Closed budda closed 8 years ago

budda commented 8 years ago

If i try:

  create() {
    //  Creates a blank tilemap
    var map = this.add.tilemap('map');

I get the error Uncaught TypeError: Phaser.Tilemap is not a constructor -- whats the correct way to create a timemap using the generators structure?

rblopes commented 8 years ago

Are you using the "no physics" build option? If so, there's no Tilemap class. You should at least choose the "Arcade Physics" build to get Tilemaps working. This is how Phaser was designed.

Check the tasks configuration (gulpfile.js/config.js) to change the Phaser build option.

budda commented 8 years ago

Yup no physics! That would explain it. facepalm