Skip to content

Commit

Permalink
Make sure the sky covers the screen during game over.
Browse files Browse the repository at this point in the history
  • Loading branch information
mgedmin committed Feb 4, 2011
1 parent c163715 commit 5d7741a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions dodo.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,10 +595,13 @@ def __init__(self, game):
self.batch = pyglet.graphics.Batch()
self.sprites = []
map = game.game_map
n = map.map_width * map.map_height * self.parallax ** 2 * self.density
w, h = map.map_width, map.map_height
w += 5000 # add some sky to the right of the map
h += 5000 # add some sky above the topmost cliff
n = w * h * self.parallax ** 2 * self.density
for i in range(int(n)):
x = random.uniform(0, map.map_width * abs(self.parallax))
y = random.uniform(0, map.map_height * abs(self.parallax))
x = random.uniform(0, w * abs(self.parallax))
y = random.uniform(0, h * abs(self.parallax))
s = pyglet.sprite.Sprite(random.choice(self.images), x, y,
batch=self.batch)
self.sprites.append(s)
Expand Down

0 comments on commit 5d7741a

Please sign in to comment.