Skip to content

Examples: Fix incorrect usage of close() in some examples #2545

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arcade/examples/astar_pathfinding.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def on_key_press(self, key, modifiers):
self.right_pressed = True
# Close the window / exit game
elif key == arcade.key.ESCAPE:
self.close()
self.window.close()

def on_key_release(self, key, modifiers):
"""Called when the user releases a key. """
Expand Down
2 changes: 1 addition & 1 deletion arcade/examples/asteroid_smasher.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def on_key_press(self, symbol, modifiers):
self.start_new_game()
# Quit if the player hits escape
elif symbol == arcade.key.ESCAPE:
self.close()
self.window.close()

def on_key_release(self, symbol, modifiers):
""" Called whenever a key is released. """
Expand Down
2 changes: 1 addition & 1 deletion arcade/examples/dual_stick_shooter.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def on_key_press(self, key, modifiers):
self.player.start_pressed = True
# close the window if the user hits the escape key
elif key == arcade.key.ESCAPE:
self.close()
self.window.close()

rad = math.atan2(self.player.change_y, self.player.change_x)
self.player.angle = math.degrees(rad) + ROTATE_OFFSET
Expand Down
2 changes: 1 addition & 1 deletion arcade/examples/particle_fireworks.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ def on_draw(self):

def on_key_press(self, key, modifiers):
if key == arcade.key.ESCAPE:
arcade.close_window()
self.window.close()


def firework_spark_mutator(particle: FadeParticle):
Expand Down
2 changes: 1 addition & 1 deletion arcade/examples/slime_invaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def on_draw(self):

def on_key_press(self, key, modifiers):
if key == arcade.key.ESCAPE:
self.close()
self.window.close()

def on_mouse_motion(self, x, y, dx, dy):
"""
Expand Down
Loading