Procházet zdrojové kódy

Generation example and rescaling...

master
Ognjen Milan Robovic před 3 týdny
rodič
revize
2908bb46c6
15 změnil soubory, kde provedl 29 přidání a 14 odebrání
  1. +1
    -0
      .gitignore
  2. +1
    -1
      compile.sh
  3. +26
    -12
      example/generation.adb
  4. +1
    -1
      example/preview.adb
  5. binární
      example/resource/ARCHERY.png
  6. binární
      example/resource/BARRACKS.png
  7. binární
      example/resource/BLACKSMITH.png
  8. binární
      example/resource/CASTLE.png
  9. binární
      example/resource/HOUSE_1.png
  10. binární
      example/resource/HOUSE_2.png
  11. binární
      example/resource/HOUSE_3.png
  12. binární
      example/resource/STABLE.png
  13. binární
      example/resource/TREE_1.png
  14. binární
      example/resource/TREE_2.png
  15. binární
      example/resource/TREE_3.png

+ 1
- 0
.gitignore Zobrazit soubor

@@ -2,3 +2,4 @@
*.ali
window
preview
generation

+ 1
- 1
compile.sh Zobrazit soubor

@@ -18,6 +18,6 @@ gnatlink generation.ali -lraylib

mv window ../window
mv preview ../preview
mv preview ../generation
mv generation ../generation

exit

+ 26
- 12
example/generation.adb Zobrazit soubor

@@ -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;

+ 1
- 1
example/preview.adb Zobrazit soubor

@@ -15,7 +15,7 @@ begin
Begin_Drawing;
Draw_Texture (Map);
End_Drawing;
end loop Main_Loop;
end loop;
--
Unload_Texture (Map);
--


binární
example/resource/ARCHERY.png Zobrazit soubor

Před Za
Šířka: 305  |  Výška: 222  |  Velikost: 119KB Šířka: 153  |  Výška: 111  |  Velikost: 31KB

binární
example/resource/BARRACKS.png Zobrazit soubor

Před Za
Šířka: 315  |  Výška: 250  |  Velikost: 129KB Šířka: 158  |  Výška: 125  |  Velikost: 34KB

binární
example/resource/BLACKSMITH.png Zobrazit soubor

Před Za
Šířka: 305  |  Výška: 259  |  Velikost: 132KB Šířka: 153  |  Výška: 130  |  Velikost: 34KB

binární
example/resource/CASTLE.png Zobrazit soubor

Před Za
Šířka: 500  |  Výška: 422  |  Velikost: 377KB Šířka: 250  |  Výška: 211  |  Velikost: 97KB

binární
example/resource/HOUSE_1.png Zobrazit soubor

Před Za
Šířka: 178  |  Výška: 141  |  Velikost: 50KB Šířka: 89  |  Výška: 71  |  Velikost: 13KB

binární
example/resource/HOUSE_2.png Zobrazit soubor

Před Za
Šířka: 175  |  Výška: 140  |  Velikost: 49KB Šířka: 88  |  Výška: 70  |  Velikost: 13KB

binární
example/resource/HOUSE_3.png Zobrazit soubor

Před Za
Šířka: 178  |  Výška: 137  |  Velikost: 51KB Šířka: 89  |  Výška: 69  |  Velikost: 13KB

binární
example/resource/STABLE.png Zobrazit soubor

Před Za
Šířka: 318  |  Výška: 252  |  Velikost: 124KB Šířka: 159  |  Výška: 126  |  Velikost: 33KB

binární
example/resource/TREE_1.png Zobrazit soubor

Před Za
Šířka: 384  |  Výška: 448  |  Velikost: 203KB Šířka: 115  |  Výška: 134  |  Velikost: 21KB

binární
example/resource/TREE_2.png Zobrazit soubor

Před Za
Šířka: 320  |  Výška: 384  |  Velikost: 147KB Šířka: 96  |  Výška: 115  |  Velikost: 15KB

binární
example/resource/TREE_3.png Zobrazit soubor

Před Za
Šířka: 384  |  Výška: 384  |  Velikost: 201KB Šířka: 115  |  Výška: 115  |  Velikost: 21KB

Načítá se…
Zrušit
Uložit