summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrexim <reximkut@gmail.com>2024-03-22 00:15:34 +0700
committerrexim <reximkut@gmail.com>2024-03-22 00:15:34 +0700
commiteedb108ad95f317aa1ad7b8f7e187465edf23748 (patch)
treee3e55a8a9cb2691063895fac96916c67202f02c1
parent4039d5be3bd7034cab1c136db38f5842459207a0 (diff)
Fix some TODOs
- Randomize Path Finding to spice it up, - Fix the bug with explosions being treated as wall during Path Finding.
-rw-r--r--game.adb29
-rw-r--r--map.pngbin1028 -> 1033 bytes
2 files changed, 18 insertions, 11 deletions
diff --git a/game.adb b/game.adb
index b34bd4f..67452df 100644
--- a/game.adb
+++ b/game.adb
@@ -338,7 +338,9 @@ procedure Game is
if not Within_Map(Game, (X, Y)) then
return False;
end if;
- if Game.Map(Y, X) /= Floor then
+ -- NOTE: it's fine to step into the explosions, because they don't live long enough.
+ -- They disappear on the next turn.
+ if Game.Map(Y, X) /= Floor and Game.Map(Y, X) /= Explosion then
return False;
end if;
for Index in Eeper_Index loop
@@ -924,20 +926,26 @@ procedure Game is
if Game.Eepers(Me).Attack_Cooldown <= 0 then
declare
Current : constant Integer := Game.Eepers(Me).Path(Game.Eepers(Me).Position.Y, Game.Eepers(Me).Position.X);
+ Available_Positions: array (0..Direction_Vector'Length-1) of IVector2;
+ Count: Integer := 0;
begin
- Search: for Dir in Direction loop
+ for Dir in Direction loop
declare
Position: IVector2 := Game.Eepers(Me).Position;
begin
while Eeper_Can_Stand_Here(Game, Position, Me) loop
Position := Position + Direction_Vector(Dir);
if Within_Map(Game, Position) and then Game.Eepers(Me).Path(Position.Y, Position.X) = Current - 1 then
- Game.Eepers(Me).Position := Position;
- exit Search;
+ Available_Positions(Count) := Position;
+ Count := Count + 1;
+ exit;
end if;
end loop;
end;
- end loop Search;
+ end loop;
+ if Count > 0 then
+ Game.Eepers(Me).Position := Available_Positions(Random_Integer.Random(Gen) mod Count);
+ end if;
end;
Game.Eepers(Me).Attack_Cooldown := GUARD_ATTACK_COOLDOWN;
else
@@ -1354,10 +1362,9 @@ begin
Close_Window;
end;
--- TODO: During Path Finding maybe pick the equal paths randomly.
--- to introduce a bit of RNG into this pretty deterministic game
--- TODO: Path finding considers explosion impenetrable @bug
--- TODO: Bug with pushing Eepers back on timer 0
+-- TODO: Special Eeper Eyes expression when something explodes.
+-- TODO: Special Eeper Eyes on Damage
+-- TODO: Bug with pushing Eepers back on timer 0 (dodging)
-- TODO: Place bombs directly at the Player's position
-- TODO: Disallow placing bomb on the same position more than once
-- Especially important if we gonna allow placing bombs at the position of the Player
@@ -1385,14 +1392,14 @@ end;
-- TODO: Default 16:9 resolution
-- TODO: Fullscreen mode
-- TODO: Compile MinGW build with Windows Subsystem (so it does not show cmd window)
--- TODO: Don't reset cooldown timer for bosses (might be duplicate)
+-- TODO: Don't reset cooldown timer for eepers (might be duplicate)
+-- Maybe just pause
-- TODO: Try MSAA (if too slow, don't)
-- TODO: Bake assets into executable
-- TODO: Rename executable to "eepers"
-- TODO: Icon on for Windows build
-- TODO: Checkpoints must refill the bombs
-- TODO: Closed eyes should always point down
--- TODO: Special Eeper Eyes on Damage
-- TODO: Show Eeper Cooldown timer outside of the screen somehow
-- TODO: Visual Clue that the Eeper is about to kill the Player when Completely outside of the Screen
-- - Cooldown ball is shaking
diff --git a/map.png b/map.png
index 292ca3e..619045f 100644
--- a/map.png
+++ b/map.png
Binary files differ