with Events.Listeners; use Events.Listeners;
private with Allegro.Keyboard;
private with Entities;
private with Events;
package Widgets.Containers.Game_Screens.Game_Play is
type Game_Play_Screen is new Game_Screen and Event_Listener with private;
function Create_Game_Play_Screen( view : not null access Game_Views.Game_View'Class;
id : String ) return A_Game_Screen;
private
use Allegro.Keyboard;
use Entities;
use Events;
type Key_Purpose is (
MOVE_UP,
MOVE_DOWN,
MOVE_LEFT,
MOVE_RIGHT,
JUMP,
POGO,
SHOOT,
PROGRESS,
PAUSE,
MENU
);
type Key_Binding_Array is array (Key_Purpose) of Integer;
type Boolean_Key_Array is array (1..ALLEGRO_KEY_MAX) of Boolean;
type Game_Play_Screen is new Game_Screen and Event_Listener with
record
key : Key_Binding_Array;
ignoreKey : Boolean_Key_Array := Boolean_Key_Array'(others => False);
playerId : Entity_Id := INVALID_ID;
end record;
procedure Construct( this : access Game_Play_Screen;
view : not null access Game_Views.Game_View'Class;
id : String );
procedure Delete( this : in out Game_Play_Screen );
procedure Activate( this : access Game_Play_Screen );
procedure Handle_Event( this : access Game_Play_Screen;
evt : in out A_Event;
resp : out Response_Type );
pragma Precondition( evt /= null );
end Widgets.Containers.Game_Screens.Game_Play;