Compare commits

..

No commits in common. "5a751f44f5913d482d1d3ee7e9ce13fb912f7ec9" and "07271d048df962fbcef4b43f5a08c03d4acb5457" have entirely different histories.

12 changed files with 7 additions and 15 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 359 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 460 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 776 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 733 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 715 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 520 KiB

View file

@ -1,5 +1,5 @@
let mapWidth = 210.;
let mapHeith = 100.;
const mapWidth = 210.;
const mapHeith = 100.;
const playerSize = 50.;
const playerSpeed=2.;
const halfSqrtTwo=0.70710678118;

View file

@ -1,5 +1,6 @@
<html>
<head>
<link rel="stylesheet" href="./style.css">
<script type="text/javascript" src="./class.js"></script>
<script type="text/javascript" src="./render.js"></script>
<script type="text/javascript" src="./game.js" defer></script>

View file

@ -1,4 +1,4 @@
Renderer = new Render("canvas", "./assets/map/map7_recadr.png");
Renderer = new Render("canvas");
let players = [new Player(1, 100, 50, "rubiks"),
new Player(2, 500, 70, "atsuyo"),

View file

@ -1,9 +1,8 @@
class Render {
constructor(id, mapsrc) {
constructor(id) {
this.canvas = document.getElementById(id);
this.ctx = canvas.getContext("2d");
this.players = [];
this.mapsrc=mapsrc
this.ReloadAff();
}
@ -22,17 +21,9 @@ class Render {
}
ReloadAff() {
/*this.ctx.fillStyle = "red";
this.ctx.fillStyle = "red";
this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height);
*/
console.log(this.ctx.canvas.width)
const fond = new Image();
fond.src = this.mapsrc;
mapWidth = fond.width
mapHeith = fond.height
this.ctx.canvas.width = mapWidth
this.ctx.canvas.height = mapHeith
this.ctx.drawImage(fond, 0, 0, mapWidth, mapHeith);
this.players.forEach((player) => {
this.RenderPlayer(player);
})