SHARE
TWEET

hejsa

a guest Oct 21st, 2019 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import arcade
  2.  
  3.  
  4. class MyGame(arcade.Window):
  5.  
  6.     speedX = 2
  7.     def __init__(self, width, height, title):
  8.  
  9.         # Call the parent class's init function
  10.         super().__init__(width, height, title)
  11.  
  12.         # Set the background color
  13.         arcade.set_background_color(arcade.color.ASH_GREY)
  14.  
  15.         # Attributes to store where our ball is
  16.         self.ball_x = 50
  17.         self.ball_y = 50
  18.  
  19.     def on_draw(self):
  20.         """ Called whenever we need to draw the window. """
  21.         arcade.start_render()
  22.  
  23.         arcade.draw_circle_filled(
  24.             self.ball_x, self.ball_y, 15, arcade.color.AUBURN)
  25.  
  26.     def update(self, delta_time):
  27.         """ Called to update our objects. Happens approximately 60 times per second."""
  28.         self.ball_x = self.ball_x + 2
  29.  
  30.  
  31. def main():
  32.     window = MyGame(640, 480, "Min vindue")
  33.  
  34.     arcade.run()
  35.  
  36.  
  37. main()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top