Kaynağa Gözat

New attribute icons and minor source changes...

master
Ognjen Milan Robovic 1 hafta önce
ebeveyn
işleme
5bc6a1c81d
9 değiştirilmiş dosya ile 20 ekleme ve 21 silme
  1. +8
    -9
      source/main.adb
  2. +11
    -11
      source/ui.adb
  3. +1
    -1
      source/world.adb
  4. BIN
      sprite/attribute/defense.png
  5. BIN
      sprite/attribute/offense.png
  6. BIN
      sprite/attribute/reach.png
  7. BIN
      sprite/attribute/speed.png
  8. BIN
      sprite/attribute/stamina.png
  9. BIN
      sprite/attribute/wisdom.png

+ 8
- 9
source/main.adb Dosyayı Görüntüle

@@ -23,10 +23,8 @@ procedure main is
map_preview_panel, status_preview_panel, text_box_panel
);

view_icon : array (view) of core.sprite;

view_list : array (view) of boolean := (others => true);

view_icon : array (view) of core.sprite := (others => (others => 0));
view_list : array (view) of boolean := (others => true);
view_text : array (view) of core.long_string := (
"Toggle map preview panel. ",
"Toggle status preview panel. ",
@@ -48,6 +46,7 @@ procedure main is
procedure move_camera_up is
begin
core.move_camera_up;
core.camera.y := core.clip (core.camera.y, 0, world.map.height - 1);
if world.map.clips (core.camera.x, core.camera.y) then
core.increment (core.camera.y);
end if;
@@ -56,6 +55,7 @@ procedure main is
procedure move_camera_down is
begin
core.move_camera_down;
core.camera.y := core.clip (core.camera.y, 0, world.map.height - 1);
if world.map.clips (core.camera.x, core.camera.y) then
core.decrement (core.camera.y);
end if;
@@ -64,6 +64,7 @@ procedure main is
procedure move_camera_left is
begin
core.move_camera_left;
core.camera.x := core.clip (core.camera.x, 0, world.map.width - 1);
if world.map.clips (core.camera.x, core.camera.y) then
core.increment (core.camera.x);
end if;
@@ -72,6 +73,7 @@ procedure main is
procedure move_camera_right is
begin
core.move_camera_right;
core.camera.x := core.clip (core.camera.x, 0, world.map.width - 1);
if world.map.clips (core.camera.x, core.camera.y) then
core.decrement (core.camera.x);
end if;
@@ -125,7 +127,7 @@ begin
world.configure;
ai.configure;

world.make (world.grass, 140, 120);
world.make (world.swamp, 120, 60);

core.dash;
core.echo (core.success, "Successfully initialized game data, entering main gameplay loop.");
@@ -137,7 +139,7 @@ begin

ui.active := ui.imp;

core.camera := (55, 50);
core.camera := (1, 1);

------------------------------------------------------------------------------------------

@@ -156,9 +158,6 @@ begin
preview_height := core.window_height - text_box_height;
text_box_height := 32;
--
core.camera.x := core.clip (core.camera.x, 0, world.map.width - 1);
core.camera.y := core.clip (core.camera.y, 0, world.map.height - 1);
--
world.draw;
--
if view_list (map_preview_panel) then


+ 11
- 11
source/ui.adb Dosyayı Görüntüle

@@ -153,14 +153,14 @@ package body ui is
------------------------------------------------------------------------------------------

procedure draw_structure (data : in structure) is
offset : constant integer := core.icon;
offset : constant integer := core.icon / 4;
new_width : constant integer := (if data.resize then 320 else data.width);
new_height : constant integer := (if data.resize then data.gui_n * (3 * core.icon / 2) + 2 * offset else data.height);
new_height : constant integer := (if data.resize then data.gui_n * (core.icon + 2 * offset) + 2 * core.icon else data.height);
new_x : constant integer := (if data.center then (core.window_width - new_width) / 2 else data.x);
new_y : constant integer := (if data.center then (core.window_height - new_height) / 2 else data.y);
--
at_x : integer := new_x + offset;
at_y : integer := new_y + offset;
at_x : integer := new_x + core.icon;
at_y : integer := new_y + core.icon;
begin
draw_tiny_menu (new_x, new_y, new_width, new_height);
draw_title_bar (new_x, new_y, new_width, data.title);
@@ -168,13 +168,13 @@ package body ui is
for x in 0 .. data.gui_n - 1 loop
case data.gui_list (x).kind is
when gui_button =>
draw_frame (data.gui_list (x).info, at_x, at_y, new_width - 2 * offset, 3 * core.icon / 2);
draw_icon (data.gui_list (x).image, data.gui_list (x).info, at_x + core.icon / 4, at_y + core.icon / 4);
write (data.gui_list (x).text, at_x + 5 * core.icon / 4, at_y + 2 + core.icon / 4);
if cursor_inside (at_x, at_y, new_width - 2 * offset - core.icon - 2, 3 * core.icon / 2) then
draw (cursor, at_x + new_width - 96, at_y);
end if;
at_y := at_y + 3 * core.icon / 2;
draw_frame (data.gui_list (x).info, at_x, at_y, new_width - 2 * core.icon, core.icon + 2 * offset);
draw_icon (data.gui_list (x).image, data.gui_list (x).info, at_x + offset, at_y + offset);
write (data.gui_list (x).text, at_x + core.icon + offset, at_y + offset + 2);
--~if cursor_inside (at_x, at_y, new_width - 2 * offset - core.icon - 2, 3 * core.icon / 2) then
--~draw (cursor, at_x + new_width - 96, at_y);
--~end if;
at_y := at_y + core.icon + 2 * offset;
when others => null;
end case;
end loop;


+ 1
- 1
source/world.adb Dosyayı Görüntüle

@@ -172,7 +172,7 @@ package body world is
begin
for x in 0 .. view_reach loop
for y in 0 .. view_reach loop
map.views (x + core.camera.x - view_reach / 2, y + core.camera.y - view_reach / 2) := true;
map.views ((x + core.camera.x - view_reach / 2) mod map.width, (y + core.camera.y - view_reach / 2) mod map.height) := true;
end loop;
end loop;
end view;


BIN
sprite/attribute/defense.png Dosyayı Görüntüle

Önce Sonra
Genişlik: 32  |  Yükseklik: 32  |  Boyut: 557B Genişlik: 32  |  Yükseklik: 32  |  Boyut: 256B

BIN
sprite/attribute/offense.png Dosyayı Görüntüle

Önce Sonra
Genişlik: 32  |  Yükseklik: 32  |  Boyut: 510B Genişlik: 32  |  Yükseklik: 32  |  Boyut: 409B

BIN
sprite/attribute/reach.png Dosyayı Görüntüle

Önce Sonra
Genişlik: 32  |  Yükseklik: 32  |  Boyut: 505B Genişlik: 32  |  Yükseklik: 32  |  Boyut: 373B

BIN
sprite/attribute/speed.png Dosyayı Görüntüle

Önce Sonra
Genişlik: 32  |  Yükseklik: 32  |  Boyut: 675B Genişlik: 32  |  Yükseklik: 32  |  Boyut: 414B

BIN
sprite/attribute/stamina.png Dosyayı Görüntüle

Önce Sonra
Genişlik: 32  |  Yükseklik: 32  |  Boyut: 595B Genişlik: 32  |  Yükseklik: 32  |  Boyut: 420B

BIN
sprite/attribute/wisdom.png Dosyayı Görüntüle

Önce Sonra
Genişlik: 32  |  Yükseklik: 32  |  Boyut: 641B Genişlik: 32  |  Yükseklik: 32  |  Boyut: 392B

Yükleniyor…
İptal
Kaydet