content/hifi-content/liv/dev/emojis/Fart.js
2022-02-14 02:04:11 +01:00

44 lines
No EOL
1.3 KiB
JavaScript

///
/// PooEmoji.js
/// An object that farts when picked up
/// Attach to an entity
///
/// Author: Liv Erickson
/// Copyright High Fidelity 2017
///
/// Licensed under the Apache 2.0 License
/// See accompanying license file or http://apache.org/
///
/// All assets are under CC Attribution Non-Commerical
/// http://creativecommons.org/licenses/
///
(function () {
var SOUND_URL = "http://mpassets.highfidelity.com/a5f42695-f15a-4f44-9660-14b4f8ca2b29-v1/poot.wav";
var SOUND = SoundCache.getSound(Script.resolvePath(SOUND_URL));
var _this;
PooEmoji = function () {
_this = this;
var playback;
}
PooEmoji.prototype = {
preload: function (entityID) {
_this.entityID = entityID;
playback = {volume: 1, position: Entities.getEntityProperties(_this.entityID).position};
},
unload: function () {
},
startNearGrab: function () {
print(_this.entityID);
Audio.playSound(SOUND, playback);
Entities.deleteEntity(_this.entityID);
},
clickDownOnEntity: function() {
print(_this.entityID);
Audio.playSound(SOUND, playback);
}
}
return new PooEmoji();
})