Game multi - Add animationGoal1 v1 - Start init others animations

This commit is contained in:
hubourge
2024-09-24 18:16:11 +02:00
parent 47c8a64f5d
commit 10d466a964
5 changed files with 138 additions and 92 deletions

View File

@ -10,6 +10,8 @@
/* */
/* ************************************************************************** */
import { goalAnimation } from '/static/javascript/multiOnlineGame/Player.js'
let opponentExist = false;
let mapLength = 0;
@ -26,8 +28,9 @@ class Opponent
right: 3,
};
last = false;
playerGoalAnimation = null;
constructor (object, map)
constructor (object, map, indexGoalAnimation)
{
if (opponentExist)
throw Error("Opponent is already init.");
@ -35,6 +38,7 @@ class Opponent
this.object = object;
this.object.position.set(0, 0.3, -map.mapLength / 2 + 0.2);
mapLength = map.mapLength;
this.playerGoalAnimation = goalAnimation[indexGoalAnimation];
}
dispose()