Skip to content

Commit

Permalink
simplify, remove warmup code
Browse files Browse the repository at this point in the history
  • Loading branch information
KilledByAPixel committed Nov 23, 2024
1 parent 49ed065 commit bc82650
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
8 changes: 1 addition & 7 deletions examples/platformer/gameLevel.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const tileType_solid = 1;
const tileType_breakable = 2;

let player, playerStartPos, tileLayers, foregroundLayerIndex, sky;
let levelSize, levelColor, levelBackgroundColor, levelOutlineColor, warmup;
let levelSize, levelColor, levelBackgroundColor, levelOutlineColor;

function buildLevel()
{
Expand All @@ -38,12 +38,6 @@ function buildLevel()
for (pos.y=levelSize.y; pos.y--;)
decorateTile(pos, layer);

// warm up level
warmup = 1;
for (let i = 500; i--;)
engineObjectsUpdate();
warmup = 0;

// spawn player
player = new Player(playerStartPos);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/platformer/gameObjects.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class GameObject extends EngineObject

// kill if below level
if (!this.isDead() && this.pos.y < -9)
warmup ? this.destroy() : this.kill();
this.kill();
}

damage(damage, damagingObject)
Expand Down

0 comments on commit bc82650

Please sign in to comment.