- new class SoloGame/MultiGame
This commit is contained in:
Kum1ta
2024-08-28 14:09:54 +02:00
parent 96de42ec95
commit 6aa715978e
9 changed files with 299 additions and 175 deletions

View File

@ -0,0 +1,50 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Opponent.js :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/21 10:34:49 by edbernar #+# #+# */
/* Updated: 2024/08/28 11:39:59 by edbernar ### ########.fr */
/* */
/* ************************************************************************** */
import { playerExist } from './Player'
import * as THREE from 'three';
// import * as THREE from '/static/javascript/three/build/three.module.js';
let opponentExist = false;
class Opponent
{
object = null;
speed = 0.1;
interval = null;
limits = {};
player = null;
constructor (object, map)
{
if (opponentExist)
throw Error("Opponent is already init.");
opponentExist = true;
this.object = object;
this.limits = map.limits;
this.object.position.set(0, 0.3, -map.mapLength / 2 + 0.2);
}
dispose()
{
opponentExist = false;
}
update()
{
//en attente du serveur
}
}
export { Opponent };