18 lines
No EOL
685 B
JavaScript
18 lines
No EOL
685 B
JavaScript
// Created by Adrian
|
|
// preloads sound and plays on entry to the entity
|
|
// Adrian McCarlie
|
|
// Creative Commons attribution CC BY 4.0
|
|
// http://creativecommons.org/licenses/by/4.0/
|
|
(function(entityID){
|
|
var location;
|
|
var soundURL;
|
|
this.preload=function(entityID)
|
|
{
|
|
soundURL = SoundCache.getSound("http://mpassets.highfidelity.com/14e19e59-5844-42f8-8ac4-904551f27c4e-v1/sounds/demon.wav");
|
|
location = Entities.getEntityProperties(entityID).position;
|
|
}
|
|
this.enterEntity = function(entityID)
|
|
{
|
|
Audio.playSound(soundURL, { loop: false, position: location ,volume: 0.4 });
|
|
}
|
|
}) |