diff --git a/src/assets/images/tiles_grass_32.png b/src/assets/images/tiles_grass_32.png index ee54e25..e980985 100644 Binary files a/src/assets/images/tiles_grass_32.png and b/src/assets/images/tiles_grass_32.png differ diff --git a/src/assets/levels/level1.txt b/src/assets/levels/level1.txt index afc06bc..4e48f6a 100644 --- a/src/assets/levels/level1.txt +++ b/src/assets/levels/level1.txt @@ -7,8 +7,8 @@ x x x xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x xxxxx S x x x x xxxxx x x xxxxxx x xxxxx x xxx x x x x -x x xxxxxxxxx x x S xx x x -x S S x x x xxxxxxxxxxx xxxxx xxxxxxxxxxxxx x xxxxx x +x x xxxxxxxxx x x xxxxx S xx x x +x S S x x x xxxxxxxxxxx xxx xxxxxxxxxxxxx x xxxxx x x xxxxxx xxxxxx xxxxx xxxxx xxxxxxx xxxxx S x x x x x x xxxxx x x x x xxxxxxxxxxx x x x xxx xx x x x x xxx x xxx x x x diff --git a/src/game_scene.zig b/src/game_scene.zig index b83756f..c679b22 100644 --- a/src/game_scene.zig +++ b/src/game_scene.zig @@ -98,11 +98,14 @@ pub const GameScene = struct { const bounds = viewport.bounds; const background = renderer.textures.get("background_jungle").?; + const backgroundColor = allegro.mapRgb(211, 229, 252); const backgroundDisplacementFactor = -0.01; const backgroundCenter = self.game.playerPosition.x * backgroundDisplacementFactor; const backgroundLeft = @mod(backgroundCenter, 1.0) - 1; + allegro.clearToColor(backgroundColor); + background.drawScaled(bounds.min.x + backgroundLeft * bounds.width(), bounds.min.y, bounds.width(), bounds.height()); background.drawScaled(bounds.min.x + (backgroundLeft + 1) * bounds.width(), bounds.min.y, bounds.width(), bounds.height()); @@ -130,14 +133,14 @@ pub const GameScene = struct { switch (ordinals.count()) { 0 => offset = 16, 1 => { - if (ordinals.right) offset = 0; - if (ordinals.left) offset = 3; + if (ordinals.right) offset = 12; + if (ordinals.left) offset = 13; if (ordinals.top) offset = 15; if (ordinals.bottom) offset = 14; }, 2 => { - if (ordinals.right and ordinals.left) offset = 1 + self.game.randomTileOffset(x, y, 2); - if (ordinals.top and ordinals.bottom) offset = 12; + if (ordinals.right and ordinals.left) offset = 0 + self.game.randomTileOffset(x, y, 4); + if (ordinals.top and ordinals.bottom) offset = 20 + self.game.randomTileOffset(x, y, 2); if (ordinals.top and ordinals.left) offset = 9; if (ordinals.top and ordinals.right) offset = 8; if (ordinals.right and ordinals.bottom) offset = 4;