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 /example/generation.adb | |
| parent | 52a345cbac76d8888225bc62cbb572ad6ab485fd (diff) | |
| download | xolatile-raylib-ada-2908bb46c648283a6a3ca7e164c2f1c4cd624ecc.tar.xz xolatile-raylib-ada-2908bb46c648283a6a3ca7e164c2f1c4cd624ecc.tar.zst | |
Generation example and rescaling...
Diffstat (limited to 'example/generation.adb')
| -rw-r--r-- | example/generation.adb | 38 |
1 files changed, 26 insertions, 12 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; |
