Hmn, now I'm confused. I'm not good at mathematical notation, could you show me how that looks in script?
I want to make sure that I've got this right, so here is what I did:
Code:
//set the velocity for all objects in group
initial_velocity = random(10000)+10000;
//Set mass individually
my.meteor_mass = random(8)+2;
//Calculate the amount of force required to get each object up to the target
//velocity in one frame
//***LOOK HERE***
//velocity = force * time/mass
//time is always 1 in this case
//since we want to reach the target velocity in one frame
//and so, force(to aply to the object) = velocity(target) * mass(of object to be pushed) ???????
meteor_force = initial_velocity * my.meteor_mass;
//set direction
vec_normalize(meteor_direction,1);
vec_scale(meteor_direction, meteor_force);
//push object in direction with right amount of force
phent_addforcelocal(my, meteor_direction.x,vector(random(1000)-500,random(1000)-500,random(1000)-500) );
This
appears to be working, the asteroids seem to be moving at the same speed, but I'd like to have it spot on. What should the formula be for calculating the force? (ideally in a computer algorithm).