11 lines
275 B
JavaScript
11 lines
275 B
JavaScript
|
function Player() {
|
||
|
let pos = { x: Math.random() * 1000 - 50, y: Math.random() * 1000 - 50 };
|
||
|
let camera = { x: -pos.x, y: -pos.y };
|
||
|
let vel = { x: 0, y: 0 };
|
||
|
|
||
|
this.camera = camera;
|
||
|
this.pos = pos;
|
||
|
this.vel = vel;
|
||
|
this.rot = 0;
|
||
|
this.dir = 1;
|
||
|
}
|