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...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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