Mercurial > nagslang
comparison nagslang/game_object.py @ 558:4abf8cf717e9
Rename "bulkhead" to "hatch".
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Sat, 07 Sep 2013 22:09:53 +0200 |
parents | 766472b5c9a6 |
children | 57efcd81647b |
comparison
equal
deleted
inserted
replaced
557:943d93b47c77 | 558:4abf8cf717e9 |
---|---|
478 return [("name", "string"), ("position", "coordinates"), | 478 return [("name", "string"), ("position", "coordinates"), |
479 ("destination", "level name"), ("dest_pos", "coordinate"), | 479 ("destination", "level name"), ("dest_pos", "coordinate"), |
480 ("angle", "degrees"), ("key_item", "item name")] | 480 ("angle", "degrees"), ("key_item", "item name")] |
481 | 481 |
482 | 482 |
483 class Bulkhead(GameObject): | 483 class Hatch(GameObject): |
484 # Yes, I know this should be "hatch" instead of "bulkhead". It was late and | |
485 # I was tired and the search/replace would touch *everything* now. | |
486 zorder = ZORDER_FLOOR | 484 zorder = ZORDER_FLOOR |
487 | 485 |
488 def __init__(self, space, end1, end2, key_state=None): | 486 def __init__(self, space, end1, end2, key_state=None): |
489 body = make_body(None, None, (0, 0)) | 487 body = make_body(None, None, (0, 0)) |
490 self.shape = pymunk.Segment(body, tuple(end1), tuple(end2), 7) | 488 self.shape = pymunk.Segment(body, tuple(end1), tuple(end2), 7) |
491 self.shape.collision_type = COLLISION_TYPE_DOOR | 489 self.shape.collision_type = COLLISION_TYPE_DOOR |
492 if key_state is None: | 490 if key_state is None: |
493 puzzler = puzzle.YesPuzzler() | 491 puzzler = puzzle.YesPuzzler() |
494 else: | 492 else: |
495 puzzler = puzzle.StateProxyPuzzler(key_state) | 493 puzzler = puzzle.StateProxyPuzzler(key_state) |
496 super(Bulkhead, self).__init__( | 494 super(Hatch, self).__init__( |
497 SingleShapePhysicser(space, self.shape), | 495 SingleShapePhysicser(space, self.shape), |
498 render.BulkheadRenderer(), | 496 render.HatchRenderer(), |
499 puzzler, | 497 puzzler, |
500 ) | 498 ) |
501 | 499 |
502 def collide_with_protagonist(self, protagonist): | 500 def collide_with_protagonist(self, protagonist): |
503 if self.puzzler.get_state(): | 501 if self.puzzler.get_state(): |