finally, now multiplayer
This commit is contained in:
parent
873102a927
commit
b1501d7251
6 changed files with 93 additions and 17 deletions
|
@ -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;
|
|
@ -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;
|
Loading…
Add table
Add a link
Reference in a new issue