toby1kenobi Posted March 2, 2014 Share Posted March 2, 2014 I've seen this post and this issue, but I can't tell from either of this if this is something that should work; apologies if I've overlooked something. I have a tileSprite as a scrolling 'ground' and a sprite as the 'player': function create() { bgGrd = game.add.tileSprite(0, 584, game.stage.bounds.width, 16, 'ground'); bgGrd.body.immovable = true; ply = game.add.sprite(game.world.centerX, 220, 'ply'); ply.body.gravity.y = 600; ply.body.collideWorldBounds = true; } function update() { bgGrd.tilePosition.x -= 2; game.physics.collide(ply, bgGrd); }The player drops to the bottom of the stage, passing the top of the 'ground'. Am I doing something wrong here (eminently possible, it's all very new to me!)? Thanks, Toby Link to comment Share on other sites More sharing options...
AprendizEnLaRed Posted March 2, 2014 Share Posted March 2, 2014 I think that i did:Ground.body.rectangle(....) Link to comment Share on other sites More sharing options...
toby1kenobi Posted March 2, 2014 Author Share Posted March 2, 2014 I think that i did:Ground.body.rectangle(....) Thanks for your reply - can you explain a bit more, I don't quite understand what you mean? Toby Link to comment Share on other sites More sharing options...
AprendizEnLaRed Posted March 3, 2014 Share Posted March 3, 2014 See this examplehttp://examples.phaser.io/_site/view_full.html?d=tile%20sprites&f=colliding+with+tiling+sprite.js&t=colliding%20with%20tiling%20sprite Link to comment Share on other sites More sharing options...
toby1kenobi Posted March 4, 2014 Author Share Posted March 4, 2014 Perfect, that works - thank you very much, that's really helpful! Toby Link to comment Share on other sites More sharing options...
Recommended Posts