aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
Diffstat (limited to 'example')
-rw-r--r--example/generation.adb38
-rw-r--r--example/preview.adb2
-rw-r--r--example/resource/ARCHERY.pngbin121594 -> 31788 bytes
-rw-r--r--example/resource/BARRACKS.pngbin132339 -> 34846 bytes
-rw-r--r--example/resource/BLACKSMITH.pngbin135040 -> 34352 bytes
-rw-r--r--example/resource/CASTLE.pngbin386047 -> 98817 bytes
-rw-r--r--example/resource/HOUSE_1.pngbin51587 -> 13162 bytes
-rw-r--r--example/resource/HOUSE_2.pngbin49700 -> 13005 bytes
-rw-r--r--example/resource/HOUSE_3.pngbin51864 -> 13578 bytes
-rw-r--r--example/resource/STABLE.pngbin127327 -> 33434 bytes
-rw-r--r--example/resource/TREE_1.pngbin208363 -> 22004 bytes
-rw-r--r--example/resource/TREE_2.pngbin150500 -> 15845 bytes
-rw-r--r--example/resource/TREE_3.pngbin205444 -> 21381 bytes
13 files changed, 27 insertions, 13 deletions
diff --git a/example/generation.adb b/example/generation.adb
index a3ed893..0c36181 100644
--- a/example/generation.adb
+++ b/example/generation.adb
@@ -1,7 +1,7 @@
with Raylib;
use Raylib;
-procedure Preview is
+procedure Generation is
type Texture_Index is (
Archery,
@@ -23,29 +23,43 @@ procedure Preview is
begin
Open_Window (1280, 720, "Pandemos Empire" & ASCII.NUL);
--
- for I in Texture_Index
- loop
+ Set_Exit_Key (Key_Q);
+ Set_Target_FPS (1);
+ --
+ for I in Texture_Index loop
Texture_Array (I) := Load_Texture ("./example/resource/"
& Texture_Index'Image (I)
& ".png"
& ASCII.NUL);
end loop;
--
- until Window_Should_Close
- loop
+ loop exit when Window_Should_Close;
Begin_Drawing;
- for Y in 0 .. Get_Screen_Height / Terrain.Height - 2
- for X in 0 .. Get_Screen_Width / Terrain.Width - 2
+ --
+ for Y in 0 .. Get_Screen_Height / Texture_Array (Terrain).Height loop
+ for X in 0 .. Get_Screen_Width / Texture_Array (Terrain).Width loop
Draw_Texture (Data => Texture_Array (Terrain),
- X => X * Terrain.Width,
- Y => Y * Terrain.Height);
+ X => X * Texture_Array (Terrain).Width,
+ Y => Y * Texture_Array (Terrain).Height);
+ end loop;
+ end loop;
+ --
+ for Building in Archery .. Stable loop
+ Draw_Texture (Data => Texture_Array (Building),
+ X => Get_Random_Value(0, Get_Screen_Width),
+ Y => Get_Random_Value(0, Get_Screen_Height));
+ end loop;
+ --
+ Draw_Texture (Texture_Array (Tree_1));
+ Draw_Texture (Texture_Array (Tree_2), 640, 360);
+ Draw_Texture (Texture_Array (Tree_3), 960, 360);
+ --
End_Drawing;
end loop;
--
- for I in Texture_Index
- loop
+ for I in Texture_Index loop
Unload_Texture (Texture_Array (I));
end loop;
--
Close_Window;
-end Preview;
+end Generation;
diff --git a/example/preview.adb b/example/preview.adb
index 0713ad0..c02e75c 100644
--- a/example/preview.adb
+++ b/example/preview.adb
@@ -15,7 +15,7 @@ begin
Begin_Drawing;
Draw_Texture (Map);
End_Drawing;
- end loop Main_Loop;
+ end loop;
--
Unload_Texture (Map);
--
diff --git a/example/resource/ARCHERY.png b/example/resource/ARCHERY.png
index 972a927..9c9cbbe 100644
--- a/example/resource/ARCHERY.png
+++ b/example/resource/ARCHERY.png
Binary files differ
diff --git a/example/resource/BARRACKS.png b/example/resource/BARRACKS.png
index 12ff648..a804a3c 100644
--- a/example/resource/BARRACKS.png
+++ b/example/resource/BARRACKS.png
Binary files differ
diff --git a/example/resource/BLACKSMITH.png b/example/resource/BLACKSMITH.png
index fb35fb7..cdec86d 100644
--- a/example/resource/BLACKSMITH.png
+++ b/example/resource/BLACKSMITH.png
Binary files differ
diff --git a/example/resource/CASTLE.png b/example/resource/CASTLE.png
index 2ea7cea..3c0d670 100644
--- a/example/resource/CASTLE.png
+++ b/example/resource/CASTLE.png
Binary files differ
diff --git a/example/resource/HOUSE_1.png b/example/resource/HOUSE_1.png
index 78ee6b2..4358345 100644
--- a/example/resource/HOUSE_1.png
+++ b/example/resource/HOUSE_1.png
Binary files differ
diff --git a/example/resource/HOUSE_2.png b/example/resource/HOUSE_2.png
index 51ec6f9..5832acd 100644
--- a/example/resource/HOUSE_2.png
+++ b/example/resource/HOUSE_2.png
Binary files differ
diff --git a/example/resource/HOUSE_3.png b/example/resource/HOUSE_3.png
index 2cf238b..19a51e5 100644
--- a/example/resource/HOUSE_3.png
+++ b/example/resource/HOUSE_3.png
Binary files differ
diff --git a/example/resource/STABLE.png b/example/resource/STABLE.png
index 74c1873..831bf01 100644
--- a/example/resource/STABLE.png
+++ b/example/resource/STABLE.png
Binary files differ
diff --git a/example/resource/TREE_1.png b/example/resource/TREE_1.png
index 545577f..629ac1c 100644
--- a/example/resource/TREE_1.png
+++ b/example/resource/TREE_1.png
Binary files differ
diff --git a/example/resource/TREE_2.png b/example/resource/TREE_2.png
index b42099c..29d2adb 100644
--- a/example/resource/TREE_2.png
+++ b/example/resource/TREE_2.png
Binary files differ
diff --git a/example/resource/TREE_3.png b/example/resource/TREE_3.png
index 41206a5..a431144 100644
--- a/example/resource/TREE_3.png
+++ b/example/resource/TREE_3.png
Binary files differ