Parcourir la source

Generation example and rescaling...

master
Ognjen Milan Robovic il y a 3 semaines
Parent
révision
2908bb46c6
15 fichiers modifiés avec 29 ajouts et 14 suppressions
  1. +1
    -0
      .gitignore
  2. +1
    -1
      compile.sh
  3. +26
    -12
      example/generation.adb
  4. +1
    -1
      example/preview.adb
  5. BIN
      example/resource/ARCHERY.png
  6. BIN
      example/resource/BARRACKS.png
  7. BIN
      example/resource/BLACKSMITH.png
  8. BIN
      example/resource/CASTLE.png
  9. BIN
      example/resource/HOUSE_1.png
  10. BIN
      example/resource/HOUSE_2.png
  11. BIN
      example/resource/HOUSE_3.png
  12. BIN
      example/resource/STABLE.png
  13. BIN
      example/resource/TREE_1.png
  14. BIN
      example/resource/TREE_2.png
  15. BIN
      example/resource/TREE_3.png

+ 1
- 0
.gitignore Voir le fichier

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

+ 1
- 1
compile.sh Voir le fichier

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


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


exit exit

+ 26
- 12
example/generation.adb Voir le fichier

@@ -1,7 +1,7 @@
with Raylib; with Raylib;
use Raylib; use Raylib;


procedure Preview is
procedure Generation is


type Texture_Index is ( type Texture_Index is (
Archery, Archery,
@@ -23,29 +23,43 @@ procedure Preview is
begin begin
Open_Window (1280, 720, "Pandemos Empire" & ASCII.NUL); 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_Array (I) := Load_Texture ("./example/resource/"
& Texture_Index'Image (I) & Texture_Index'Image (I)
& ".png" & ".png"
& ASCII.NUL); & ASCII.NUL);
end loop; end loop;
-- --
until Window_Should_Close
loop
loop exit when Window_Should_Close;
Begin_Drawing; 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), 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_Drawing;
end loop; end loop;
-- --
for I in Texture_Index
loop
for I in Texture_Index loop
Unload_Texture (Texture_Array (I)); Unload_Texture (Texture_Array (I));
end loop; end loop;
-- --
Close_Window; Close_Window;
end Preview;
end Generation;

+ 1
- 1
example/preview.adb Voir le fichier

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


BIN
example/resource/ARCHERY.png Voir le fichier

Avant Après
Largeur: 305  |  Hauteur: 222  |  Taille: 119KB Largeur: 153  |  Hauteur: 111  |  Taille: 31KB

BIN
example/resource/BARRACKS.png Voir le fichier

Avant Après
Largeur: 315  |  Hauteur: 250  |  Taille: 129KB Largeur: 158  |  Hauteur: 125  |  Taille: 34KB

BIN
example/resource/BLACKSMITH.png Voir le fichier

Avant Après
Largeur: 305  |  Hauteur: 259  |  Taille: 132KB Largeur: 153  |  Hauteur: 130  |  Taille: 34KB

BIN
example/resource/CASTLE.png Voir le fichier

Avant Après
Largeur: 500  |  Hauteur: 422  |  Taille: 377KB Largeur: 250  |  Hauteur: 211  |  Taille: 97KB

BIN
example/resource/HOUSE_1.png Voir le fichier

Avant Après
Largeur: 178  |  Hauteur: 141  |  Taille: 50KB Largeur: 89  |  Hauteur: 71  |  Taille: 13KB

BIN
example/resource/HOUSE_2.png Voir le fichier

Avant Après
Largeur: 175  |  Hauteur: 140  |  Taille: 49KB Largeur: 88  |  Hauteur: 70  |  Taille: 13KB

BIN
example/resource/HOUSE_3.png Voir le fichier

Avant Après
Largeur: 178  |  Hauteur: 137  |  Taille: 51KB Largeur: 89  |  Hauteur: 69  |  Taille: 13KB

BIN
example/resource/STABLE.png Voir le fichier

Avant Après
Largeur: 318  |  Hauteur: 252  |  Taille: 124KB Largeur: 159  |  Hauteur: 126  |  Taille: 33KB

BIN
example/resource/TREE_1.png Voir le fichier

Avant Après
Largeur: 384  |  Hauteur: 448  |  Taille: 203KB Largeur: 115  |  Hauteur: 134  |  Taille: 21KB

BIN
example/resource/TREE_2.png Voir le fichier

Avant Après
Largeur: 320  |  Hauteur: 384  |  Taille: 147KB Largeur: 96  |  Hauteur: 115  |  Taille: 15KB

BIN
example/resource/TREE_3.png Voir le fichier

Avant Après
Largeur: 384  |  Hauteur: 384  |  Taille: 201KB Largeur: 115  |  Hauteur: 115  |  Taille: 21KB

Chargement…
Annuler
Enregistrer