Edited by big213, 02 December 2005 - 04:06 AM.
Help With Creating A Simple Plane Simulation
Started by big213, Dec 02 2005 04:05 AM
3 replies to this topic
#1
Posted 02 December 2005 - 04:05 AM
I need some help with the creation of a (Time x Rate = Distance) simulation. For example... If Plane 1 was travelling at 650 mph due west, and Plane 2 was traveling at 700 mph due west as wekk, and plane 1 started 2 hours before plane 2, how long would it take for plane 2 to overtake (pass) plane 1. Well, you see, thats the kind of problem I am trying to apply this to... I am not asking for complete instructions (though they would be good too - I am kind of new to Flash), but just like what kind of tools I should use. Thanks in advance, and sorry my English is all funny... I just survived an all-nighter
. Now, if you will excuse me, I need to get maybe 2 hours of sleep before going to school...
#2
Posted 02 December 2005 - 06:24 AM
This function is only valid on one axis (x or y NOT diagonal)
If one of the airplanes flies in the opposite direction the velocity must be a negative number.
var step:number = ..; //velocity of iterations
var f1:integer = ..; // Position of Plane 1
var f2:ineger = .. // Position of Plane 2
var v1:Number = .. // Velocity of Plane 1
var v2:Number = .. // Velocity of Plane 2
while(true){
f1 = f1+ (step x v1); //calculate new position of plane1
f2 = f2+ (step x v2); //calculate new position of plane2
//your actions in here
}
If one of the airplanes flies in the opposite direction the velocity must be a negative number.
#3
Posted 02 December 2005 - 08:03 PM
funkysoul, on Dec 2 2005, 06:24 AM, said:
This function is only valid on one axis (x or y NOT diagonal)
If one of the airplanes flies in the opposite direction the velocity must be a negative number.
var step:number = ..; //velocity of iterations
var f1:integer = ..; // Position of Plane 1
var f2:ineger = .. // Position of Plane 2
var v1:Number = .. // Velocity of Plane 1
var v2:Number = .. // Velocity of Plane 2
while(true){
f1 = f1+ (step x v1); //calculate new position of plane1
f2 = f2+ (step x v2); //calculate new position of plane2
//your actions in here
}
If one of the airplanes flies in the opposite direction the velocity must be a negative number.
Okay, thanks a bunch
#4
Posted 03 December 2005 - 02:33 PM
hold on just a second there... I have a few questions:
"Velocity of Iterations" should be replaced by what?
"Position of Plane 1, 2" are x,y coordinates, or just y coordinates, and how do I plot them?
"Calculate new position of plane1", should this be deleted and replaced?
"Your actions in here", no idea :S.
As you probably see, I am new to flash, so please bear with me for the meantime. I am going to do some research on flash stuff for a few hours, so I will probably find some answers. Thanks in advance
"Velocity of Iterations" should be replaced by what?
"Position of Plane 1, 2" are x,y coordinates, or just y coordinates, and how do I plot them?
"Calculate new position of plane1", should this be deleted and replaced?
"Your actions in here", no idea :S.
As you probably see, I am new to flash, so please bear with me for the meantime. I am going to do some research on flash stuff for a few hours, so I will probably find some answers. Thanks in advance
Edited by big213, 03 December 2005 - 03:04 PM.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
