This commit is contained in:
Baptiste 2023-11-14 17:11:05 +01:00
parent 1dd378518b
commit 6ad927571a
3 changed files with 9 additions and 2 deletions

BIN
assets/body.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 968 B

View file

@ -3,5 +3,7 @@ setInterval(game);
function game() {
Renderer = new Render("canvas")
Renderer.AddPlayer(3, 5, )
let rubiks = new Player(1, 100, 50, "rubiks")
console.log(rubiks)
Renderer.AddPlayer(rubiks)
}

View file

@ -2,13 +2,18 @@ class Render {
constructor(id) {
this.canvas = document.getElementById(id)
this.ctx = canvas.getContext("2d")
this.players = []
this.ReloadAff()
}
AddPlayer(id, pseudo, x, y, angle) {
this.players[id] = (id, pseudo, x, y, angle)
}
ReloadAff() {
this.ctx.fillStyle = "red"
this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height);
/*this.ctx.stokeStyle = "black"
this.ctx.lineWidth = 1;
ctx.beginPath();