Advertisement
Guest User

hejsa

a guest
Oct 21st, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.87 KB | None | 0 0
  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()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement