doyouknowyou Posted June 1, 2014 Share Posted June 1, 2014 I'm fairly new to phaser, so forgive me if this isn't very complicated! I'm trying to show a frame on a spritesheet that is triggered when the y coordinate is decreasing (i.e the sprite is 'falling'). Is there any easy way to do this? Thanks! Link to comment Share on other sites More sharing options...
wayfinder Posted June 1, 2014 Share Posted June 1, 2014 sprite.body.deltaY() should be positive :=) (0,0) is the top left corner. Link to comment Share on other sites More sharing options...
ZoomBox Posted June 2, 2014 Share Posted June 2, 2014 I think you simply should observe sprite.position.y at each update.var lastY;update(){ if(mySprite.position.y>lastY){ //It's moving down } lastY = mySprite.position.y;} Link to comment Share on other sites More sharing options...
Recommended Posts