update for kirby
This commit is contained in:
parent
8d61067ee2
commit
0437902699
3 changed files with 3 additions and 3 deletions
|
@ -99,7 +99,7 @@ export class Env {
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Animate all the players in the environnement
|
* Animate all the entities in the environnement
|
||||||
*/
|
*/
|
||||||
animate = () => {
|
animate = () => {
|
||||||
// Player animation
|
// Player animation
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { Rotation } from "./utils.js";
|
||||||
|
|
||||||
export class Player extends Cube {
|
export class Player extends Cube {
|
||||||
constructor(color) {
|
constructor(color) {
|
||||||
super(color, "assets/images/player.png");
|
super(color, "assets/images/player.jpg");
|
||||||
|
|
||||||
this.data.position.x = -2;
|
this.data.position.x = -2;
|
||||||
this.data.rotation.x = this.gameRotation;
|
this.data.rotation.x = this.gameRotation;
|
||||||
|
|
|
@ -20,7 +20,7 @@ const main = () => {
|
||||||
env.addToScene(plan);
|
env.addToScene(plan);
|
||||||
|
|
||||||
// Player
|
// Player
|
||||||
const player = new Player(THREE.Color.NAMES.red);
|
const player = new Player(THREE.Color.NAMES.pink);
|
||||||
env.addToScene(player, TypeEntity.player);
|
env.addToScene(player, TypeEntity.player);
|
||||||
addEventListener("keypress", player.controlUser);
|
addEventListener("keypress", player.controlUser);
|
||||||
|
|
||||||
|
|
Reference in a new issue