Index

Package: Game

Description

package Events.Game is

Classes

End_Game_Event

type End_Game_Event is new Event with private;

Ancestors:

Primitive operations:

Events.Construct (Inherited)
Events.To_String (Inherited)
Objects.Adjust (Inherited)
Objects.Construct (Inherited)
Objects.Delete (Inherited)
Objects.Object_Read (Inherited)
Objects.Object_Write (Inherited)
A command to end the game session.

Game_Paused_Event

type Game_Paused_Event is new Event with private;

Ancestors:

Primitive operations:

Construct
Events.Construct (Inherited)
Objects.Adjust (Inherited)
Objects.Construct (Inherited)
Objects.Delete (Inherited)
Objects.Object_Read (Inherited)
Objects.Object_Write (Inherited)
To_String (overriding Events.To_String)
A notification that the game paused state has changed.

Game_State_Event

type Game_State_Event is new Event with private;

Ancestors:

Primitive operations:

Construct
Events.Construct (Inherited)
Objects.Adjust (Inherited)
Objects.Construct (Inherited)
Objects.Delete (Inherited)
Objects.Object_Read (Inherited)
Objects.Object_Write (Inherited)
To_String (overriding Events.To_String)
A notification that the gameplay state has changed. This happens when a game session begins and ends.

Game_Var_Changed_Event

type Game_Var_Changed_Event is new Event with private;

Ancestors:

Primitive operations:

Adjust (overriding Objects.Adjust)
Construct
Delete (overriding Objects.Delete)
Events.Construct (Inherited)
Objects.Construct (Inherited)
Objects.Object_Read (Inherited)
Objects.Object_Write (Inherited)
To_String (overriding Events.To_String)
A notification that a game session variable has changed.

Loading_Event

type Loading_Event is new Event with private;

Ancestors:

Primitive operations:

Construct
Events.Construct (Inherited)
Objects.Adjust (Inherited)
Objects.Construct (Inherited)
Objects.Delete (Inherited)
Objects.Object_Read (Inherited)
Objects.Object_Write (Inherited)
To_String (overriding Events.To_String)
A notification that the game loading state has changed. This happens when the game logic begins and finishes loading resources.

New_Game_Event

type New_Game_Event is new Event with private;

Ancestors:

Primitive operations:

Events.Construct (Inherited)
Events.To_String (Inherited)
Objects.Adjust (Inherited)
Objects.Construct (Inherited)
Objects.Delete (Inherited)
Objects.Object_Read (Inherited)
Objects.Object_Write (Inherited)
A command to begin a new game session.

Pause_Game_Event

type Pause_Game_Event is new Event with private;

Ancestors:

Primitive operations:

Construct
Events.Construct (Inherited)
Events.To_String (Inherited)
Objects.Adjust (Inherited)
Objects.Construct (Inherited)
Objects.Delete (Inherited)
Objects.Object_Read (Inherited)
Objects.Object_Write (Inherited)
A command to change the game paused state.

Player_Died_Event

type Player_Died_Event is new Event with private;

Ancestors:

Primitive operations:

Events.Construct (Inherited)
Events.To_String (Inherited)
Objects.Adjust (Inherited)
Objects.Construct (Inherited)
Objects.Delete (Inherited)
Objects.Object_Read (Inherited)
Objects.Object_Write (Inherited)
A notification that the player died.

Scroll_View_Event

type Scroll_View_Event is new Event with private;

Ancestors:

Primitive operations:

Construct
Events.Construct (Inherited)
Events.To_String (Inherited)
Objects.Adjust (Inherited)
Objects.Construct (Inherited)
Objects.Delete (Inherited)
Objects.Object_Read (Inherited)
Objects.Object_Write (Inherited)
A command to scroll the gaame view's viewport of the world.

View_Ready_Event

type View_Ready_Event is new Event with private;

Ancestors:

Primitive operations:

Construct
Events.Construct (Inherited)
Events.To_String (Inherited)
Objects.Adjust (Inherited)
Objects.Construct (Inherited)
Objects.Delete (Inherited)
Objects.Object_Read (Inherited)
Objects.Object_Write (Inherited)
A notification that the gameplay readiness state of the view has changed. When a new world is loaded, the view also loads the required content referenced in the World_Loaded event and sends a View_Ready event when it is finished loading and finished display the level loading dialog and is ready for gameplay to begin.

Types

A_End_Game_Event

type A_End_Game_Event is access all End_Game_Event'Class;

A_Game_Paused_Event

type A_Game_Paused_Event is access all Game_Paused_Event'Class;

A_Game_State_Event

type A_Game_State_Event is access all Game_State_Event'Class;

