mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 05:17:02 +02:00
cleanup
This commit is contained in:
parent
68e03a08c0
commit
7c18359fba
1 changed files with 3 additions and 7 deletions
|
@ -17,15 +17,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
Target.prototype = {
|
Target.prototype = {
|
||||||
hasBecomePhysical: false,
|
hasBecomeActive: false,
|
||||||
hasPlayedSound: false,
|
|
||||||
preload: function(entityID) {
|
preload: function(entityID) {
|
||||||
this.entityID = entityID;
|
this.entityID = entityID;
|
||||||
var SOUND_URL = "http://hifi-public.s3.amazonaws.com/sounds/Clay_Pigeon_02.L.wav";
|
var SOUND_URL = "http://hifi-public.s3.amazonaws.com/sounds/Clay_Pigeon_02.L.wav";
|
||||||
this.hitSound = SoundCache.getSound(SOUND_URL);
|
this.hitSound = SoundCache.getSound(SOUND_URL);
|
||||||
},
|
},
|
||||||
collisionWithEntity: function(me, otherEntity) {
|
collisionWithEntity: function(me, otherEntity) {
|
||||||
if (this.hasBecomePhysical === false) {
|
if (this.hasBecomeActive === false) {
|
||||||
var position = Entities.getEntityProperties(me, "position").position;
|
var position = Entities.getEntityProperties(me, "position").position;
|
||||||
Entities.editEntity(me, {
|
Entities.editEntity(me, {
|
||||||
gravity: {
|
gravity: {
|
||||||
|
@ -39,16 +38,13 @@
|
||||||
z: 0
|
z: 0
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.hasBecomePhysical = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.hasPlayedSound === false) {
|
|
||||||
this.audioInjector = Audio.playSound(this.hitSound, {
|
this.audioInjector = Audio.playSound(this.hitSound, {
|
||||||
position: position,
|
position: position,
|
||||||
volume: 0.5
|
volume: 0.5
|
||||||
});
|
});
|
||||||
|
|
||||||
this.hasPlayedSound = true;
|
this.hasBecomeActive = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue