Global
- remove some useless console.log - remove useless files
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/08/20 17:02:47 by edbernar #+# #+# */
|
||||
/* Updated: 2024/11/15 15:41:01 by edbernar ### ########.fr */
|
||||
/* Updated: 2024/11/18 17:02:43 by edbernar ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -3,10 +3,10 @@
|
||||
/* ::: :::::::: */
|
||||
/* Map.js :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: hubourge <hubourge@student.42.fr> +#+ +:+ +#+ */
|
||||
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/08/20 14:52:55 by hubourge #+# #+# */
|
||||
/* Updated: 2024/11/11 18:13:57 by hubourge ### ########.fr */
|
||||
/* Updated: 2024/11/18 17:02:45 by edbernar ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -15,7 +15,6 @@ import { files } from '/static/javascript/filesLoader.js';
|
||||
import * as THREE from '/static/javascript/three/build/three.module.js'
|
||||
import { Video } from '/static/javascript/multiOnlineGame/Video.js';
|
||||
import { player, ball} from '/static/javascript/multiOnlineGame/multiOnlineGamePage.js';
|
||||
// import { Ball } from '/static/javascript/multiOnlineGame/Ball.js'
|
||||
|
||||
let loader = null;
|
||||
let scene = null;
|
||||
|
@ -3,10 +3,10 @@
|
||||
/* ::: :::::::: */
|
||||
/* Player.js :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: hubourge <hubourge@student.42.fr> +#+ +:+ +#+ */
|
||||
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/08/18 00:30:31 by edbernar #+# #+# */
|
||||
/* Updated: 2024/11/14 15:31:28 by hubourge ### ########.fr */
|
||||
/* Updated: 2024/11/18 17:02:43 by edbernar ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -86,7 +86,6 @@ class Player
|
||||
playerExist = true;
|
||||
isOnPointAnim = false;
|
||||
pressedButton = [];
|
||||
console.log(layoutSelected);
|
||||
key = {up: layoutSelected.US ? "w" : "z", down: "s", left: layoutSelected.US ? "a" : "q", right: "d"};
|
||||
this.opponentGoal = availableGoals[goalIdOppenent];
|
||||
this.object = object;
|
||||
@ -568,7 +567,6 @@ function addKeyTouch(event)
|
||||
const keyAction = [key.left, key.right, key.up, key.down];
|
||||
const keyList = ['padLeft', 'padRight', 'padTop', 'padBottom'];
|
||||
|
||||
console.log(key);
|
||||
for (let i = 0; i < keyList.length; i++)
|
||||
{
|
||||
if (keyList[i] == keyId)
|
||||
|
@ -6,11 +6,10 @@
|
||||
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/08/18 00:53:53 by edbernar #+# #+# */
|
||||
/* Updated: 2024/11/15 17:07:44 by edbernar ### ########.fr */
|
||||
/* Updated: 2024/11/18 17:04:49 by edbernar ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
import { OrbitControls } from '/static/javascript/three/examples/jsm/controls/OrbitControls.js'
|
||||
import { availableSkins, lastSelectedGoal } from '/static/javascript/lobbyPage/3d.js';
|
||||
import { VRButton } from "/static/javascript/three/examples/jsm/webxr/VRButton.js"
|
||||
import { Opponent } from '/static/javascript/multiOnlineGame/Opponent.js'
|
||||
@ -22,35 +21,6 @@ import { Map } from '/static/javascript/multiOnlineGame/Map.js'
|
||||
import { sendRequest } from "/static/javascript/websocket.js";
|
||||
import { files } from '/static/javascript/filesLoader.js';
|
||||
|
||||
/*
|
||||
Controls :
|
||||
- w : monter
|
||||
- s : descendre
|
||||
- a : gauche
|
||||
- d : droite
|
||||
|
||||
- g : animation de point
|
||||
- h : animation de point pour l'adversaire
|
||||
- c : switch entre la vue du joueur et la vue de la caméra
|
||||
- q : lancer animation sur les jumpers
|
||||
|
||||
- 8 : avance la balle
|
||||
- 2 : recule la balle
|
||||
- 4 : balle vers la gauche
|
||||
- 6 : balle vers ladroite
|
||||
- 9 : inversion gravite
|
||||
|
||||
- p : clear video
|
||||
- o : goal video
|
||||
- i : outstanding video
|
||||
- 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;
|
||||
let map = null;
|
||||
let ball = null;
|
||||
@ -78,11 +48,6 @@ const observer = new MutationObserver((mutationsList) => {
|
||||
});
|
||||
});
|
||||
|
||||
// ------------------- (need to be remove) -------------------- //
|
||||
const cameraTmp = new THREE.PerspectiveCamera(90, window.innerWidth / window.innerHeight);
|
||||
let controls = null;
|
||||
// ------------------------------------------------------------ //
|
||||
|
||||
class MultiOnlineGamePage
|
||||
{
|
||||
static create(skin)
|
||||
@ -128,24 +93,16 @@ class MultiOnlineGamePage
|
||||
map.ballObject = ball.object;
|
||||
if (isMobile)
|
||||
player.mobileMode();
|
||||
//////////////////////////
|
||||
controls = new OrbitControls(cameraTmp, renderer.domElement)
|
||||
cameraTmp.position.set(5, 3, 5);
|
||||
controls.target = new THREE.Vector3(map.centerPos.x, 0, map.centerPos.z);
|
||||
//////////////////////////
|
||||
|
||||
document.addEventListener('keypress', (e) => {
|
||||
if (e.key == 'g')
|
||||
{
|
||||
player.pointAnimation(map);
|
||||
map.animationGoal(ball.object.position.x, ball.object.position.y, ball.object.position.z, player.playerGoalAnimation);
|
||||
console.log('player.playerGoalAnimation', player.playerGoalAnimation);
|
||||
}
|
||||
if (e.key == 'h')
|
||||
{
|
||||
player.pointOpponentAnimation(map, opponent.object);
|
||||
map.animationGoal(ball.object.position.x, ball.object.position.y, ball.object.position.z, opponent.playerGoalAnimation);
|
||||
console.log('player.playerGoalAnimation', opponent.playerGoalAnimation);
|
||||
}
|
||||
if (e.key == 'c')
|
||||
debug = !debug;
|
||||
@ -320,13 +277,7 @@ function loop()
|
||||
opponent.update();
|
||||
ball.update();
|
||||
map.update(ball);
|
||||
if (debug)
|
||||
{
|
||||
controls.update();
|
||||
renderer.render(scene, cameraTmp);
|
||||
}
|
||||
else
|
||||
renderer.render(scene, player.camera);
|
||||
renderer.render(scene, player.camera);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user