A game class can set it's screen_width, screen_height,
updates_per_second, max_frame_skip to customize itself.
To run your game, you should call run_game on an instance of your
class. Other modules may use HamsterWheel.the_game to access the instance
of the game class currently running
modules may access the screen, fullscreen, run_time & is_playing
attributes of the instance of the game
|
__init__(self,
title=' HamsterWheel ' ) |
|
|
|
|
|
run_game(self)
The main game loop, should be called on a derived class to run the
game. |
|
|
|
update(self,
seconds)
Should be defined in a derived class to update the game state
seconds is the amount of game time that should pass |
|
|
|
draw(self)
Should be defined in a derived class to draw the game |
|
|
|
draw_debug(self)
Should be defined in a derived class to draw the game |
|
|
|
process_sdl_event(self,
event)
derived classes should call the base classes process function |
|
|
|
quit(self)
called when a quit message is posted |
|
|
|
register_for_events(self,
obj)
call this with self to get your function
"hamsterwheel_event" called before and after updates, draws
and frames hamsterwheel_event will be called with one arg eventtype
which will be one of the HamsterWheel.event members |
|
|
|
unregister_for_events(self,
obj)
called to stop getting event calls |
|
|