remember time_step is usally a small value, and the higher the framerate the smaller it is.
I have had issues with rotations in the past due to that problem.
just as an example...
lets say a certain data type (like your pan for example) only had 3 decimal positions, and its current value is 90.001
now imagine 5*time_step=0.0000001
so now you add 90.001 + 0.0000001 and you get the same 90.001
Why? Because the value is so small it is beyond the decimal precision your variable can hold, so anything smaller just gets ignored.
Think of it like trying to put 0.001 into an integer... This is kind of the same problem, only now what is being "ignored" are decimals smaller than what can fit in "var" (I think pan is var, not sure though)
An esy workaround would be to use a varaible with more precision to store the values:
float pan_container;
BOOL direction;
if(trace_hit)
{
direction = integer(random(2));
if(direction == 0)
{
pan_container -= 5 * time_step;
}
else
{
pan_container += 5 * time_step;
}
my.pan=pan_container;
}
If you want to learn more about each data type do a search in the manuall for variables. Or you can look in google or any programming book/website for:
BOOL
INTEGER (int)
FIXED (var)
FLOAT (float)
DOUBLE (double)
those are the main types you will be using.
if you stumble on things like half, word, longword, quadword... just ignore it, that is usually for ensamblador and other low processor instructions you will never use in any high level programming language like this.