Skip to content

Commit 345a344

Browse files
committed
finish first level
1 parent 202511f commit 345a344

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

data/scenario.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ simple butterflies.
9898

9999
#### Level 8
100100
**Title**: Revenge of the Butterfly
101+
101102
The butterflies decide to give everything they have
102103
in one last battle. This is the final level
103104
that will need a bit of every weapon and patterns.

game/scripts/level1.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# Use scene.when to schedule events.
66
# Yield when you want to wait until the next event.
77
# This is a generator. Using a busy loop will halt the game.
8+
from random import uniform
89

910
from game.constants import GREEN
1011
from game.scripts.level import Level
@@ -34,7 +35,13 @@ def __call__(self):
3435
yield self.medium_pause()
3536

3637
self.square(0.25)
37-
yield self.huge_pause()
38+
yield self.medium_pause()
39+
40+
for i in range(10):
41+
self.spawn(uniform(-0.3, 0.3), uniform(-0.2, 0.2))
42+
yield self.small_pause()
43+
44+
self.medium_pause()
3845

3946
yield from self.slow_type("The butterflies are organising!", 5, delay=0.08)
4047
yield self.medium_pause()

game/scripts/level6.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,26 @@ def __call__(self):
2222
yield from super().__call__()
2323

2424
yield from self.slow_type("Welcome to Planet Butter", line=4, delay=0.05)
25-
yield from self.slow_type("You killed all the other butterflies", line=5, delay=0.05)
25+
yield from self.slow_type(
26+
"You killed all the other butterflies", line=5, delay=0.05
27+
)
2628
yield from self.slow_type("Big Butta and his minions", line=6, delay=0.05)
2729
yield from self.slow_type("are the only ones left!", line=7, delay=0.05)
2830
yield self.pause(1)
2931
self.terminal.clear()
30-
yield from self.slow_type("You should be careful here!", delay=0.05, color="red", blink=True)
31-
yield from self.slow_type("This is the home planet of Butterflies.", line=6, delay=0.05)
32+
yield from self.slow_type(
33+
"You should be careful here!", delay=0.05, color="red", blink=True
34+
)
35+
yield from self.slow_type(
36+
"This is the home planet of Butterflies.", line=6, delay=0.05
37+
)
3238
yield self.pause(2)
3339
self.terminal.clear()
3440

3541
yield from self.slow_type("The planet is also made of butter", delay=0.05)
36-
yield from self.slow_type("so Big Butta is most powerful here,", line=6, delay=0.05)
42+
yield from self.slow_type(
43+
"so Big Butta is most powerful here,", line=6, delay=0.05
44+
)
3745
yield from self.slow_type("you might have a hard time...", line=7, delay=0.05)
3846
yield self.pause(1)
3947
self.terminal.clear()

0 commit comments

Comments
 (0)