Package pajammin :: Package entity :: Module environ :: Class Platform
[show private | hide private]
[frames | no frames]

Type Platform

object --+    
         |    
    Entity --+
             |
            Platform

Known Subclasses:
BouncyPlatform, MovingPlatform

A thin flat surface that you can stand on. Platforms are variable-width entities made up of a single body covered by multiple sprite tiles. Platforms are only solid on top, so you can stand on them but you can also walk past them or jump up through them.
Method Summary
  __init__(self, x, y, numtiles, style)
  handle_movement(self, dx, dy)
Called when one of the entity's bodies moves.
  icon(cls, style)
(Class method)
  _arrange_sprites(self, x, y)
  _set_numtiles(self, numtiles)
    Inherited from Entity
  __repr__(self)
  add_body(self, body)
  add_sprite(self, sprite)
  after(self, duration, callback, *params, **kwparams)
After the given duration has elapsed, call the given callback function.
  handle_collision(self, obstacle, side)
Called when one of the entity's bodies collides with another body.
  handle_lose_support(self, old_support)
Called when one of the entity's bodies becomes unsupported.
  remove_body(self, body)
  remove_sprite(self, sprite)
  update(self, duration)
Perform any necessary updates to this entity.
  use(self)
Define this method for entities that the avatar can 'use'.
  _check_after_callbacks(self, duration)
    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
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
Return str(x)...

Property Summary
  numtiles: The number of tiles that make up this platform.
  tile_height: The height of the sprite tiles that make up this platform.
  tile_width: The width of the sprite tiles that make up this platform.
  x: The x position of the center of the platform.
  y: The y position of the center of the platform.
    Inherited from Entity
  bodies
  sprites

Instance Variable Summary
    Inherited from Entity
bool alive: A flag indicating whether the entity is alive or not.
  bodies = pajammin.entity.entity.Entity.bodies
NoneType level: A pointer to the level that contains this entity (if any).
  sprites = pajammin.entity.entity.Entity.sprites
NoneType update_delay: The amount of time that has elapsed since the last time update was called for this entity.

Class Variable Summary
bool is_mobile = False
tuple margin = (10, 0)
tuple p = ('TwigPlatform', 'environ/plat10.gif', (30, 20), 5)
int solid_sides = 4                                                                     
list styles = ['GrassPlatform', 'SmoothBluePlatform', 'Smooth...
    Inherited from Entity
bool autouse = False
bool is_usable = False
int update_interval: The interval at which entities in a given class should have its update function called.
tuple _after_callbacks = ()
tuple _bodies = ()
tuple _sprites = ()

Instance Method Details

__init__(self, x, y, numtiles, style)
(Constructor)

Overrides:
__builtin__.object.__init__

handle_movement(self, dx, dy)

Called when one of the entity's bodies moves. By default, this moves all of the entity's sprites.
Overrides:
pajammin.entity.entity.Entity.handle_movement (inherited documentation)

_arrange_sprites(self, x, y)

_set_numtiles(self, numtiles)


Class Method Details

icon(cls, style=None)

Overrides:
__builtin__.type.icon

Property Details

numtiles

The number of tiles that make up this platform.
Get Method:
unknown-17010224(...)
Set Method:
_set_numtiles(self, numtiles)

tile_height

The height of the sprite tiles that make up this platform.
Get Method:
unknown-17010160(...)

tile_width

The width of the sprite tiles that make up this platform.
Get Method:
unknown-17010096(...)

x

The x position of the center of the platform.
Get Method:
unknown-17010288(...)

y

The y position of the center of the platform.
Get Method:
unknown-17010352(...)

Class Variable Details

is_mobile

Type:
bool
Value:
False                                                                  

margin

Type:
tuple
Value:
(10, 0)                                                                

p

Type:
tuple
Value:
('TwigPlatform', 'environ/plat10.gif', (30, 20), 5)                    

solid_sides

Type:
int
Value:
4                                                                     

styles

Type:
list
Value:
['GrassPlatform',
 'SmoothBluePlatform',
 'SmoothTealPlatform',
 'SmoothPinkPlatform',
 'SmoothRedPlatform',
 'DarkDirtPlatform',
 'SurrealPlatform',
 'SandyPlatform',
...