Package pajammin :: Module level :: Class Level
[show private | hide private]
[frames | no frames]

Type Level

object --+
         |
        Level


The entire state of a single Pajammin' level. Each level consists of: A level can be 'attached' to a display engine and a physics engine. Once a level is attached to a physics engine, it will create one or more path planners for the level.
Method Summary
  __init__(self, name)
  __getstate__(self)
  __setstate__(self, state)
  add_body(self, body)
Add a new body to the level.
  add_entity(self, entity)
Add a new entity to the level.
  add_sprite(self, owner, sprite)
Add a new sprite to the level.
  agents_in_rect(self, rect)
  attach(self, display_engine, physics_engine)
  attach_display(self, display_engine)
  attach_physics(self, physics_engine)
  bodies(self)
  bodies_intersecting_point(self, x, y, include_nonsolids)
  bodies_intersecting_rect(self, rect, include_nonsolids)
  detach(self)
  detach_display(self)
  detach_physics(self)
  entities(self)
Return a list of all entities in this level.
  entities_in_rect(self, rect)
  explore(self, rect)
Record the fact that the player has explored the given area of the level (so fog should be removed from that area).
  explored_areas(self)
Return a list of rects, indicating what areas the player has explored.
  find_walker_path(self, walker, endx, endy)
  load(levelname, dir)
(Static method)
  remove_body(self, body)
Remove a body from the level.
  remove_entity(self, entity)
  remove_sprite(self, owner, sprite)
Remove a sprite from the level.
  save(self, levelname, dir)
  scripts(self)
  update_path_planners(self)
  _set_bg(self, val)
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
Return hash(x)...
  __new__(T, S, ...)
Return a new object with type S, a subtype of T...
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
Return repr(x)...
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
Return str(x)...

Property Summary
  background: The name of the level's background image file.

Instance Variable Summary
  walker_path_planner: A path planner used by walkers to navigate the level.

Class Variable Summary
int EXPLORE_TILESIZE = 100                                                                   
int PICKLE_PROTOCOL = -1                                                                    
bool reset_scripts_to_default = True

Instance Method Details

__init__(self, name=None)
(Constructor)

Overrides:
__builtin__.object.__init__

__getstate__(self)

__setstate__(self, state)

add_body(self, body)

Add a new body to the level. A new body should only be added by the entity that owns it.
Parameters:
body - The new body.

add_entity(self, entity)

Add a new entity to the level.

add_sprite(self, owner, sprite)

Add a new sprite to the level. A new sprite should only be added by the entity that owns it.
Parameters:
owner - The entity that owns the new sprite.
sprite - The new sprite.

agents_in_rect(self, rect)

attach(self, display_engine, physics_engine)

attach_display(self, display_engine)

attach_physics(self, physics_engine)

bodies(self)

bodies_intersecting_point(self, x, y, include_nonsolids=True)

bodies_intersecting_rect(self, rect, include_nonsolids=True)

detach(self)

detach_display(self)

detach_physics(self)

entities(self)

Return a list of all entities in this level.

entities_in_rect(self, rect)

explore(self, rect)

Record the fact that the player has explored the given area of the level (so fog should be removed from that area).

explored_areas(self)

Return a list of rects, indicating what areas the player has explored.

find_walker_path(self, walker, endx, endy)

remove_body(self, body)

Remove a body from the level. A Body should only be removed by the entity that owns it.
Parameters:
body - The body to remove.

remove_entity(self, entity)

remove_sprite(self, owner, sprite)

Remove a sprite from the level. A Sprite should only be removed by the entity that owns it.
Parameters:
owner - The entity that owns the sprite.
sprite - The sprite to remove.

save(self, levelname, dir='levels')

scripts(self)

update_path_planners(self)

_set_bg(self, val)


Static Method Details

load(levelname, dir='levels')


Property Details

background

The name of the level's background image file.
Get Method:
unknown-17081712(...)
Set Method:
_set_bg(self, val)

Instance Variable Details

walker_path_planner

A path planner used by walkers to navigate the level.

Class Variable Details

EXPLORE_TILESIZE

Type:
int
Value:
100                                                                   

PICKLE_PROTOCOL

Type:
int
Value:
-1                                                                    

reset_scripts_to_default

Type:
bool
Value:
True