diff options
author | rexim <reximkut@gmail.com> | 2024-03-12 03:17:37 +0700 |
---|---|---|
committer | rexim <reximkut@gmail.com> | 2024-03-12 03:17:37 +0700 |
commit | 30d19db7bf43d095b1d3d7d90e3ce33587686d7a (patch) | |
tree | 78542ca59c3f19cf3d31159f41624580a49de976 /game.adb | |
parent | 257f0241cd4a942fb9cbe08dc0fac12e6feedea9 (diff) |
Add Shrek regeneration
Diffstat (limited to 'game.adb')
-rw-r--r-- | game.adb | 21 |
1 files changed, 17 insertions, 4 deletions
@@ -27,9 +27,12 @@ procedure Game is COLOR_RED : constant Color := Get_Color(16#FF0000FF#); COLOR_PURPLE : constant Color := Get_Color(16#FF00FFFF#); - TURN_DURATION_SECS : constant Float := 0.125; - SHREK_ATTACK_COOLDOWN: constant Integer := 3; - SHREK_EXPLOSION_DAMAGE: constant Float := 0.1; + -- TODO: move this to a hotreloadable config + TURN_DURATION_SECS : constant Float := 0.125; + SHREK_ATTACK_COOLDOWN : constant Integer := 3; + SHREK_EXPLOSION_DAMAGE : constant Float := 0.2; + SHREK_TURN_REGENERATION : constant Float := 0.01; + BOMB_GENERATOR_COOLDOWN : constant Integer := 20; type IVector2 is record X, Y: Integer; @@ -375,7 +378,7 @@ procedure Game is Game.Items.Delete(C); when Bomb => if Game.Player.Bombs < Game.Player.Bomb_Slots and then Element(C).Cooldown <= 0 then Game.Player.Bombs := Game.Player.Bombs + 1; - Game.Items.Replace_Element(C, (Kind => Bomb, Cooldown => 30)); + Game.Items.Replace_Element(C, (Kind => Bomb, Cooldown => BOMB_GENERATOR_COOLDOWN)); end if; when Checkpoint => Game.Items.Delete(C); @@ -584,6 +587,7 @@ procedure Game is Game.Shrek.Position.X := Game.Player.Position.X; end if; else + -- TODO: Shrek must chase the Player null; end if; end; @@ -594,6 +598,9 @@ procedure Game is if Inside_Of_Rect(Game.Shrek.Position, Shrek_Size, Game.Player.Position) then Game.Player.Dead := True; end if; + if Game.Shrek.Health < 1.0 then + Game.Shrek.Health := Game.Shrek.Health + SHREK_TURN_REGENERATION; + end if; end if; end if; end loop; @@ -684,6 +691,7 @@ begin if DEVELOPMENT then if Is_Key_Pressed(KEY_R) then Load_Game_From_File("map.txt", Game, False); + Game_Save_Checkpoint(Game); end if; -- TODO: implement the palette editor @@ -713,3 +721,8 @@ end; -- TODO: mechanics to skip a turn -- TODO: placing a bomb is not a turn (should it be tho?) -- TODO: tutorial does not "explain" how to place bomb +-- TODO: keep steping while you are holding a certain direction +-- Cause constantly tapping it feels like ass +-- TODO: count the player's turns towards the final score of the game +-- We can even collect different stats, like bombs collected, bombs used, +-- times deid etc. |