Skip to content

Commit 2c8b7e5

Browse files
Add missing type hints in function arguments
Most functions had type hints for their arguments except for `SpaceShooter.__init__` and `SpaceShooter.on_key_pressed`.
1 parent de036ef commit 2c8b7e5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arcade-a-primer/arcade_game.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class SpaceShooter(arcade.Window):
4040
Collisions end the game
4141
"""
4242

43-
def __init__(self, width, height, title):
43+
def __init__(self, width: int, height: int, title: str):
4444
"""Initialize the game
4545
"""
4646
super().__init__(width, height, title)
@@ -131,7 +131,7 @@ def add_cloud(self, delta_time: float):
131131
self.clouds_list.append(cloud)
132132
self.all_sprites.append(cloud)
133133

134-
def on_key_press(self, symbol, modifiers):
134+
def on_key_press(self, symbol: int, modifiers: int):
135135
"""Handle user keyboard input
136136
Q: Quit the game
137137
P: Pause the game

0 commit comments

Comments
 (0)