ChatDev/WareHouse/MarbelGameV1_ModelBest1024_20231026183909/game.py
2024-01-25 13:51:47 +08:00

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