diff options
| author | xolatile | 2024-04-23 12:32:00 -0400 |
|---|---|---|
| committer | xolatile | 2024-04-23 12:32:00 -0400 |
| commit | 2908bb46c648283a6a3ca7e164c2f1c4cd624ecc (patch) | |
| tree | 293846ecbb3a31e3e2817125fd37aacc4ffce6d6 | |
| parent | 52a345cbac76d8888225bc62cbb572ad6ab485fd (diff) | |
| download | xolatile-raylib-ada-2908bb46c648283a6a3ca7e164c2f1c4cd624ecc.tar.xz xolatile-raylib-ada-2908bb46c648283a6a3ca7e164c2f1c4cd624ecc.tar.zst | |
Generation example and rescaling...
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | compile.sh | 2 | ||||
| -rw-r--r-- | example/generation.adb | 38 | ||||
| -rw-r--r-- | example/preview.adb | 2 | ||||
| -rw-r--r-- | example/resource/ARCHERY.png | bin | 121594 -> 31788 bytes | |||
| -rw-r--r-- | example/resource/BARRACKS.png | bin | 132339 -> 34846 bytes | |||
| -rw-r--r-- | example/resource/BLACKSMITH.png | bin | 135040 -> 34352 bytes | |||
| -rw-r--r-- | example/resource/CASTLE.png | bin | 386047 -> 98817 bytes | |||
| -rw-r--r-- | example/resource/HOUSE_1.png | bin | 51587 -> 13162 bytes | |||
| -rw-r--r-- | example/resource/HOUSE_2.png | bin | 49700 -> 13005 bytes | |||
| -rw-r--r-- | example/resource/HOUSE_3.png | bin | 51864 -> 13578 bytes | |||
| -rw-r--r-- | example/resource/STABLE.png | bin | 127327 -> 33434 bytes | |||
| -rw-r--r-- | example/resource/TREE_1.png | bin | 208363 -> 22004 bytes | |||
| -rw-r--r-- | example/resource/TREE_2.png | bin | 150500 -> 15845 bytes | |||
| -rw-r--r-- | example/resource/TREE_3.png | bin | 205444 -> 21381 bytes |
15 files changed, 29 insertions, 14 deletions
@@ -2,3 +2,4 @@ *.ali window preview +generation @@ -18,6 +18,6 @@ gnatlink generation.ali -lraylib mv window ../window mv preview ../preview -mv preview ../generation +mv generation ../generation exit 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 Binary files differindex 972a927..9c9cbbe 100644 --- a/example/resource/ARCHERY.png +++ b/example/resource/ARCHERY.png diff --git a/example/resource/BARRACKS.png b/example/resource/BARRACKS.png Binary files differindex 12ff648..a804a3c 100644 --- a/example/resource/BARRACKS.png +++ b/example/resource/BARRACKS.png diff --git a/example/resource/BLACKSMITH.png b/example/resource/BLACKSMITH.png Binary files differindex fb35fb7..cdec86d 100644 --- a/example/resource/BLACKSMITH.png +++ b/example/resource/BLACKSMITH.png diff --git a/example/resource/CASTLE.png b/example/resource/CASTLE.png Binary files differindex 2ea7cea..3c0d670 100644 --- a/example/resource/CASTLE.png +++ b/example/resource/CASTLE.png diff --git a/example/resource/HOUSE_1.png b/example/resource/HOUSE_1.png Binary files differindex 78ee6b2..4358345 100644 --- a/example/resource/HOUSE_1.png +++ b/example/resource/HOUSE_1.png diff --git a/example/resource/HOUSE_2.png b/example/resource/HOUSE_2.png Binary files differindex 51ec6f9..5832acd 100644 --- a/example/resource/HOUSE_2.png +++ b/example/resource/HOUSE_2.png diff --git a/example/resource/HOUSE_3.png b/example/resource/HOUSE_3.png Binary files differindex 2cf238b..19a51e5 100644 --- a/example/resource/HOUSE_3.png +++ b/example/resource/HOUSE_3.png diff --git a/example/resource/STABLE.png b/example/resource/STABLE.png Binary files differindex 74c1873..831bf01 100644 --- a/example/resource/STABLE.png +++ b/example/resource/STABLE.png diff --git a/example/resource/TREE_1.png b/example/resource/TREE_1.png Binary files differindex 545577f..629ac1c 100644 --- a/example/resource/TREE_1.png +++ b/example/resource/TREE_1.png diff --git a/example/resource/TREE_2.png b/example/resource/TREE_2.png Binary files differindex b42099c..29d2adb 100644 --- a/example/resource/TREE_2.png +++ b/example/resource/TREE_2.png diff --git a/example/resource/TREE_3.png b/example/resource/TREE_3.png Binary files differindex 41206a5..a431144 100644 --- a/example/resource/TREE_3.png +++ b/example/resource/TREE_3.png |
