| Home | Trees | Index | Help |
|---|
|
|
To run pajammin on windows, double click on
pajammin.pyw; to run pajammin on UNIX or OS X, run the
pajammin script. (In either case, the pajammin package
must be in python's path!)
The world of sleepyland is divided into levels, each of which
is encoded with a single Level object. Each level is made up of
discrete Entitys, including platforms, walls,
ground, monsters, the player's avatar, and background decorations.
Each entity can own zero or more rectangular physical forms, or Bodys. Physical interactions between
these bodies, such as collision detection, are handled by the PhysicsEngine.
Each entity can also own zero or more animated graphical widgets
called Sprites. The display an animation of
these sprites (and any other on-screen elements) is handled by the DisplayEngine.
Entities can be controlled by AI Scripts. Each script starts out as a list
of tasks that should be performed in sequence. Tasks can optionally
spawn sub-tasks, which should be completed before (or instead of) the
main task, leading to a depth-first "tree" of tasks.
Top-level control-flow of the game is controlled by the GameEngine, which is responsible for
updating the physics and display engines; the AI scripts; for calling
the entities' individual update functions; and for handling user input.
The game engine uses a Game object to store the current state of
the game. In particular, the Game maintains a copy of
every level that the player has explored; and a pointer to the current
level. In order to save memory space, the Game object may
store levels that the player is not currently exploring on disk.
#################################################################### # ENGINES # # +---------------+ owns +------------+ owns +---------------+ # # | DisplayEngine |<-------| GameEngine |------->| PhysicsEngine | # # +---------------+ 1 +------------+ 1 +---------------+ # # | | owns | # #..........|.....................|.......................|.........# # DATA | V 1 | # # | +------+ | # # | | Game | | # # | +------+ | # # | | owns | # # | | | # # | V 0+ | # # | controls +-----------+ controls | # # | | Level | | # # | +-----------+ | # # | owns | | owns | # # | | | | # # | | V 0+ | # # | | +--------+ | # # | | | Script | | # # | | +--------+ | # # | | | controls | # # | | | | # # V 0+ 0+ V V 1? V 0+ # # +--------+ 0+ owns +--------+ owns +------+ # # | Sprite |<-----------| Entity |-------------->| Body | # # +--------+ +--------+ +------+ # ####################################################################
scripts/
pajammin .................. UNIX script to run Pajammin'
pajammin.pyw .............. Windows script to run Pajammin'
pajammin/
cli.py .................... The command-line interface
game.py ................... The game engine & the 'Game' data class
level.py .................. The 'Level' data class
physics.py ................ The physics engine
input.py .................. Input event dispatcher
consts.py ................. Definitions of shared constants
iso3d.py .................. A file where I'm experimenting with doing
isometric 3d display
entitiy/ .................. Objects in the game
entity.py ............... The 'Entity' base class
agent/ .................. Entities that represent 'characters'
agent.py .............. The 'Agent' base class & related classes
avatar.py ............. The player's avatar entity
walker.py ............. Agents that walk
flyer.py .............. Agents that fly
projectile.py ........... Projectiles (bullets, fireballs, etc.)
environ.py .............. Entities that make up the environment
mark.py ................. Short-lived entities with no body that show
some an action (eg an explosion).
ai/ ....................... Artificial Intelligence
script/ ................. AI scripts
script.py ............. The 'Script' class & related classes
default.py ............ Default script generator
agent.py .............. Scripts for all agents
walker.py ............. Scripts for walker agents
farie.py .............. Scripts for farie
pathplanner.py .......... Path planning
display/ .................. Graphical display support
engine.py ............... The display engine
text.py ................. Text rendering
image.py ................ Image loading & manpulation
hud.py .................. The heads-up display
sprite/ ................. Animated sprites
sprite.py ............. The 'Sprite' data class & related classes
*.py .................. Sprite category definitions
ui/ ..................... User interface widgets
button.py ............. Buttons
menu.py ............... Menus
textbox.py ............ Text boxes
scrollbar.py .......... Scrollbars
util/ ..................... Utility classes & functions
grid.py ................. The ProximityGrid container datatype
importlevel.py .......... Import from old pajammin levels
profile.py .............. A simple profiler
leveleditor.py .......... The level editor
data.py ................. Path resolution for data files
data/ ..................... Data files (i.e., non-python files)
levels/ ................. Pickled 'Level' objects
images/ ................. Image files (sprites, backgrounds, etc.)
sounds/ ................. Sound files
saves/ .................. Save games (each in a separate subdirectory)
play/ ................... Swap space used by 'Game' to store levels
that the player is not currently exploring
Version: 0.6
Author: Edward Loper
Copyright: (C) 2005 Edward Loper
To Do:
| Submodules | |
|---|---|
| |
| Home | Trees | Index | Help |
|---|
| Generated by Epydoc 2.1 on Thu Sep 22 22:52:42 2005 | http://epydoc.sf.net |