Module GameEngine :: Class GameEngine
[show private | hide private]
[frames | no frames]

Class GameEngine

Engine --+
         |
        GameEngine


The main game engine.
Method Summary
  __init__(self, config)
Constructor.
  clearScreen(self)
  connect(self, host)
Connect to a game server.
  disconnect(self, session)
Disconnect a Session
  isDebugModeEnabled(self)
  isServerRunning(self)
  loading(self)
Loading state loop.
  loadSvgDrawing(self, target, name, fileName, textureSize)
Load an SVG drawing synchronously.
  main(self)
Main state loop.
  resizeScreen(self, width, height)
Resize the game screen.
  restart(self)
Restart the game.
  run(self)
Run one cycle of the task scheduler engine.
  setDebugModeEnabled(self, enabled)
Show or hide the debug layer.
  setStartupLayer(self, startupLayer)
Set the Layer that will be shown when the all the resources have been loaded.
  startServer(self)
Start the game server.
  stopServer(self)
Stop the game server.
  toggleFullscreen(self)
Toggle between fullscreen and windowed mode.
    Inherited from Engine
  addTask(self, task, synchronized)
Add a task to the engine.
  pauseTask(self, task)
Pause a task.
  quit(self)
  removeTask(self, task)
Remove a task from the engine.
  resumeTask(self, task)
Resume a paused task.
  _getTaskQueues(self, task)
  _runTask(self, task, ticks)

Method Details

__init__(self, config=None)
(Constructor)

Constructor.
Parameters:
config - Config instance for settings
Overrides:
Engine.Engine.__init__

connect(self, host)

Connect to a game server.
Parameters:
host - Name of host to connect to
Returns:
Session connected to remote server

disconnect(self, session)

Disconnect a Session

param session: Session to disconnect

loading(self)

Loading state loop.

loadSvgDrawing(self, target, name, fileName, textureSize=None)

Load an SVG drawing synchronously.

@param target:      An object that will own the drawing
@param name:        The name of the attribute the drawing will be assigned to
@param fileName:    The name of the file in the data directory
@param textureSize  Either None or (x, y), in which case the file will
                    be rendered to an x by y texture
@return:            L{SvgDrawing} instance

main(self)

Main state loop.

resizeScreen(self, width, height)

Resize the game screen.
Parameters:
width - New width in pixels
height - New height in pixels

restart(self)

Restart the game.

run(self)

Run one cycle of the task scheduler engine.
Overrides:
Engine.Engine.run (inherited documentation)

setDebugModeEnabled(self, enabled)

Show or hide the debug layer.
Parameters:
enabled
           (type=bool)

setStartupLayer(self, startupLayer)

Set the Layer that will be shown when the all the resources have been loaded. See Data
Parameters:
startupLayer - Startup Layer

startServer(self)

Start the game server.

stopServer(self)

Stop the game server.

toggleFullscreen(self)

Toggle between fullscreen and windowed mode.
Returns:
True on success

Generated by Epydoc 2.1 on Thu Aug 31 00:17:50 2006 http://epydoc.sf.net