expanding map
This commit is contained in:
parent
4602947942
commit
e584361465
5 changed files with 27 additions and 10 deletions
|
@ -2,7 +2,7 @@ import Player from "./player.js";
|
|||
|
||||
class GameBasic {
|
||||
constructor() {
|
||||
let player = new Player(false,true);
|
||||
let player = new Player(false, true);
|
||||
let entities = [player];
|
||||
|
||||
/*for (let i = 0; i < 50; i++) {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { distF, uuidv4 } from './util.js'
|
||||
|
||||
class Player {
|
||||
constructor(you, isPlayer) {
|
||||
let pos = { x: Math.random() * 1000 - 50, y: Math.random() * 1000 - 50 };
|
||||
constructor(you, isPlayer, game = false) {
|
||||
let pos = { x: (Math.random() - 0.5) * (game ? game.width : 1000), y:(Math.random() - 0.5) * (game ? game.height : 1000) };
|
||||
let camera = { x: -pos.x, y: -pos.y };
|
||||
let vel = { x: 0, y: 0 };
|
||||
|
||||
|
@ -30,11 +30,11 @@ class Player {
|
|||
this.isYou = false;
|
||||
|
||||
this.serverProps = [
|
||||
'type', 'camera','pos','vel','rot','dir','ticks','health','you','isPlayer','headCount','isMenu','r','isYou'
|
||||
'type', 'camera', 'pos', 'vel', 'rot', 'dir', 'ticks', 'health', 'you', 'isPlayer', 'headCount', 'isMenu', 'r', 'isYou'
|
||||
];
|
||||
|
||||
this.legalProps = [
|
||||
'vel','dir','camera','ticks','isMenu','r'
|
||||
'vel', 'dir', 'camera', 'ticks', 'isMenu', 'r'
|
||||
];
|
||||
}
|
||||
bump() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue