summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrexim <reximkut@gmail.com>2024-03-18 03:57:11 +0700
committerrexim <reximkut@gmail.com>2024-03-18 03:57:18 +0700
commit8e2b10fd41cb877f70c5fb0f1f0c7d60a3e78b26 (patch)
tree2f327f796ba3f6f48b91b42ba0bb55c860a4221d
parent3f4cc25e365d5702b28778f208483f9afd3f7f97 (diff)
Make Urmom even Bigger
-rw-r--r--game.adb33
-rw-r--r--map.txt52
2 files changed, 41 insertions, 44 deletions
diff --git a/game.adb b/game.adb
index b933980..6fc8dde 100644
--- a/game.adb
+++ b/game.adb
@@ -22,7 +22,6 @@ procedure Game is
Gen: Generator;
DEVELOPMENT : constant Boolean := True;
- Not_Implemented: exception;
type Palette is (
COLOR_BACKGROUND,
@@ -247,10 +246,10 @@ procedure Game is
Dead: Boolean := False;
end record;
- type Boss_Behavior is (Shrek, Urmom, Gnome);
+ type Boss_Kind is (Shrek, Urmom, Gnome);
type Boss_State is record
- Behavior: Boss_Behavior;
+ Kind: Boss_Kind;
Dead: Boolean := True;
Prev_Position: IVector2;
Position: IVector2;
@@ -453,7 +452,7 @@ procedure Game is
begin
for Boss of Game.Bosses loop
if Boss.Dead then
- Boss.Behavior := Gnome;
+ Boss.Kind := Gnome;
Boss.Dead := False;
Boss.Background := COLOR_GNOME;
Boss.Position := Position;
@@ -468,13 +467,13 @@ procedure Game is
begin
for Boss of Game.Bosses loop
if Boss.Dead then
- Boss.Behavior := Urmom;
+ Boss.Kind := Urmom;
Boss.Dead := False;
Boss.Background := COLOR_URMOM;
Boss.Position := Position;
Boss.Prev_Position := Position;
Boss.Health := 1.0;
- Boss.Size := (6, 6);
+ Boss.Size := (7, 7);
exit;
end if;
end loop;
@@ -484,7 +483,7 @@ procedure Game is
begin
for Boss of Game.Bosses loop
if Boss.Dead then
- Boss.Behavior := Shrek;
+ Boss.Kind := Shrek;
Boss.Background := COLOR_SHREK;
Boss.Dead := False;
Boss.Position := Position;
@@ -738,7 +737,7 @@ procedure Game is
for Boss of Game.Bosses loop
if not Boss.Dead and then Inside_Of_Rect(Boss.Position, Boss.Size, New_Position) then
- case Boss.Behavior is
+ case Boss.Kind is
when Gnome =>
Game.Items.Insert(Boss.Position, (Kind => Key));
Boss.Dead := True;
@@ -753,9 +752,9 @@ procedure Game is
begin
Boss.Dead := True;
Spawn_Shrek(Game, Position + (0, 0));
- Spawn_Shrek(Game, Position + (3, 0));
- Spawn_Shrek(Game, Position + (0, 3));
- Spawn_Shrek(Game, Position + (3, 3));
+ Spawn_Shrek(Game, Position + (4, 0));
+ Spawn_Shrek(Game, Position + (0, 4));
+ Spawn_Shrek(Game, Position + (4, 4));
end;
end case;
return;
@@ -850,7 +849,7 @@ procedure Game is
for Me in Boss_Index loop
if not Game.Bosses(Me).Dead then
Game.Bosses(Me).Prev_Position := Game.Bosses(Me).Position;
- case Game.Bosses(Me).Behavior is
+ case Game.Bosses(Me).Kind is
when Shrek | Urmom =>
Recompute_Path_For_Boss(Game, Me, SHREK_STEPS_LIMIT, SHREK_STEP_LENGTH_LIMIT);
-- TODO: Boss should attack on zero just like a bomb.
@@ -890,7 +889,7 @@ procedure Game is
when Gnome =>
Recompute_Path_For_Boss(Game, Me, 10, 1, Stop_At_Me => False);
declare
- Position: IVector2 := Game.Bosses(Me).Position;
+ Position: constant IVector2 := Game.Bosses(Me).Position;
begin
if Game.Bosses(Me).Path(Position.Y, Position.X) >= 0 then
declare
@@ -1055,7 +1054,7 @@ procedure Game is
Size: constant Vector2 := To_Vector2(Boss.Size)*Cell_Size;
begin
if not Boss.Dead then
- case Boss.Behavior is
+ case Boss.Kind is
when Gnome =>
declare
GNOME_SIZE: constant C_Float := 0.7;
@@ -1179,11 +1178,7 @@ begin
if Is_Key_Down(KEY_P) then
for Row in Game.Map'Range(1) loop
for Column in Game.Map'Range(2) loop
- declare
- Position: constant Vector2 := To_Vector2((Column, Row))*Cell_Size;
- begin
- Draw_Number((Column, Row), Game.Bosses(1).Path(Row, Column), (A => 255, others => 0));
- end;
+ Draw_Number((Column, Row), Game.Bosses(1).Path(Row, Column), (A => 255, others => 0));
end loop;
end loop;
end if;
diff --git a/map.txt b/map.txt
index 892e9b6..0c5d474 100644
--- a/map.txt
+++ b/map.txt
@@ -21,7 +21,7 @@
#.# #...................#
#.# #...................#
#.# #####################
- #####.##### #.@.#
+ #####.##### #...#
#.........# #...#
#.........# #...#
#.........# #...#
@@ -40,27 +40,29 @@
#...#
#...#
#...#
- ######################## #...#
- ###===##........##===### #...#
- ###=.=##........##=.=### #...#
- #===.===........===.===# #...#
- #=..*..=........=..*..=# #...#
- #===.===........===.===# #...#
- ###=.=##........##=.=### #...# #################
- ###===##........##===### #...# #......G........#
-#################################......................# #...# #...............#
-.........................................M.............# #...# #...............#
-.......................................................##############################...####################...............#
-......................................................................................................................G....#
-......................................................................................!....................................#
-.......................................................#####################################################...............#
-.......................................................# #...............#
-#################################......................# #...............#
- ###===##........##===### #..G............#
- ###=.=##........##=.=### #################
- #===.===........===.===#
- #=..*..=........=..*..=#
- #===.===........===.===#
- ###=.=##........##=.=###
- ###===##........##===###
- ########################
+ #...#
+ ######################### #...#
+ ###===##.........##===### #...#
+ ###=.=##.........##=.=### #...#
+ #===.===.........===.===# #...#
+ #=..*..=.........=..*..=# #...#
+ #===.===.........===.===# #...# #################
+ ###=.=##.........##=.=### #...# #......G........#
+ ###===##.........##===### #...# #...............#
+#################################.......................# #...# #.#.............#
+.........................................M..............# #...# #.#.............#
+........................................................#############################...######################.............#
+.....................................................................................................................G.....#
+.........................................................@............................!....................................#
+...........................................................................................................................#
+........................................................#####################################################..............#
+........................................................# ##.####...........#
+#################################.......................# ##.#.............#
+ ###===##.........##===### ##..G.............#
+ ###=.=##.........##=.=### ###################
+ #===.===.........===.===#
+ #=..*..=.........=..*..=#
+ #===.===.........===.===#
+ ###=.=##.........##=.=###
+ ###===##.........##===###
+ #########################