A_Game_Var_Changed_Event

type A_Game_Var_Changed_Event is access all Game_Var_Changed_Event'Class;

A_Loading_Event

type A_Loading_Event is access all Loading_Event'Class;

A_New_Game_Event

type A_New_Game_Event is access all New_Game_Event'Class;

A_Pause_Game_Event

type A_Pause_Game_Event is access all Pause_Game_Event'Class;

A_Player_Died_Event

type A_Player_Died_Event is access all Player_Died_Event'Class;

A_Scroll_View_Event

type A_Scroll_View_Event is access all Scroll_View_Event'Class;

A_View_Ready_Event

type A_View_Ready_Event is access all View_Ready_Event'Class;

Constants & Global variables

END_GAME_ID (Events.Event_Id)

END_GAME_ID : constant Event_Id := To_Event_Id( "End_Game" );

GAME_PAUSED_ID (Events.Event_Id)

GAME_PAUSED_ID : constant Event_Id := To_Event_Id( "Game_Paused" );

GAME_STATE_ID (Events.Event_Id)

GAME_STATE_ID : constant Event_Id := To_Event_Id( "Game_State" );

GAME_VAR_CHANGED_ID (Events.Event_Id)

GAME_VAR_CHANGED_ID : constant Event_Id := To_Event_Id( "Game_Var_Changed" );

LOADING_ID (Events.Event_Id)

LOADING_ID : constant Event_Id := To_Event_Id( "Loading" );

NEW_GAME_ID (Events.Event_Id)

NEW_GAME_ID : constant Event_Id := To_Event_Id( "New_Game" );

PAUSE_GAME_ID (Events.Event_Id)

PAUSE_GAME_ID : constant Event_Id := To_Event_Id( "Pause_Game" );

PLAYER_DIED_ID (Events.Event_Id)

PLAYER_DIED_ID : constant Event_Id := To_Event_Id( "Player_Died" );

SCROLL_VIEW_ID (Events.Event_Id)

SCROLL_VIEW_ID : constant Event_Id := To_Event_Id( "Scroll_View" );

VIEW_READY_ID (Events.Event_Id)

VIEW_READY_ID : constant Event_Id := To_Event_Id( "View_Ready" );

Subprograms & Entries

Is_Paused

function Is_Paused
( this: not null access Game_Paused_Event'Class ) return Boolean;
Returns True if the gameplay has been paused or False if it has been resumed.

Is_Playing

function Is_Playing
( this: not null access Game_State_Event'Class ) return Boolean;
Returns True if gameplay is in progress.

Get_Var

function Get_Var
( this: not null access Game_Var_Changed_Event'Class ) return String;
Returns the name of the variable that changed.

Copy_Value

procedure Copy_Value
( this: access Game_Var_Changed_Event;
val: in out A_Value );
Returns a copy of the variable's new value. The value can be of any type.

Is_Loading

function Is_Loading
( this: not null access Loading_Event'Class ) return Boolean;
Returns True if loading is in progress or False if it has completed.

Is_Paused

function Is_Paused
( this: not null access Pause_Game_Event'Class ) return Boolean;
Returns True if the command is to pause the gameplay, or False if the command is to resume gameplay.

Get_X

function Get_X
( this: not null access Scroll_View_Event'Class ) return Float;
Amount to scroll view in the X axis in world coordinates.

Get_Y

function Get_Y
( this: not null access Scroll_View_Event'Class ) return Float;
Amount to scroll view in the Y axis in world coordinates.

Is_Ready

function Is_Ready
( this: not null access View_Ready_Event'Class ) return Boolean;
Returns True if the view is ready for gameplay.

Queue_End_Game

procedure Queue_End_Game;
Queues an End_Game_Event.

Queue_Game_Paused

procedure Queue_Game_Paused
( paused: Boolean );

Queue_Game_State

procedure Queue_Game_State
( playing: Boolean );
Queues a Game_State_Event.

Queue_Game_Var_Changed

procedure Queue_Game_Var_Changed
( var: String;
val: in out A_Value );

Queue_Loading

procedure Queue_Loading
( loading: Boolean );
Queues a Loading_Event.

Queue_New_Game

procedure Queue_New_Game;
Queues a New_Game_Event.

Queue_Pause_Game

procedure Queue_Pause_Game
( paused: Boolean );
Queues a Pause_Game_Event.

Queue_Player_Died

procedure Queue_Player_Died;

Queue_Scroll_View

procedure Queue_Scroll_View
( x, y: Float );

Queue_View_Ready

procedure Queue_View_Ready
( ready: Boolean );
Queues a View_Ready_Event.