C# Class PunkX.Engine

Main game class, Manages the game loop.
ファイルを表示 Open project: RichardMarks/PunkX

Public Properties

Property Type Description
paused System.Boolean

Public Methods

Method Description
Engine ( int width, int height, int frameRate = 60, System.Boolean fixedFrameRate = false ) : System

Constructor. Defines startup information about your game.

init ( ) : void

override this method - called by Engine before main loop starts

render ( ) : void

Renders the game, rendering the World and Entities.

setStageProperties ( ) : void

Sets the game's stage properties. Override this to set them differently.

update ( ) : void

updates the game, updating the World and Entities

Private Methods

Method Description
checkWorld ( ) : void

Switch Worlds if they've changed.

onEnterFrame ( ) : void

Framerate independent game loop.

onStage ( ) : void

Event handler for stage entry.

onTimer ( ) : void

Fixed framerate game loop.

Method Details

Engine() public method

Constructor. Defines startup information about your game.
public Engine ( int width, int height, int frameRate = 60, System.Boolean fixedFrameRate = false ) : System
width int The width of your game.
height int The height of your game.
frameRate int The game framerate, in frames per second.
fixedFrameRate System.Boolean If a fixed-framerate should be used.
return System

init() public method

override this method - called by Engine before main loop starts
public init ( ) : void
return void

render() public method

Renders the game, rendering the World and Entities.
public render ( ) : void
return void

setStageProperties() public method

Sets the game's stage properties. Override this to set them differently.
public setStageProperties ( ) : void
return void

update() public method

updates the game, updating the World and Entities
public update ( ) : void
return void

Property Details

paused public_oe property

If the game should stop updating/rendering.
public Boolean,System paused
return System.Boolean