Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by munho

Here's the easy of it.

I have some fire. When an entity hits the fire I call other.kill() in the check function. After this I try to spawn my "Burn" entity, but it actually freezes the game. It doesn't seem to have an x value. So this only works when I put hard numbers in for x and y. Any thoughts why this might be the case?

check: function( other ) {
		
		other.kill();

		ig.game.spawnEntity( EntityBurnUp, 8, 170 );
//ig.game.spawnEntity(EntityBurnUp, x, y);
		
	}

1 decade ago by Arantor

Where is x or y supposed to come from? If it's based on the current entity's x or y, use this.pos.x and this.pos.y, if it's the other entity's, use other.pos.x and other.pos.y.

1 decade ago by munho

Hi Arantor - that's exactly what I needed. It's working as it should now. Thanks.

Did I mention I'm still learning? I have zero Javascript skills in my pocket. So this is all from scratch learning as I go.
Page 1 of 1
« first « previous next › last »