Fire on the Move

This is probably out of scope but I am going to ask…

I am firing my phaser on the move, (mte.moveSpriteTo)  I need to reposition the anchor of the beam to stay in position while my ship moves… I’m guessing I’d need to make a cusom moveSpriteTo to encorporate firing to have this feature?  Any suggestions?

Thanks again, Greg

If the beam is supposed to continue firing in it’s original direction, I would just set it’s .x and .y to the sprite’s .x and .y in each frame. If the beam’s ends are going to be moving as if it’s tracking the ship or following someone’s finger, you know, you might as well just destroy it and create a new line each frame. It won’t cause any performance problems unless you have hundreds of them active simultaneously, and it simplifies the whole problem to repeating the code you already have.

If the beam is supposed to continue firing in it’s original direction, I would just set it’s .x and .y to the sprite’s .x and .y in each frame. If the beam’s ends are going to be moving as if it’s tracking the ship or following someone’s finger, you know, you might as well just destroy it and create a new line each frame. It won’t cause any performance problems unless you have hundreds of them active simultaneously, and it simplifies the whole problem to repeating the code you already have.