Skip to content

Commit

Permalink
Added bottomOfTheWorld prop
Browse files Browse the repository at this point in the history
  • Loading branch information
Melchizedek6809 committed Jan 20, 2025
1 parent 17e579b commit 9ef2c9c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/content/floatingIslandsWorldGen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ export class FloatingIslandsWorldGen extends WorldGen {

preGen(world: World) {
const lcg = new LCG(world.seed);
world.bottomOfTheWorld = 800;

this.islandStep(world, lcg, 1000, 1000, 1000, 50, 0);
}
Expand Down
2 changes: 1 addition & 1 deletion src/world/entity/character.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export class Character extends Being {
return;
}

if (this.y < 800) {
if (this.y < this.world.bottomOfTheWorld) {
this.die();
}

Expand Down
1 change: 1 addition & 0 deletions src/world/world.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export class World {
blocks: BlockType[] = [];
blockTextureUrl = "";
worldgenHandler?: WorldGen;
bottomOfTheWorld = 0;

constructor(game: Game) {
this.seed = 1234;
Expand Down

0 comments on commit 9ef2c9c

Please sign in to comment.