Game

Summary

This is the main class for any game. The class Game should be used as the application's entry-point. All functions—initialize, update, and draw —must be called by it.

Definition

Namespace Pyxil.Framework
Syntax class Game(object)

Constructors

Name Description
Game(console: bool = False) Initializes a new instance of the Game class.

Properties

Name Type Description
gameWindow GameWindow | GameConsole Get the window object. If the object is None, it must return an instance of GameConsole.
gameTime GameTime It is created before initialize runs. This variable manages the application's time.
spriteBatch SpriteBatch Specifies the screen to be drawn.

Methods

Name Description
initialize() Initializes components and instance variables.
update(gameTime: GameTime | None) Updates the game based on GameTime.
draw(spriteBatch: SpriteBatch | None) Renders objects on the screen.
tick() Measure and apply elapsed time for the next game frame.