Added hardcoded action list...

This commit is contained in:
Ognjen Milan Robovic 2024-03-16 06:52:32 -04:00
parent 19d2eec6c5
commit 25f5216e2b
2 changed files with 20 additions and 9 deletions

View File

@ -35,7 +35,7 @@ package core is
subtype short_string is string (1 .. 24);
subtype long_string is string (1 .. 72);
--~type accessor is procedure access;
type accessor is access procedure;
type sprite is
record

View File

@ -39,10 +39,19 @@ procedure main is
--~end if;
--~end bind;
--~procedure move_camera_up is begin core.camera.y := core.camera.y - 1; end move_camera_up;
--~procedure move_camera_down is begin core.camera.y := core.camera.y + 1; end move_camera_down;
--~procedure move_camera_left is begin core.camera.x := core.camera.x - 1; end move_camera_left;
--~procedure move_camera_right is begin core.camera.x := core.camera.x + 1; end move_camera_right;
procedure idle is begin null; end idle;
procedure move_camera_up is begin core.camera.y := core.camera.y - 1; end move_camera_up;
procedure move_camera_down is begin core.camera.y := core.camera.y + 1; end move_camera_down;
procedure move_camera_left is begin core.camera.x := core.camera.x - 1; end move_camera_left;
procedure move_camera_right is begin core.camera.x := core.camera.x + 1; end move_camera_right;
action_list : constant array (core.signal_code) of access procedure := (
core.signal_up => move_camera_up'access,
core.signal_down => move_camera_down'access,
core.signal_left => move_camera_left'access,
core.signal_right => move_camera_right'access,
others => idle'access
);
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@ -95,10 +104,10 @@ begin
--~if core.signal_mode = core.signal_code'pos (core.signal_w) then preview_height := preview_height - 60; end if;
--~if core.signal_mode = core.signal_code'pos (core.signal_s) then preview_height := preview_height + 60; end if;
--
if core.signal_mode = core.signal_code'pos (core.signal_left) then core.camera.x := core.camera.x - 1; end if;
if core.signal_mode = core.signal_code'pos (core.signal_right) then core.camera.x := core.camera.x + 1; end if;
if core.signal_mode = core.signal_code'pos (core.signal_up) then core.camera.y := core.camera.y - 1; end if;
if core.signal_mode = core.signal_code'pos (core.signal_down) then core.camera.y := core.camera.y + 1; end if;
--~if core.signal_mode = core.signal_code'pos (core.signal_left) then core.camera.x := core.camera.x - 1; end if;
--~if core.signal_mode = core.signal_code'pos (core.signal_right) then core.camera.x := core.camera.x + 1; end if;
--~if core.signal_mode = core.signal_code'pos (core.signal_up) then core.camera.y := core.camera.y - 1; end if;
--~if core.signal_mode = core.signal_code'pos (core.signal_down) then core.camera.y := core.camera.y + 1; end if;
--
if core.cursor_mode = 3 then ui.active := ui.default; else ui.active := ui.steam; end if;
--
@ -148,6 +157,8 @@ begin
--~magic.menu (0, 0, true);
--~might.menu (0, 0, true);
--
action_list (core.signal_code'val (core.signal_mode)).all;
--
ui.draw_text_box (0, core.window_height - 32, core.window_width, 32);
end loop gameplay;