C# Class PunkX.Engine

Main game class, Manages the game loop.
Afficher le fichier Open project: RichardMarks/PunkX

Méthodes publiques

Свойство Type Description
paused System.Boolean

Méthodes publiques

Méthode 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

Méthode 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 méthode

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.
Résultat System

init() public méthode

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

render() public méthode

Renders the game, rendering the World and Entities.
public render ( ) : void
Résultat void

setStageProperties() public méthode

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

update() public méthode

updates the game, updating the World and Entities
public update ( ) : void
Résultat void

Property Details

paused public_oe property

If the game should stop updating/rendering.
public Boolean,System paused
Résultat System.Boolean