first commit! 🎉
This commit is contained in:
commit
c35c18bbbc
19 changed files with 1046 additions and 0 deletions
20
common/player.js
Normal file
20
common/player.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
export default class Player {
|
||||
static SPEED = 400.0;
|
||||
static SIZE = 50.0;
|
||||
|
||||
constructor(name, x, y, colour) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.in_x = 0.0;
|
||||
this.in_y = 0.0;
|
||||
this.draw_x = x;
|
||||
this.draw_y = y;
|
||||
this.name = name;
|
||||
this.colour = colour;
|
||||
}
|
||||
|
||||
update(delta) {
|
||||
if (this.in_x != 0) this.x += this.in_x * Player.SPEED * delta;
|
||||
if (this.in_y != 0) this.y += this.in_y * Player.SPEED * delta;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue