Skip to content

Commit

Permalink
multi-sprite
Browse files Browse the repository at this point in the history
  • Loading branch information
csaez committed Feb 14, 2014
1 parent d0473ca commit a175bf3
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion flascii_bird.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ def bbox(self):
self._bbox = Vector(max([len(x) for x in sp]), len(sp))
return self._bbox

@property
def shape(self):
if type(self._shape) in ((list, tuple)):
index = 0 if self.vel.y > 0 else 1
return self._shape[index]
return self._shape

@shape.setter
def shape(self, value):
self._shape = value

def simulate(self, forces=None, max_speed=2):
forces = forces or list()
for f in forces:
Expand Down Expand Up @@ -117,7 +128,7 @@ def flascii_bird():
("." * TERMINAL_SIZE.x + "\n") * 3
GROUND = Sprite(GROUND)
GROUND.pos = Vector(0, 21)
BIRD = Sprite(" / (._\n===_/-")
BIRD = Sprite(("== (.\n \___\\", " / (./\n===_/"))
BIRD.pos = Vector(10, 0)

t = 0
Expand Down

0 comments on commit a175bf3

Please sign in to comment.