So much stuff happened idek

This commit is contained in:
rain
2023-11-16 15:03:24 -06:00
parent 839d6c2c20
commit 1eef69f514
8 changed files with 126 additions and 62 deletions
+16
View File
@@ -0,0 +1,16 @@
export default {
data: {
name: "Arcadia",
gravity: 1,
spawn: {x:100, y:0},
platforms: [
{x: 150, y: 200, w: 100, h: 10},
{x: 100, y: 220, w: 100, h: 10},
{x: 0, y: 260, w: 500, h: 10}
],
enemies: [
{entity: null,type: "zombie", x:130, y:100},
{entity: null,type: "zombie", x:140, y:50}
]
}
}
+8 -8
View File
@@ -1,14 +1,14 @@
import data from './arcadia.js';
export class Map {
constructor(game, mapName) {
this.game = game;
this.map = mapName;
this.gravity = 1;
// x, y, w, h
this.platforms = [
{x: 150, y: 200, w: 100, h: 10},
{x: 100, y: 220, w: 100, h: 10},
{x: 0, y: game.height-10, w: game.width, h: 10}
]
this.map = data.data;
this.player = null;
this.ghost = null;
this.mapName = mapName;
this.platforms = this.map['platforms'];
this.enemies = this.map['enemies'];
this.gravity = this.map.gravity;
}
draw(ctx) {
for(var i = 0;i < this.platforms.length;i++) {