expanding map

This commit is contained in:
biglyderv 2024-11-25 14:14:20 -05:00
parent 4602947942
commit e584361465
5 changed files with 27 additions and 10 deletions

View file

@ -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++) {

View file

@ -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() {