Jump to content

Phaser 2.0 Collision Question


srikarg
 Share

Recommended Posts

Yes its totally posible;

 

Put in your create function:

this.floor = this.game.add.sprite(0, 678);this.physics.enable(this.floor, Phaser.Physics.ARCADE);this.floor.body.immovable = true;this.floor.body.width = this.game.world.width;

Then in your update function add;

this.game.physics.arcade.collide(this.floor, this.YOURSPRITENAME);

I have used this in my game;

 

Play:

http://eugenioclrc.github.io/circushtml5/

 

Source;

https://github.com/eugenioclrc/circushtml5

Link to comment
Share on other sites

  • 8 months later...
  • 9 months later...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...