E
Eric L
Guest
Hi, Im trying to program a trajectory plotting script for a 2D space game. The trajectory is the combination of two thrusters and a cannon that add to the momentum of a ship over time. Example
right now the plot circles update over time the same way the ship would using motion_add
Im wanting to make it update instantly instead of having to wait for a moment for the circles to move based on the momentum, but am having a lot of trouble figuring out the logic for it.
Any pointers in the right direction would be really appreciated
Thank you for your time
right now the plot circles update over time the same way the ship would using motion_add
Code:
if(hold)
{
GUI_Ship.xmod = 0;
counter++;
speed = 0;
if(counter >= plotSend)
{
counter = 0;
var plot = instance_create(x,y,Obj_PlotPoint);
plot.direction = holdDir;
plot.speed = holdSpeed;
}
if(Rocket_A.rocketActive)
with(Obj_PlotPoint){motion_add(Rocket_A.image_angle,Rocket_A.rocketAccel);}
if(Rocket_B.rocketActive)
with(Obj_PlotPoint){motion_add(Rocket_B.image_angle,Rocket_B.rocketAccel);}
if(ShipCannon.gunActive)
with(Obj_PlotPoint)
{
if(gunEffect == false)
{
gunEffect = true;
motion_add(ShipCannon.image_angle,ShipCannon.gunAccel);
}
}
}
Any pointers in the right direction would be really appreciated
Thank you for your time
Attachments
-
412.4 KB Views: 12