From 2908bb46c648283a6a3ca7e164c2f1c4cd624ecc Mon Sep 17 00:00:00 2001 From: xolatile Date: Tue, 23 Apr 2024 12:32:00 -0400 Subject: Generation example and rescaling... --- example/generation.adb | 38 ++++++++++++++++++++++++++------------ example/preview.adb | 2 +- example/resource/ARCHERY.png | Bin 121594 -> 31788 bytes example/resource/BARRACKS.png | Bin 132339 -> 34846 bytes example/resource/BLACKSMITH.png | Bin 135040 -> 34352 bytes example/resource/CASTLE.png | Bin 386047 -> 98817 bytes example/resource/HOUSE_1.png | Bin 51587 -> 13162 bytes example/resource/HOUSE_2.png | Bin 49700 -> 13005 bytes example/resource/HOUSE_3.png | Bin 51864 -> 13578 bytes example/resource/STABLE.png | Bin 127327 -> 33434 bytes example/resource/TREE_1.png | Bin 208363 -> 22004 bytes example/resource/TREE_2.png | Bin 150500 -> 15845 bytes example/resource/TREE_3.png | Bin 205444 -> 21381 bytes 13 files changed, 27 insertions(+), 13 deletions(-) (limited to 'example') 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 Binary files a/example/resource/ARCHERY.png and b/example/resource/ARCHERY.png differ diff --git a/example/resource/BARRACKS.png b/example/resource/BARRACKS.png index 12ff648..a804a3c 100644 Binary files a/example/resource/BARRACKS.png and b/example/resource/BARRACKS.png differ diff --git a/example/resource/BLACKSMITH.png b/example/resource/BLACKSMITH.png index fb35fb7..cdec86d 100644 Binary files a/example/resource/BLACKSMITH.png and b/example/resource/BLACKSMITH.png differ diff --git a/example/resource/CASTLE.png b/example/resource/CASTLE.png index 2ea7cea..3c0d670 100644 Binary files a/example/resource/CASTLE.png and b/example/resource/CASTLE.png differ diff --git a/example/resource/HOUSE_1.png b/example/resource/HOUSE_1.png index 78ee6b2..4358345 100644 Binary files a/example/resource/HOUSE_1.png and b/example/resource/HOUSE_1.png differ diff --git a/example/resource/HOUSE_2.png b/example/resource/HOUSE_2.png index 51ec6f9..5832acd 100644 Binary files a/example/resource/HOUSE_2.png and b/example/resource/HOUSE_2.png differ diff --git a/example/resource/HOUSE_3.png b/example/resource/HOUSE_3.png index 2cf238b..19a51e5 100644 Binary files a/example/resource/HOUSE_3.png and b/example/resource/HOUSE_3.png differ diff --git a/example/resource/STABLE.png b/example/resource/STABLE.png index 74c1873..831bf01 100644 Binary files a/example/resource/STABLE.png and b/example/resource/STABLE.png differ diff --git a/example/resource/TREE_1.png b/example/resource/TREE_1.png index 545577f..629ac1c 100644 Binary files a/example/resource/TREE_1.png and b/example/resource/TREE_1.png differ diff --git a/example/resource/TREE_2.png b/example/resource/TREE_2.png index b42099c..29d2adb 100644 Binary files a/example/resource/TREE_2.png and b/example/resource/TREE_2.png differ diff --git a/example/resource/TREE_3.png b/example/resource/TREE_3.png index 41206a5..a431144 100644 Binary files a/example/resource/TREE_3.png and b/example/resource/TREE_3.png differ -- cgit v1.2.3