finally, now multiplayer

This commit is contained in:
biglyderv 2024-11-25 14:14:20 -05:00
parent 873102a927
commit b1501d7251
6 changed files with 93 additions and 17 deletions

View file

@ -1,3 +1,5 @@
import Player from "./player.js";
class GameBasic {
constructor() {
let player = new Player(false,true);
@ -21,4 +23,6 @@ class GameBasic {
let that = this;
setInterval(function () { that.main() }, 1000 / 60);
}
}
}
export default GameBasic;

View file

@ -9,7 +9,7 @@ function uuidv4() {
}
function Player(you, isPlayer) {
let pos = { x: Math.random() * 5000 - 50, y: Math.random() * 5000 - 50 };
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 };
@ -84,4 +84,6 @@ Player.prototype.handleTick = function (game) {
}
}
}
}
}
export default Player;