1
0
Fork 0

"flaps down" -> decrease maximum speed

"flaps up"   -> increase maximum speed
This commit is contained in:
mfranz 2006-03-11 09:52:51 +00:00
parent b11f6c67d8
commit c86cd8c013

View file

@ -27,8 +27,30 @@
<name>joystick fire button</name> <name>joystick fire button</name>
<desc>fly backwards</desc> <desc>fly backwards</desc>
</key> </key>
<key>
<name>[ ]</name>
<desc>increase/decrease maximum speed</desc>
</key>
</help> </help>
</sim> </sim>
<nasal>
<ufo>
<script>
var maxspeed = props.globals.getNode("engines/engine/speed-max-mps");
controls.flapsDown = func(x) {
if (!x) { return }
var speed = maxspeed.getValue();
if (x > 0 and speed > 5) {
speed /= 1.5;
} elsif (x &lt; 0 and speed &lt; 20000) {
speed *= 1.5;
}
maxspeed.setDoubleValue(speed);
gui.popupTip(sprintf("MaxSpeed " ~ int(speed) ~ " m/s"));
}
</script>
</ufo>
</nasal>
</PropertyList> </PropertyList>