diff --git a/.gitignore b/.gitignore index 0da3e99..658fd5e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ *.ali window preview +generation diff --git a/compile.sh b/compile.sh index e130bef..30f58b7 100644 --- a/compile.sh +++ b/compile.sh @@ -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 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