mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
Merge pull request #6774 from imgntn/targetsfix
Fix Wall Targets Collision Callback
This commit is contained in:
commit
5fad7aa51b
1 changed files with 16 additions and 16 deletions
|
@ -17,34 +17,34 @@
|
|||
}
|
||||
|
||||
Target.prototype = {
|
||||
hasPlayedSound: false,
|
||||
hasBecomeActive: false,
|
||||
preload: function(entityID) {
|
||||
this.entityID = entityID;
|
||||
var SOUND_URL = "http://hifi-public.s3.amazonaws.com/sounds/Clay_Pigeon_02.L.wav";
|
||||
this.hitSound = SoundCache.getSound(SOUND_URL);
|
||||
},
|
||||
collisionWithEntity: function(me, otherEntity) {
|
||||
var position = Entities.getEntityProperties(me, "position").position;
|
||||
Entities.editEntity(me, {
|
||||
gravity: {
|
||||
x: 0,
|
||||
y: -9.8,
|
||||
z: 0
|
||||
},
|
||||
velocity: {
|
||||
x: 0,
|
||||
y: -0.01,
|
||||
z: 0
|
||||
}
|
||||
});
|
||||
if (this.hasBecomeActive === false) {
|
||||
var position = Entities.getEntityProperties(me, "position").position;
|
||||
Entities.editEntity(me, {
|
||||
gravity: {
|
||||
x: 0,
|
||||
y: -9.8,
|
||||
z: 0
|
||||
},
|
||||
velocity: {
|
||||
x: 0,
|
||||
y: -0.01,
|
||||
z: 0
|
||||
}
|
||||
});
|
||||
|
||||
if (this.hasPlayedSound === false) {
|
||||
this.audioInjector = Audio.playSound(this.hitSound, {
|
||||
position: position,
|
||||
volume: 0.5
|
||||
});
|
||||
|
||||
this.hasPlayedSound = true;
|
||||
this.hasBecomeActive = true;
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue