Here's a pretty simple way of doing it. Have a filled region stretch across the screen. Then add this for its mouse button down event (you need to add an int variable called timer).
click_region -> Mouse Button Down (left) -> Script Editor
- Code: Select all
timer=10;
if(timer>0)
{
CreateActor("rocket", "rocket_anim", "(none)", "(none)", player.x, player.y, true);
}
Then in the actor's draw, have this.
click_region -> Draw Actor -> Script Editor
- Code: Select all
timer-=timer>0;
Now to make the rocket actually move toward the mouse position, put this in the rocket's create actor event.
rocket -> Create Actor -> Script Editor
- Code: Select all
directional_velocity=20;
angle=direction(xscreen, xmouse, yscreen, ymouse);