Compare commits

..

No commits in common. "c7930db4146e3d57bfbb459101d8bce7767cc83c" and "61d024b56daa9ef536148311fc1ba95b786ff540" have entirely different histories.

5 changed files with 24 additions and 31 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

@ -2,20 +2,20 @@ x
x x x x
x x x x
x S S x x S S x
x xxxxxx S S x x xxxxxx x
x xxxxxxxxxxx x
x x x x
x xxxxx x x x
x xxxxxx x x x x
x x xxxxxxxxx x x xxxxxx x
x S S x x x x x
x xxxxxx xxxxxx xxxxx xxxxx xxxxxxx xxxxx x x x
x x x x x xxxxxx x
x x x xxx x x x
x x S x x x x x x
xxxxxxxxxx xxxxx xxxxx x xxxx xxx x x x x
x x x x x xxxxxxxxxx x
x S S S x xxx x x x x
x P S S S S S x x x x x S S S x
xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x P S S S S x
xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

View File

@ -47,8 +47,8 @@ pub const Context = struct {
const events = try allegro.createEventQueue(); const events = try allegro.createEventQueue();
allegro.setNewDisplayOption(allegro.NewDisplayOption.VSYNC, 1, allegro.OptionImportance.SUGGEST); allegro.setNewDisplayOption(allegro.NewDisplayOption.VSYNC, 1, allegro.OptionImportance.SUGGEST);
// allegro.setNewDisplayOption(allegro.NewDisplayOption.SAMPLE_BUFFERS, 1, allegro.OptionImportance.REQUIRE); allegro.setNewDisplayOption(allegro.NewDisplayOption.SAMPLE_BUFFERS, 1, allegro.OptionImportance.REQUIRE);
// allegro.setNewDisplayOption(allegro.NewDisplayOption.SAMPLES, 4, allegro.OptionImportance.REQUIRE); allegro.setNewDisplayOption(allegro.NewDisplayOption.SAMPLES, 4, allegro.OptionImportance.REQUIRE);
allegro.setNewDisplayFlags(allegro.NewDisplayFlags{ .RESIZABLE = true }); allegro.setNewDisplayFlags(allegro.NewDisplayFlags{ .RESIZABLE = true });
const display = try allegro.createDisplay(DefaultDisplayWidth, DefaultDisplayHeight); const display = try allegro.createDisplay(DefaultDisplayWidth, DefaultDisplayHeight);

View File

@ -89,7 +89,7 @@ pub const Game = struct {
self.playerVelocity.y = 0; self.playerVelocity.y = 0;
} else if (self.playerVelocity.y < 0 and self.playerIsUnderTile()) { } else if (self.playerVelocity.y < 0 and self.playerIsUnderTile()) {
self.playerPosition.y = std.math.ceil(self.playerPosition.y); self.playerPosition.y = std.math.ceil(self.playerPosition.y);
self.playerVelocity.y = 0.1; self.playerVelocity.y = -self.playerVelocity.y;
} }
if (self.playerVelocity.x != 0) { if (self.playerVelocity.x != 0) {
const playerTileTop = @floatToInt(i64, std.math.floor(self.playerPosition.y)); const playerTileTop = @floatToInt(i64, std.math.floor(self.playerPosition.y));
@ -101,13 +101,7 @@ pub const Game = struct {
self.playerVelocity.x = 0; self.playerVelocity.x = 0;
} }
} }
if (self.playerVelocity.x > 0) { // const playerTileRight = @floatToInt(i64, std.math.floor(self.playerPosition.x)) + 1;
const playerTileRight = @floatToInt(i64, std.math.floor(self.playerPosition.x)) + 1;
if (self.level.tiles.get(playerTileRight, playerTileTop) != null or self.level.tiles.get(playerTileRight, playerTileBottom) != null) {
self.playerPosition.x = std.math.floor(self.playerPosition.x);
self.playerVelocity.x = 0;
}
}
} }
self.playerDirection = if (self.playerVelocity.x == 0) self.playerDirection else if (self.playerVelocity.x > 0) Direction.Right else Direction.Left; self.playerDirection = if (self.playerVelocity.x == 0) self.playerDirection else if (self.playerVelocity.x > 0) Direction.Right else Direction.Left;

View File

@ -121,7 +121,6 @@ pub const GameScene = struct {
3 => { 3 => {
if (!ordinals.left) offset = 6; if (!ordinals.left) offset = 6;
if (!ordinals.right) offset = 7; if (!ordinals.right) offset = 7;
if (!ordinals.bottom) offset = 10 + self.game.randomTileOffset(x, y, 2);
}, },
else => {}, else => {},
} }