Changeset 560:57efcd81647b for nagslang


Ignore:
Timestamp:
Sep 7, 2013, 8:15:10 PM (7 years ago)
Author:
Jeremy Thurgood <firxen@…>
Branch:
default
rebase_source:
3e7e791c51c3900ed3efa6e6b41ab7b23a127f34
Message:

SokoBox?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/game_object.py

    r558 r560  
    360360
    361361
     362class SokoBox(GameObject):
     363    def __init__(self, space, position):
     364        body = make_body(1, pymunk.inf, position)
     365        self.shape = pymunk.Poly(
     366            body, [(-40, -40), (40, -40), (40, 40), (-40, 40)])
     367        self.shape.friction = 0.5
     368        self.shape.collision_type = COLLISION_TYPE_FURNITURE
     369        super(Box, self).__init__(
     370            SingleShapePhysicser(space, self.shape),
     371            render.ImageRenderer(
     372                resources.get_image('objects', 'sokobox.png')),
     373        )
     374
     375    @classmethod
     376    def requires(cls):
     377        return [("name", "string"), ("position", "coordinates"),
     378                ("state_source", "puzzler")]
     379
     380
    362381class BaseDoor(GameObject):
    363382    zorder = ZORDER_FLOOR
Note: See TracChangeset for help on using the changeset viewer.