Index

Package: Game

Description

package Events.Game is
Copyright (c) 2012 Kevin Wellwood All rights reserved. This source code is distributed under the Modified BSD License. For terms and conditions, see license.txt.

Classes

End_Game_Event

type End_Game_Event is new Event with private;

Ancestors:

Primitive operations:

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

Game_Paused_Event

type Game_Paused_Event is new Event with private;

Ancestors:

Primitive operations:

Adjust (Inherited)
Construct (Inherited)
Construct (Inherited)
Construct
Delete (Inherited)
Object_Read (Inherited)
Object_Write (Inherited)
To_String (overriding 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:

Adjust (Inherited)
Construct (Inherited)
Construct (Inherited)
Construct
Delete (Inherited)
Object_Read (Inherited)
Object_Write (Inherited)
To_String (overriding 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 Adjust)
Construct (Inherited)
Construct
Construct (Inherited)
Delete (overriding Delete)
Object_Read (Inherited)
Object_Write (Inherited)
To_String (overriding To_String)
A notification that a game session variable has changed.

Loading_Event

type Loading_Event is new Event with private;

Ancestors:

Primitive operations:

Adjust (Inherited)
Construct (Inherited)
Construct (Inherited)
Construct
Delete (Inherited)
Object_Read (Inherited)
Object_Write (Inherited)
To_String (overriding 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:

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

Pause_Game_Event

type Pause_Game_Event is new Event with private;

Ancestors:

Primitive operations:

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

Player_Died_Event

type Player_Died_Event is new Event with private;

Ancestors:

Primitive operations:

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

Scroll_View_Event

type Scroll_View_Event is new Event with private;

Ancestors:

Primitive operations:

Adjust (Inherited)
Construct
Construct (Inherited)
Construct (Inherited)
Delete (Inherited)
Object_Read (Inherited)
Object_Write (Inherited)
To_String (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:

Adjust (Inherited)
Construct
Construct (Inherited)
Construct (Inherited)
Delete (Inherited)
Object_Read (Inherited)
Object_Write (Inherited)
To_String (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 (Event_Id)

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

GAME_PAUSED_ID (Event_Id)

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

GAME_STATE_ID (Event_Id)

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

GAME_VAR_CHANGED_ID (Event_Id)

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

LOADING_ID (Event_Id)

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

NEW_GAME_ID (Event_Id)

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

PAUSE_GAME_ID (Event_Id)

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

PLAYER_DIED_ID (Event_Id)

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

SCROLL_VIEW_ID (Event_Id)

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

VIEW_READY_ID (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_Interrupted

function Is_Interrupted
( this: not null access Game_State_Event'Class ) return Boolean;
Returns True if gameplay is not in progress now because the game session was interrupted by the player, instead of ending naturally (winning or losing.) The game session can be interrupted to start a new game, load a saved game, or just end the current game session by choice.

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;
interrupted: Boolean := False );
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.