Jump to content

TileSprite collisions?


codevinsky
 Share

Recommended Posts

I've got a ground TileSprite that is used to show a running ground beneath the player:

create: function() {   ...  this.ground = game.add.tileSprite(0,400, 335,112,'ground');  ...}, update: function() {  ...  this.ground.tilePosition.x -= 5;  ...}

I want a collision between the player (which has physicsEnabled on it) and the ground. 

 

How can I achieve this? 

Do I need to create a dummy sprite that has phsyicsEnabled on it that lays over the ground tileSprite, or can I collide with the ground tileSprite?

Link to comment
Share on other sites

I haven't enabled TileSprites for any kind of physics as they're really just meant for visual effects (scrolling backdrops, etc). But I guess I could, will give it a go and see what happens. If I like the results you'll see a commit saying so :)

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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