solitaire_01.py Full Listing
solitaire_01.py
1"""
2Solitaire clone.
3"""
4import arcade
5
6# Screen title and size
7SCREEN_WIDTH = 1024
8SCREEN_HEIGHT = 768
9SCREEN_TITLE = "Drag and Drop Cards"
10
11
12class MyGame(arcade.Window):
13 """ Main application class. """
14
15 def __init__(self):
16 super().__init__(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
17
18 self.background_color = arcade.color.AMAZON
19
20 def setup(self):
21 """ Set up the game here. Call this function to restart the game. """
22 pass
23
24 def on_draw(self):
25 """ Render the screen. """
26 # Clear the screen
27 self.clear()
28
29 def on_mouse_press(self, x, y, button, key_modifiers):
30 """ Called when the user presses a mouse button. """
31 pass
32
33 def on_mouse_release(self, x: float, y: float, button: int,
34 modifiers: int):
35 """ Called when the user presses a mouse button. """
36 pass
37
38 def on_mouse_motion(self, x: float, y: float, dx: float, dy: float):
39 """ User moves mouse """
40 pass
41
42
43def main():
44 """ Main function """
45 window = MyGame()
46 window.setup()
47 arcade.run()
48
49
50if __name__ == "__main__":
51 main()