Ver código fonte

Generation example and rescaling...

master
Ognjen Milan Robovic 3 semanas atrás
pai
commit
2908bb46c6
15 arquivos alterados com 29 adições e 14 exclusões
  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 Ver arquivo

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

+ 1
- 1
compile.sh Ver arquivo

@@ -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 Ver arquivo

@@ -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 Ver arquivo

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


BIN
example/resource/ARCHERY.png Ver arquivo

Antes Depois
Largura: 305  |  Altura: 222  |  Tamanho: 119KB Largura: 153  |  Altura: 111  |  Tamanho: 31KB

BIN
example/resource/BARRACKS.png Ver arquivo

Antes Depois
Largura: 315  |  Altura: 250  |  Tamanho: 129KB Largura: 158  |  Altura: 125  |  Tamanho: 34KB

BIN
example/resource/BLACKSMITH.png Ver arquivo

Antes Depois
Largura: 305  |  Altura: 259  |  Tamanho: 132KB Largura: 153  |  Altura: 130  |  Tamanho: 34KB

BIN
example/resource/CASTLE.png Ver arquivo

Antes Depois
Largura: 500  |  Altura: 422  |  Tamanho: 377KB Largura: 250  |  Altura: 211  |  Tamanho: 97KB

BIN
example/resource/HOUSE_1.png Ver arquivo

Antes Depois
Largura: 178  |  Altura: 141  |  Tamanho: 50KB Largura: 89  |  Altura: 71  |  Tamanho: 13KB

BIN
example/resource/HOUSE_2.png Ver arquivo

Antes Depois
Largura: 175  |  Altura: 140  |  Tamanho: 49KB Largura: 88  |  Altura: 70  |  Tamanho: 13KB

BIN
example/resource/HOUSE_3.png Ver arquivo

Antes Depois
Largura: 178  |  Altura: 137  |  Tamanho: 51KB Largura: 89  |  Altura: 69  |  Tamanho: 13KB

BIN
example/resource/STABLE.png Ver arquivo

Antes Depois
Largura: 318  |  Altura: 252  |  Tamanho: 124KB Largura: 159  |  Altura: 126  |  Tamanho: 33KB

BIN
example/resource/TREE_1.png Ver arquivo

Antes Depois
Largura: 384  |  Altura: 448  |  Tamanho: 203KB Largura: 115  |  Altura: 134  |  Tamanho: 21KB

BIN
example/resource/TREE_2.png Ver arquivo

Antes Depois
Largura: 320  |  Altura: 384  |  Tamanho: 147KB Largura: 96  |  Altura: 115  |  Tamanho: 15KB

BIN
example/resource/TREE_3.png Ver arquivo

Antes Depois
Largura: 384  |  Altura: 384  |  Tamanho: 201KB Largura: 115  |  Altura: 115  |  Tamanho: 21KB

Carregando…
Cancelar
Salvar