Skip to content

Commit 9116e50

Browse files
committed
Escape to qui
1 parent 7fe1720 commit 9116e50

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/scenes/intro.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ async def boot(self):
2727
self.app.audio.load_sound('intro', os.path.join('assets', 'sounds', 'intro.wav'))
2828

2929
self.add_sprite('application_name', Text(self.app, Vector2(960, 540), 'Pygame Application', 48))
30-
self.add_sprite('tip', Text(self.app, Vector2(960, 600), 'Press space to quit'))
30+
self.add_sprite('tip', Text(self.app, Vector2(960, 600), 'Press escape to quit'))
3131

3232
self.add_sprite('continue_button',
3333
Button(self.app, Vector2(660, 650), (600, 50),
@@ -37,7 +37,7 @@ async def boot(self):
3737
async def update(self):
3838
self._update_tip_color()
3939

40-
if pg.key.get_pressed()[pg.K_SPACE]:
40+
if pg.key.get_pressed()[pg.K_ESCAPE]:
4141
self.app.quit()
4242

4343
async def enter(self):

src/scenes/rocket_game.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
from src.scene import Scene
1313

14-
from src.sprites import Image
14+
from src.sprites import Image, Text, TextAlign
1515

1616
if TYPE_CHECKING:
1717
from src.app import App
@@ -31,6 +31,8 @@ def __init__(self, app: 'App'):
3131
self.previous_turn_of_sun: float = 0
3232

3333
async def boot(self):
34+
self.add_sprite('tip', Text(self.app, Vector2(10, 10), 'Press escape to quit',
35+
color=(128, 128, 128), align=TextAlign.LEFT))
3436
self.add_sprite('sun', Image(self.app, Vector2(904, 484), os.path.join('assets', 'images', 'sun.png'),
3537
(56, 56)))
3638
self.add_sprite('rocket',

0 commit comments

Comments
 (0)