unibutton/js/player.js
2024-09-27 21:42:21 -04:00

11 lines
No EOL
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;
}