Start/Stop Render

Get Arcade to actually do some of the drawing commands that we issue by calling start_render and finish_render.

Code

import arcade

if __name__ == '__main__':
    arcade.open_window(600, 600, 'Coin Game')
    arcade.set_background_color(arcade.color.WHEAT)
    arcade.start_render()
    arcade.finish_render()
    arcade.run()

Analysis

  • Arcade has a simple drawing mode (functions) and a richer game way of writing code (classes)
  • We are still using the simple drawing functions
  • Which means, we need to tell Arcade when we start sending drawing commands and when we stop
  • The background color isn’t set until we draw on the screen
  • In arcade, we do our drawing between the ‘start_render’ and ‘finish_render’ functions
  • These functions take no arguments
  • Again, let PyCharm do the autocomplete with you

Exercises

  1. Try commenting out start_render, finish_render, and both.