Hi guys,
I’m having some problems subtracting one variable from another.
Both are number variables.
The 1st variable comes from a getTimer, when the Space bar is hit
the 2nd variable also from a getTimer, the time when a movie is at a certain coordinate.
CameraView is a car movie, and collision is basically a movie that the user has to break (hit Spacebar), and their reaction time is measured.
I just know I’ve done something silly!
Any help would be greatly appreciated
Here is the code:
obstacle = function(){
zposition = cameraView.z;
xposition = cameraView.x;
if (cameraView.x >=-450 and cameraView.x <=450 and cameraView.z >=3000 and camera.z <=3500){
collision.x = 0;
collision.z = 3500;
collision.y = 20;
if (collision.x==0 and collision.z==3500){
var timercollision:Number =getTimer();
obstacle = timercollision;
var diff:Number = (timer - timercollision);
difference.text = diff;
}
}
}
cameraView.onEnterFrame = obstacle;