MikeW Posted April 7, 2017 Share Posted April 7, 2017 I am wanting to add information to a sprite to look at in a collision walker = game.add.sprite(walkerx,walkery,'walker'); walker.alive =1; In my collision code I want to do if (body2.alive==1) But it does not affect the code when I force it crash there - and look at the body2 object I don't see a alive property. BTW this is my third phaser game. Loving it Link to comment Share on other sites More sharing options...
samme Posted April 7, 2017 Share Posted April 7, 2017 Sprite's already have an alive property (=== true/false). It will be in body.sprite.alive. Link to comment Share on other sites More sharing options...
MikeW Posted April 7, 2017 Author Share Posted April 7, 2017 Is there a way to add my own variables to the object. What I posted was abbreviated, there are about 12 values - not sure I need all of them. Link to comment Share on other sites More sharing options...
Recommended Posts