-
-
Save anonymous/d67ba81f26274402736c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Lava.prototype = { | |
create: function() { | |
this.player = this.game.add.sprite(215, 941, 'hero'); | |
this.game.physics.startSystem(Phaser.Physics.P2JS); | |
this.game.physics.p2.gravity.y = 1200; | |
var LAVA_TILE = 245; | |
var FLOOR_TILE = 2; | |
this.map = this.game.add.tilemap('lava'); | |
this.map.addTilesetImage('tiles'); | |
this.map.setTileIndexCallback(LAVA_TILE, this.burn, this); | |
this.map.setCollision(FLOOR_TILE); | |
this.player = this.game.add.sprite(21, 210, 'hero'); | |
this.game.physics.p2.enable(this.player); | |
this.game.physics.p2.convertTilemap(this.map, this.layer); | |
this.layer = this.map.createLayer('Tile Layer 1'); | |
this.layer.resizeWorld(); | |
}, | |
burn: function() { | |
console.log('burninate'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment