change player assets

This commit is contained in:
Baptiste 2023-12-06 08:39:00 +01:00
parent 47ac036995
commit 7b3a8d4b82
7 changed files with 3 additions and 4 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 MiB

BIN
assets/pacman.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

View file

@ -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>

View file

@ -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

View file

@ -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);
} }