The for loop was the first thing I commented on.
If you are doing a for loop with float values, you MUST provide a step value to increment by. Otherwise it will add 1 and the loop only occurs once, adding 0.19 to the x# and y# and stopping.
I am going to have to assume that the code you posted is happening inside the main loop or in a function called in the main loop and that the x# and y# variables have been initialized before the loop.
In order to keep the floating point values and make sure that the calculations happen in the correct order, change this:
setSpritePhysicsVelocity (sprites[2],randomsign (1)*x#/3,randomsign (1)*y#/3)
to this:
setSpritePhysicsVelocity (sprites[2],(randomsign(1)*x#)/3.0, (randomsign(1)*y#)/3.0)
(And drop the space between all instances of 'randomsign' and '(1)' just to be sure the compiler doesn't get confused.)
Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master