codevinsky Posted March 4, 2014 Share Posted March 4, 2014 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 More sharing options...
rich Posted March 4, 2014 Share Posted March 4, 2014 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 More sharing options...
codevinsky Posted March 4, 2014 Author Share Posted March 4, 2014 Nice. Currently, I've just set up a dummy sprite that hides behind my tileSprite to detect collisions. Link to comment Share on other sites More sharing options...
valueerror Posted March 5, 2014 Share Posted March 5, 2014 hey.. nice.. i stumbled upon the exact same problem yesterday.. wanted to use a tiled image as ground... player fell through.. it would be very useful .. ( but since this didn't work i am learning how to use "tiled" and phaser with json files right now... ) Link to comment Share on other sites More sharing options...
rich Posted March 7, 2014 Share Posted March 7, 2014 Just to say that I've been experimenting with this today and I have added a physics body property to TileSprite and it's working as expected Link to comment Share on other sites More sharing options...
codevinsky Posted March 7, 2014 Author Share Posted March 7, 2014 Very nice. Thanks, rich. Link to comment Share on other sites More sharing options...
Recommended Posts