Site
- Add multi local game - Some minor changes in html/css Django - add path for /game and /multiLocalGamePage - add template for multiLocalGame
This commit is contained in:
@ -0,0 +1,56 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* Ball.js :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/08/28 15:58:03 by edbernar #+# #+# */
|
||||
/* Updated: 2024/09/14 00:19:46 by edbernar ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
import * as THREE from '/static/javascript/three/build/three.module.js'
|
||||
import { wallTop, wallBottom } from '/static/javascript/multiLocalGame/Map.js'
|
||||
|
||||
let ball = null;
|
||||
let speed = 0.15;
|
||||
let dir = -1;
|
||||
let interval = null;
|
||||
|
||||
class Ball
|
||||
{
|
||||
static create(scene)
|
||||
{
|
||||
ball = createBall();
|
||||
|
||||
scene.add(ball);
|
||||
ball.rotateY(2.39);
|
||||
}
|
||||
|
||||
static dispose()
|
||||
{
|
||||
ball = null;
|
||||
}
|
||||
|
||||
static update()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function createBall()
|
||||
{
|
||||
const geometry = new THREE.SphereGeometry(0.3);
|
||||
const material = new THREE.MeshPhysicalMaterial({color: 0xffffff});
|
||||
const mesh = new THREE.Mesh(geometry, material);
|
||||
|
||||
mesh.position.y += 0.3;
|
||||
mesh.castShadow = true;
|
||||
mesh.receiveShadow = true;
|
||||
mesh.material.transparent = true;
|
||||
mesh.position.set (0, mesh.position.y, 0);
|
||||
return (mesh);
|
||||
}
|
||||
|
||||
export { Ball, ball };
|
Reference in New Issue
Block a user