uLua Paddle Game v2.2.0
A paddle game for Unity made as an example use of the uLua toolkit.
uLua.PaddleGame.Settings Class Reference

Class which keeps track of various game settings. More...

Public Member Functions

 Settings (string Name, LuaMonoBehaviour Context=null, bool ExposeOnInit=true, bool EnableObjectScript=false)
 Public constructor. More...
 
void AddScore (int Number)
 Increments player score. More...
 
void AddLevel (int Number=1)
 Increments the game level. More...
 
void AddLife (int Number=1)
 Increments player lives. More...
 
void Reset ()
 Resets the settings and updates the high score. More...
 

Public Attributes

int Level = 0
 Keeps track of the current level.
 
int Lives = 0
 Keeps track of remaining lives.
 
int Score = 0
 Keeps track of the player score.
 
int HighScore = 0
 Keeps track of the player high score.
 
int MaximumLevel = 0
 Indicates the maximum game level.
 
float Delay = 0f
 Delay before the ball is set in motion (in seconds).
 
float SpeedIncrement = 0f
 Ball/Paddle speed increment per level.
 
float ColorMultiplier = 0f
 Multiplier to adjust the brick color intensity.
 

Properties

float TotalSpeedIncrement [get]
 The total speed increment based on the current level. More...
 

Detailed Description

Class which keeps track of various game settings.

All public members of this class are exposed to Lua. Inherits from uLua.ExposedClass.

Constructor & Destructor Documentation

◆ Settings()

uLua.PaddleGame.Settings.Settings ( string  Name,
LuaMonoBehaviour  Context = null,
bool  ExposeOnInit = true,
bool  EnableObjectScript = false 
)
inline

Public constructor.

Parameters
NameSets the name of the object exposed to Lua.
ContextSets the context of the object exposed to Lua.
ExposeOnInit(Optional) Enables/disables the automatic exposure of this object to Lua.
EnableObjectScript(Optional) Enables/disables the execution of a Lua script for this object after it is exposed.

Member Function Documentation

◆ AddLevel()

void uLua.PaddleGame.Settings.AddLevel ( int  Number = 1)
inline

Increments the game level.

This method is exposed to the API. Invokes a UIUpdate event.

Parameters
Number(Optional) The number of levels to add. Defaults to 1.

◆ AddLife()

void uLua.PaddleGame.Settings.AddLife ( int  Number = 1)
inline

Increments player lives.

This method is exposed to the API. Invokes a UIUpdate event.

Parameters
Number(Optional) The number of lives to add. Defaults to 1.

◆ AddScore()

void uLua.PaddleGame.Settings.AddScore ( int  Number)
inline

Increments player score.

This method is exposed to the API. Invokes a UIUpdate event.

Parameters
NumberThe number to be added to the score.

◆ Reset()

void uLua.PaddleGame.Settings.Reset ( )
inline

Resets the settings and updates the high score.

This method is exposed to the API. Invokes a UIUpdate event.

Property Documentation

◆ TotalSpeedIncrement

float uLua.PaddleGame.Settings.TotalSpeedIncrement
get

The total speed increment based on the current level.

This property is exposed to the API.