Compare commits

..

No commits in common. "c874a7d228514fe167a164866ab424c2cff67de3" and "155e82aaf0599ad5bff90430e54e767a31dca8e5" have entirely different histories.

3 changed files with 24 additions and 29 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

@ -1,21 +1,21 @@
x S S S x x x
x xxxxx xxxxx xxxxxx x x x
x x x x
x S S x x S S x
x xxxxxx S S xxxxxxxxxx xxxxx x x xxxxxx S S x
x xxxxxxxxxxx x x x xxxxxxxxxxx x
x x xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x
x xxxxx S x x x x xxxxx x x xxxxx x
x xxxxxx x xxxxx x xxx x x x x x xxxxxx x x
x x xxxxxxxxx x x xxxxx S xx x x x x xxxxxxxxx x
x S S x x x xxxxxxxxxxx xxx xxxxxxxxxxxxx x xxxxx x x S S x x x
x xxxxxx xxxxxx xxxxx xxxxx xxxxxxx xxxxx S x x x x x x xxxxx x x xxxxxx xxxxxx xxxxx xxxxx xxxxxxx xxxxx x
x x x xxxxxxxxxxx x x x xxx xx x x x x x
x x x xxx x xxx x x x x x x xxx x
x x S x x x S S x S x xxxxxxx x x x S x x x S S x
xxxxxxxxxx xxxxx xxxxx x xxxx xxx x xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x xxxxx x xxxxxxxxxx xxxxx xxxxx x xxxx xxx x xxxxx xxxxx x
x x x x x x x x x x x
x S S S x xxx x x x x S S S x xxx x x
x P S S S S S x x x x E x x P S S S S S x x x E x
xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

View File

@ -98,14 +98,11 @@ pub const GameScene = struct {
const bounds = viewport.bounds; const bounds = viewport.bounds;
const background = renderer.textures.get("background_jungle").?; const background = renderer.textures.get("background_jungle").?;
const backgroundColor = allegro.mapRgb(211, 229, 252);
const backgroundDisplacementFactor = -0.01; const backgroundDisplacementFactor = -0.01;
const backgroundCenter = self.game.playerPosition.x * backgroundDisplacementFactor; const backgroundCenter = self.game.playerPosition.x * backgroundDisplacementFactor;
const backgroundLeft = @mod(backgroundCenter, 1.0) - 1; 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 * 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()); background.drawScaled(bounds.min.x + (backgroundLeft + 1) * bounds.width(), bounds.min.y, bounds.width(), bounds.height());
@ -131,16 +128,15 @@ pub const GameScene = struct {
const ordinals = tiles.getOrdinals(x, y, .Grass); const ordinals = tiles.getOrdinals(x, y, .Grass);
var offset: usize = 17; var offset: usize = 17;
switch (ordinals.count()) { switch (ordinals.count()) {
0 => offset = 16,
1 => { 1 => {
if (ordinals.right) offset = 12; if (ordinals.right) offset = 0;
if (ordinals.left) offset = 13; if (ordinals.left) offset = 3;
if (ordinals.top) offset = 15; if (ordinals.top) offset = 15;
if (ordinals.bottom) offset = 14; if (ordinals.bottom) offset = 14;
}, },
2 => { 2 => {
if (ordinals.right and ordinals.left) offset = 0 + self.game.randomTileOffset(x, y, 4); if (ordinals.right and ordinals.left) offset = 1 + self.game.randomTileOffset(x, y, 2);
if (ordinals.top and ordinals.bottom) offset = 20 + self.game.randomTileOffset(x, y, 2); if (ordinals.top and ordinals.bottom) offset = 12;
if (ordinals.top and ordinals.left) offset = 9; if (ordinals.top and ordinals.left) offset = 9;
if (ordinals.top and ordinals.right) offset = 8; if (ordinals.top and ordinals.right) offset = 8;
if (ordinals.right and ordinals.bottom) offset = 4; if (ordinals.right and ordinals.bottom) offset = 4;
@ -148,7 +144,6 @@ pub const GameScene = struct {
}, },
3 => { 3 => {
if (!ordinals.left) offset = 6; if (!ordinals.left) offset = 6;
if (!ordinals.top) offset = 18 + self.game.randomTileOffset(x, y, 2);
if (!ordinals.right) offset = 7; if (!ordinals.right) offset = 7;
if (!ordinals.bottom) offset = 10 + self.game.randomTileOffset(x, y, 2); if (!ordinals.bottom) offset = 10 + self.game.randomTileOffset(x, y, 2);
}, },