mirror of
https://forge.apps.education.fr/phroy/frankie-on-platform.git
synced 2024-01-27 11:32:04 +01:00
28 lines
489 B
Haxe
28 lines
489 B
Haxe
package arm;
|
|
|
|
class Sound_amb extends iron.Trait {
|
|
public function new() {
|
|
super();
|
|
|
|
// notifyOnInit(function() {
|
|
// });
|
|
|
|
notifyOnUpdate(function() {
|
|
|
|
var mouse = iron.system.Input.getMouse();
|
|
|
|
// Mouse clicked
|
|
if (mouse.started()) {
|
|
|
|
// Randomly play one of the three hit sounds
|
|
iron.data.Data.getSound('amb_bird_1.wav', function(sound:kha.Sound) {
|
|
iron.system.Audio.play(sound);
|
|
});
|
|
}
|
|
});
|
|
|
|
// notifyOnRemove(function() {
|
|
// });
|
|
}
|
|
}
|