Sounds: Added starting sound

This commit is contained in:
Sidi Liang 2020-01-31 17:23:22 +08:00
parent d09dbb0945
commit 49eb5b3cfc
No known key found for this signature in database
GPG Key ID: 79F0A6B20B72F42F
3 changed files with 3 additions and 11 deletions

View File

@ -160,22 +160,14 @@ var Engine = {
engineTimer: nil,
timerCreated: 0,
createTimer: func(){
if(!me.timerCreated){
me.engineTimer = maketimer(0.1, func me.update_engine());
me.timerCreated = 1;
}
},
startEngine: func(){
me.createTimer();
if(me.engineTimer == nil) me.engineTimer = maketimer(0.1, func me.update_engine());
me.engineSwitch.switchConnect();
me.runningState = 1;
props.getNode("/",1).setValue("/controls/engines/engine/started",1);
me.engineTimer.simulatedTime = 1;
me.rpm = 100 * me.getDirection();
followme.playAudio("starter.wav");
me.engineTimer.start();
return 1;
},

View File

@ -45,7 +45,7 @@ var Sound = {
},
};
var playAudio = func(file){
var playAudio = func(file){ #//Plays audio files in Aircrafts/Sounds
fgcommand("play-audio-sample", Sound.new(filename: file, volume: 1, path: props.getNode("/",1).getValue("sim/aircraft-dir") ~ '/Sounds'));
}

BIN
Sounds/starter.wav Normal file

Binary file not shown.