mirror of
https://github.com/OpenBMB/ChatDev.git
synced 2024-09-19 14:17:32 +03:00
19 lines
568 B
Python
19 lines
568 B
Python
'''
|
|
This file contains the Game class which manages the pinball game.
|
|
'''
|
|
import tkinter as tk
|
|
from player import Player
|
|
class Game:
|
|
def __init__(self, window):
|
|
self.window = window
|
|
self.canvas = tk.Canvas(self.window, width=800, height=600)
|
|
self.canvas.pack()
|
|
self.player = Player(self.canvas)
|
|
def start(self):
|
|
self.canvas.bind("<Button-1>", self.player.move)
|
|
self.canvas.focus_set()
|
|
self.update()
|
|
def update(self):
|
|
self.player.update()
|
|
self.window.after(10, self.update)
|
|
# player.py |