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

@ -45,6 +45,9 @@ Controls :
- u : 16 video
- y : 8 video
- t : 4 video
- l : recreate et augmente le score de player
- k : recreate et augmente le score de opponent
*/
let scene = null;
@ -107,7 +110,6 @@ class MultiOnlineGamePage
controls.target = new THREE.Vector3(map.centerPos.x, 0, map.centerPos.z);
//////////////////////////
document.addEventListener('keypress', (e) => {
if (e.key == 'g')
player.pointAnimation(map);
@ -130,6 +132,10 @@ class MultiOnlineGamePage
map.putVideoOnCanvas(2, 3);
if (e.key == 't')
map.putVideoOnCanvas(1, 3);
if (e.key == 'l')
map.reCreate("player");
if (e.key == 'k')
map.reCreate("opponent");
})
renderer.setAnimationLoop(loop)
@ -225,4 +231,4 @@ function loop()
////////////
}
export { MultiOnlineGamePage, opponent, ball };
export { MultiOnlineGamePage, player, opponent, ball };