mirror of
https://git.leinelab.org/Mal/mr-crocs-adventures.git
synced 2025-09-11 02:57:36 +02:00
Dialogs and function for new terrain.
This commit is contained in:
@@ -136,7 +136,7 @@ const FRAME_DURATION = 1000 / FPS;
|
||||
const GAME_SPEED = 1;
|
||||
const GRAVITY = 2;
|
||||
|
||||
let levelJson = new FileLoader('levels/test_depth.json');
|
||||
let levelJson = new FileLoader('levels/level01.json');
|
||||
|
||||
const LEVEL = JSON.parse(levelJson.getContent());
|
||||
|
||||
|
||||
@@ -21,7 +21,13 @@ export default class RetroArchitecture
|
||||
init()
|
||||
{
|
||||
for (let y = 0; y < this.rows; y++) {
|
||||
this.matrix.push(Array(this.columns).fill(null));
|
||||
let row = [];
|
||||
|
||||
for (let x = 0; x < this.columns; x++) {
|
||||
row.push(null);
|
||||
}
|
||||
console.log(row);
|
||||
this.matrix.push(row);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,7 +157,7 @@ export default class RetroArchitecture
|
||||
for (let x = viewX; x < viewWidth; x++) {
|
||||
let field = this.matrix[y][x];
|
||||
|
||||
if (field !== null) {
|
||||
if (field !== null && field !== undefined) {
|
||||
context.drawImage(
|
||||
this.tileset.canvas,
|
||||
field.tile * this.tileWidth,
|
||||
|
||||
Reference in New Issue
Block a user