mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:24:00 +02:00
targets fix
This commit is contained in:
parent
c2f2f950fb
commit
68e03a08c0
1 changed files with 17 additions and 13 deletions
|
@ -17,6 +17,7 @@
|
|||
}
|
||||
|
||||
Target.prototype = {
|
||||
hasBecomePhysical: false,
|
||||
hasPlayedSound: false,
|
||||
preload: function(entityID) {
|
||||
this.entityID = entityID;
|
||||
|
@ -24,19 +25,22 @@
|
|||
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.hasBecomePhysical === 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
|
||||
}
|
||||
});
|
||||
this.hasBecomePhysical = true;
|
||||
}
|
||||
|
||||
if (this.hasPlayedSound === false) {
|
||||
this.audioInjector = Audio.playSound(this.hitSound, {
|
||||
|
|
Loading…
Reference in a new issue