PDA

View Full Version : Speed Sensor and Rotation Sensor-based Scaling Under 1 (Something I Just Came Across)



BIGGamerer
07-03-2012, 02:42 AM
So I got stuck on my zombie shooter trying to find ways to divide by a certain value accurately and within 1 frame (In this case, dividing bullet damage on the spot by 2 to increase the health of a certain zombie). Timer-based division sucked and was inaccurate, but I came up with a crazy idea of a mover and a speed sensor, and I got this:

http://i4.lbp.me/img/ft/8248930c45d39bd497c7625f1fc0355a35e2b51f.jpg

The battery is a 50% battery wired into a 0.5 rightwards mover with speed scale inputting. The speed sensor is set to 1.0 in any direction. 0.5 x (0.5/1.0) = 0.25 When I set the mover's speed to 0.3, the output of the speed sensor was 0.15. 0.5 x (0.3/1.0) = 0.15. I tried something similar with rotators and rotation sensors, and got the same accurate results.

I haven't completely tested pulsing a value into the mover (Speed sensor/mover system) or rotator (Rotation sensor/rotator) to see if I can use something like this with no delay. Have any of you all ever experimented with something like this? A quick search of the forums turned up with nothing.

Rogar
07-03-2012, 08:58 AM
Never thought of it, but pretty brilliant in its simplicity. :)