Compare commits

...

2 Commits

Author SHA1 Message Date
c874a7d228 Tweaked level.
Added/corrected some tiles.
Added background color.
2023-06-05 07:24:44 +02:00
954a46f965 Extended the level.
Add missing grass tiles.
2023-06-05 06:43:46 +02:00
3 changed files with 29 additions and 24 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@ -1,21 +1,21 @@
x x
x x
x S S S x
x xxxxx xxxxx xxxxxx x
x x
x S S x
x xxxxxx S S x
x xxxxxx S S xxxxxxxxxx xxxxx x
x xxxxxxxxxxx x 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 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
x x
x xxxxx x
x xxxxxx x x
x x xxxxxxxxx x
x S S x x x
x xxxxxx xxxxxx xxxxx xxxxx xxxxxxx xxxxx x
x x x x
x x x xxx x
x x S x x x S S x
xxxxxxxxxx xxxxx xxxxx x xxxx xxx x xxxxx xxxxx x
x x x x x
x S S S x xxx x x
x P S S S S S x x x E x
xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
x x S x x x S S x S x xxxxxxx x
xxxxxxxxxx xxxxx xxxxx x xxxx xxx x xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x xxxxx x
x x x x x x
x S S S x xxx x x x
x P S S S S S x x x x E x
xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

View File

@ -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());
@ -128,15 +131,16 @@ pub const GameScene = struct {
const ordinals = tiles.getOrdinals(x, y, .Grass);
var offset: usize = 17;
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;
@ -144,6 +148,7 @@ pub const GameScene = struct {
},
3 => {
if (!ordinals.left) offset = 6;
if (!ordinals.top) offset = 18 + self.game.randomTileOffset(x, y, 2);
if (!ordinals.right) offset = 7;
if (!ordinals.bottom) offset = 10 + self.game.randomTileOffset(x, y, 2);
},