diff options
author | rexim <reximkut@gmail.com> | 2024-03-22 05:33:27 +0700 |
---|---|---|
committer | rexim <reximkut@gmail.com> | 2024-03-22 05:33:27 +0700 |
commit | f59cac8ed21060e2fda270639585fca7e0d5038f (patch) | |
tree | 63b701f7807ebe65eb542c42a07a9728f33df501 | |
parent | 00e48e00a17d0387ffbf4043af593423b07e6aa0 (diff) |
Prefix Item Kinds
-rw-r--r-- | game.adb | 32 |
1 files changed, 16 insertions, 16 deletions
@@ -200,11 +200,11 @@ procedure Game is return Hash_Type(V.X) * M31 + Hash_Type(V.Y); end; - type Item_Kind is (Key, Bomb_Gen, Checkpoint); + type Item_Kind is (Item_Key, Item_Bomb_Gen, Item_Checkpoint); - type Item(Kind: Item_Kind := Key) is record + type Item(Kind: Item_Kind := Item_Key) is record case Kind is - when Bomb_Gen => + when Item_Bomb_Gen => Cooldown: Integer; when others => null; end case; @@ -652,15 +652,15 @@ procedure Game is when Level_Door => Game.Map(Row, Column) := Door; when Level_Checkpoint => Game.Map(Row, Column) := Floor; - Game.Items.Insert((Column, Row), (Kind => Checkpoint)); + Game.Items.Insert((Column, Row), (Kind => Item_Checkpoint)); when Level_Bomb_Gen => Game.Map(Row, Column) := Floor; - Game.Items.Insert((Column, Row), (Kind => Bomb_Gen, Cooldown => 0)); + Game.Items.Insert((Column, Row), (Kind => Item_Bomb_Gen, Cooldown => 0)); when Level_Barricade => Game.Map(Row, Column) := Barricade; when Level_Key => Game.Map(Row, Column) := Floor; - Game.Items.Insert((Column, Row), (Kind => Key)); + Game.Items.Insert((Column, Row), (Kind => Item_Key)); when Level_Player => Game.Map(Row, Column) := Floor; if Update_Player then @@ -719,14 +719,14 @@ procedure Game is begin for C in Game.Items.Iterate loop case Element(C).Kind is - when Key => Draw_Key(Key(C)); - when Checkpoint => + when Item_Key => Draw_Key(Key(C)); + when Item_Checkpoint => declare Checkpoint_Item_Size: constant Vector2 := Cell_Size*0.5; begin Draw_Rectangle_V(To_Vector2(Key(C))*Cell_Size + Cell_Size*0.5 - Checkpoint_Item_Size*0.5, Checkpoint_Item_Size, Palette_RGB(COLOR_CHECKPOINT)); end; - when Bomb_Gen => + when Item_Bomb_Gen => if Element(C).Cooldown > 0 then Draw_Bomb(Key(C), Color_Brightness(Palette_RGB(COLOR_BOMB), -0.5)); Draw_Number(Key(C), Element(C).Cooldown, Palette_RGB(COLOR_LABEL)); @@ -786,17 +786,17 @@ procedure Game is begin if Has_Element(C) then case Element(C).Kind is - when Key => + when Item_Key => Game.Player.Keys := Game.Player.Keys + 1; Game.Items.Delete(C); - when Bomb_Gen => if + when Item_Bomb_Gen => 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_Gen, Cooldown => BOMB_GENERATOR_COOLDOWN)); + Game.Items.Replace_Element(C, (Kind => Item_Bomb_Gen, Cooldown => BOMB_GENERATOR_COOLDOWN)); end if; - when Checkpoint => + when Item_Checkpoint => Game.Items.Delete(C); Game_Save_Checkpoint(Game); end case; @@ -835,7 +835,7 @@ procedure Game is case Eeper.Kind is when Eeper_Father => null; when Eeper_Gnome => - Game.Items.Insert(Eeper.Position, (Kind => Key)); + Game.Items.Insert(Eeper.Position, (Kind => Item_Key)); Eeper.Dead := True; when Eeper_Guard => Eeper.Eyes := Eyes_Cringe; @@ -1041,9 +1041,9 @@ procedure Game is use Hashed_Map_Items; begin for C in Game.Items.Iterate loop - if Element(C).Kind = Bomb_Gen then + if Element(C).Kind = Item_Bomb_Gen then if Element(C).Cooldown > 0 then - Game.Items.Replace_Element(C, (Kind => Bomb_Gen, Cooldown => Element(C).Cooldown - 1)); + Game.Items.Replace_Element(C, (Kind => Item_Bomb_Gen, Cooldown => Element(C).Cooldown - 1)); end if; end if; end loop; |