M
Malte Landgren
Guest
Hi I'm currently working on a strategic space game where in you control a space ship and shoot projectiles, all affected by gravity generated from nearby planets. This currently works fine as is but I was wondering how I would go about implementing slowmotion/speedup of time in the gravity simulation? The usual method of simulating slowmotion by simply multiplying the "hspeed" and "vspeed" by something like "timemodifier = 0.5;" wont work in this case since that would simply reduce/increase the observed effect of the planets gravitational pull.
This is currently how I'm calculating gravity in the bullet and player objects:
with obj_attractor
{
var F = global.G * (mass*other.mass)/sqr(distance_to_point(other.x, other.y));
var a = point_direction(other.x, other.y, x, y);
other.hspeed += F/other.mass*dcos(a);
other.vspeed -= F/other.mass*dsin(a);
}
Thanks!
This is currently how I'm calculating gravity in the bullet and player objects:
with obj_attractor
{
var F = global.G * (mass*other.mass)/sqr(distance_to_point(other.x, other.y));
var a = point_direction(other.x, other.y, x, y);
other.hspeed += F/other.mass*dcos(a);
other.vspeed -= F/other.mass*dsin(a);
}
Thanks!