Confronta commit
2 commit
d9a4e8e5c8
...
335c1e87e1
| Autore | SHA1 | Data | |
|---|---|---|---|
|
|
335c1e87e1 | ||
|
|
7b3a8d4b82 |
7 ha cambiato i file con 3 aggiunte e 4 eliminazioni
BIN
assets/body.png
BIN
assets/body.png
File binario non mostrato.
|
Prima Larghezza: | Altezza: | Dimensione: 31 KiB Dopo Larghezza: | Altezza: | Dimensione: 36 KiB |
BIN
assets/body2.png
BIN
assets/body2.png
File binario non mostrato.
|
Prima Larghezza: | Altezza: | Dimensione: 92 KiB |
BIN
assets/body3.png
BIN
assets/body3.png
File binario non mostrato.
|
Prima Larghezza: | Altezza: | Dimensione: 3,1 MiB |
BIN
assets/pacman.png
File normale
BIN
assets/pacman.png
File normale
File binario non mostrato.
|
Dopo Larghezza: | Altezza: | Dimensione: 50 KiB |
|
|
@ -5,7 +5,6 @@
|
||||||
<script type="text/javascript" src="./js/render.js"></script>
|
<script type="text/javascript" src="./js/render.js"></script>
|
||||||
<script type="text/javascript" src="./js/input.js"></script>
|
<script type="text/javascript" src="./js/input.js"></script>
|
||||||
<script type="text/javascript" src="./js/network.js"></script>
|
<script type="text/javascript" src="./js/network.js"></script>
|
||||||
<script type="text/javascript" src="./js/keyboard.js"></script>
|
|
||||||
<script type="text/javascript" src="./js/game.js" defer></script>
|
<script type="text/javascript" src="./js/game.js" defer></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
let mapWidth = 210.;
|
let mapWidth = 210.;
|
||||||
let mapHeith = 100.;
|
let mapHeith = 100.;
|
||||||
const playerSize = 50.;
|
const playerSize = 75.;
|
||||||
const playerSpeed=.2;
|
const playerSpeed=.2;
|
||||||
const halfSqrtTwo=0.70710678118;
|
const halfSqrtTwo=0.70710678118;
|
||||||
class Player
|
class Player
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
const img = new Image();
|
const img = new Image();
|
||||||
img.src = "./assets/body3.png";
|
img.src = "./assets/body.png";
|
||||||
|
|
||||||
class Render {
|
class Render {
|
||||||
|
|
||||||
|
|
@ -32,7 +32,7 @@ class Render {
|
||||||
this.ctx.rotate(player.angle);
|
this.ctx.rotate(player.angle);
|
||||||
this.ctx.drawImage(img, -playerSize / 2, -playerSize / 2, playerSize, playerSize);
|
this.ctx.drawImage(img, -playerSize / 2, -playerSize / 2, playerSize, playerSize);
|
||||||
this.ctx.restore();
|
this.ctx.restore();
|
||||||
this.ctx.fillStyle="#FF0000";
|
this.ctx.fillStyle = 'white';
|
||||||
this.ctx.font="10pt arial";
|
this.ctx.font="10pt arial";
|
||||||
this.ctx.fillText(player.name,player.x-player.name.length*10/3,player.y-playerSize/1.8);
|
this.ctx.fillText(player.name,player.x-player.name.length*10/3,player.y-playerSize/1.8);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Caricamento…
Crea riferimento in una nuova segnalazione