Mercurial > mamba
diff mamba/snake.py @ 182:0a955d2536f0
Painted Jezebel! (Assuming you name your snake Jezebel.)
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Wed, 14 Sep 2011 16:27:11 +0200 |
parents | 061d711ba570 |
children | 275f0be6946c |
line wrap: on
line diff
--- a/mamba/snake.py Wed Sep 14 15:27:27 2011 +0200 +++ b/mamba/snake.py Wed Sep 14 16:27:11 2011 +0200 @@ -44,12 +44,13 @@ shifted, ds = self.head.shift_head(ds) if not shifted: break - world.interact(self.head.tile_pos) + world.interact(self.head) self.head.set_orientation(self.orientation) for segment in self.segments[1:]: old_tile_state = segment.get_tile_state() segment.shift_tile(tile_state) tile_state = old_tile_state + world.interact(segment) for segment in self.segments: segment.shift_pixels(ds) @@ -76,6 +77,8 @@ _detail_mutators = () + is_head = False + def __init__(self, image_name, tile_pos): super(Segment, self).__init__() self.set_base_image(image_name) @@ -138,6 +141,8 @@ EYE = mutators.Overlay("tiles/common/snake/snake-head-eye-r.png") TONGUE = mutators.Overlay("tiles/common/snake/snake-head-tongue-r.png") + is_head = True + def __init__(self, tile_pos): self._detail_mutators = (self.EYE,) super(Head, self).__init__(self.CLOSED, tile_pos)