Kristoffer Darj Posted July 14, 2014 Share Posted July 14, 2014 I'm basically trying to make this gamemechanicexplorer example into a game. http://gamemechanicexplorer.com/#homingmissiles-4 When a missile collide with another sprite (my hero), both the missile and hero is killed but a smoke emitter attached to the missile still keeps emitting smoke. On the other hand, when a missile hits a solid obstacle on thte screen, the missile is also killed in the same fashion and then the emitter stops. Any thought? Missile code: http://pastebin.com/RKBvmSP0Protagonist code: http://pastebin.com/2sQSN5KyThe game: http://pastebin.com/V0X9QR67 Link to comment Share on other sites More sharing options...
lewster32 Posted July 14, 2014 Share Posted July 14, 2014 It seems you're missing the bit which turns the emitter off when the missile is dead: // If this missile is dead, don't do any of these calculations // Also, turn off the smoke emitter if (!this.alive) { this.smokeEmitter.on = false; return; } else { this.smokeEmitter.on = true; }This should go right at the top of the missile's update function, to prevent any other logic being run for dead missiles. Link to comment Share on other sites More sharing options...
Kristoffer Darj Posted July 15, 2014 Author Share Posted July 15, 2014 Alright. Thanks Link to comment Share on other sites More sharing options...
Recommended Posts