Skip to content
Open
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-a-primer/arcade_basic_oop.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def on_draw(self):
"""Called whenever we need to draw our window"""

# Clear the screen and start drawing
arcade.start_render()
self.clear()

# Draw a blue circle
arcade.draw_circle_filled(
Expand Down
12 changes: 7 additions & 5 deletions arcade-a-primer/arcade_draw_shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def on_draw(self):
"""Called whenever we need to draw our window"""

# Clear the screen and start drawing
arcade.start_render()
self.clear()

# Draw a blue arc
arcade.draw_arc_filled(100, 100, 40, 40, arcade.color.BLUE, 0, 125)
Expand Down Expand Up @@ -62,11 +62,13 @@ def on_draw(self):
)

# Draw some rectangles
arcade.draw_rectangle_filled(100, 500, 150, 75, arcade.color.AZURE)
arcade.draw_lrtb_rectangle_filled(
150, 250, 575, 525, arcade.color.AMARANTH_PINK
arcade.draw_rect_filled(
arcade.XYWH(100, 500, 150, 75), arcade.color.AZURE
)
arcade.draw_xywh_rectangle_filled(
arcade.draw_lrbt_rectangle_filled(
150, 250, 525, 575, arcade.color.AMARANTH_PINK
)
arcade.draw_lbwh_rectangle_filled(
200, 550, 150, 75, arcade.color.ASPARAGUS
)

Expand Down
6 changes: 3 additions & 3 deletions arcade-a-primer/arcade_game.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ class FlyingSprite(arcade.Sprite):
Flying sprites include enemies and clouds
"""

def update(self):
def update(self, delta_time: float = 1 / 60):
"""Update the position of the sprite
When it moves off screen to the left, remove it
"""

# Move the sprite
super().update()
super().update(delta_time)

# Remove us if we're off screen
if self.right < 0:
Expand Down Expand Up @@ -237,7 +237,7 @@ def on_update(self, delta_time: float):
def on_draw(self):
"""Draw all game objects"""

arcade.start_render()
self.clear()
self.all_sprites.draw()


Expand Down
1 change: 1 addition & 0 deletions arcade-a-primer/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
arcade==3.3.3
Loading