Game multi

- Add score board box
    - Implement scoring evolution on board
    - Add a recreat method while goal
    - Start to implement goal animation (not working)
    - Add temporary imput 'l' and 'k' to increment player score
This commit is contained in:
hubourge
2024-09-18 19:06:42 +02:00
parent a93e713f44
commit 7e24946140
4 changed files with 187 additions and 34 deletions

View File

@ -11,6 +11,7 @@
/* ************************************************************************** */
let opponentExist = false;
let mapLength = 0;
class Opponent
{
@ -33,6 +34,7 @@ class Opponent
opponentExist = true;
this.object = object;
this.object.position.set(0, 0.3, -map.mapLength / 2 + 0.2);
mapLength = map.mapLength;
}
dispose()
@ -44,6 +46,11 @@ class Opponent
{
}
resetPosOpponent()
{
this.object.position.set(0, 0.3, -mapLength / 2 + 0.2);
}
movePlayer(content)
{
const lerp = (start, end, t) => start + (end - start) * t;