Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Can't collide with tileSprite?


toby1kenobi
 Share

Recommended Posts

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

 Share

  • Recently Browsing   0 members

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