son
This commit is contained in:
parent
dbb0e87054
commit
7bfc91379c
3 changed files with 5 additions and 5 deletions
|
@ -1,8 +1,8 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<script type="text/javascript" src="./js/class.js"></script>
|
||||
<script type="text/javascript" src="./js/sound.js"></script>
|
||||
<script type="text/javascript" src="./js/class.js"></script>
|
||||
<script type="text/javascript" src="./js/objects.js"></script>
|
||||
<script type="text/javascript" src="./js/render.js"></script>
|
||||
<script type="text/javascript" src="./js/input.js"></script>
|
||||
|
|
|
@ -7,6 +7,9 @@ const bulletSpeed=playerSpeed*2;
|
|||
const halfSqrtTwo=0.70710678118;
|
||||
const defaulthealth=10.;
|
||||
|
||||
let sound = new Sound("./assets/sounds/");
|
||||
sound.loadSounds();
|
||||
|
||||
class Player
|
||||
{
|
||||
constructor (id,x,y,name, dir,net)
|
||||
|
@ -113,6 +116,7 @@ class Bullet
|
|||
{
|
||||
constructor (x,y,dx,dy,id)
|
||||
{
|
||||
sound.shoot();
|
||||
this.x=x;
|
||||
this.y=y;
|
||||
this.dx=dx;
|
||||
|
|
|
@ -28,9 +28,6 @@ let player = null;
|
|||
|
||||
Inp = new Input("canvas", Net,Renderer);
|
||||
|
||||
let sound = new Sound("./assets/sounds/");
|
||||
sound.loadSounds()
|
||||
|
||||
playerId=Net.playerId;
|
||||
player=Net.clientPlayer;
|
||||
players=Net.getPlayersToAdd();
|
||||
|
@ -99,7 +96,6 @@ function addBullets()
|
|||
bulletsToAdd.forEach((b) => {
|
||||
bullets.push(b);
|
||||
Renderer.addBullet(b);
|
||||
sound.shoot()
|
||||
});
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue