"flaps down" -> decrease maximum speed
"flaps up" -> increase maximum speed
This commit is contained in:
parent
b11f6c67d8
commit
c86cd8c013
1 changed files with 23 additions and 1 deletions
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
<description>UFO from the 'White Project' of the UNESCO</description>
|
<description>UFO from the 'White Project' of the UNESCO</description>
|
||||||
<author>ET</author>
|
<author>ET</author>
|
||||||
|
|
||||||
<flight-model>ufo</flight-model>
|
<flight-model>ufo</flight-model>
|
||||||
|
|
||||||
<sound>
|
<sound>
|
||||||
|
@ -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 < 0 and speed < 20000) {
|
||||||
|
speed *= 1.5;
|
||||||
|
}
|
||||||
|
maxspeed.setDoubleValue(speed);
|
||||||
|
gui.popupTip(sprintf("MaxSpeed " ~ int(speed) ~ " m/s"));
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</ufo>
|
||||||
|
</nasal>
|
||||||
</PropertyList>
|
</PropertyList>
|
||||||
|
|
Loading…
Reference in a new issue