Exemple #1
0
    def __init__(self, w, h, mag, root):
        # Please add variables as appropriate
        # Variables of class
        self.WIDTH = w
        self.HEIGHT = h
        self.MAG = mag
        self.root = root
        self.scene_cnt = 0
        self.goal_order = []

        # Variables of function
        self.var_start_menu = (1, None)
        self.var_select_menu = (3, 2, None)

        # Keyboard config
        self.frame = tk.Frame(self.root, width=w, height=h)
        self.frame.bind("<KeyPress>", self.key_pressed)
        self.frame.bind("<KeyRelease>", self.key_released)
        self.frame.focus_set()
        self.frame.pack()
        self.pressed = {}  #pressed key

        # Create canvas
        canvas = tk.Canvas(bg="black", width=self.WIDTH, height=self.HEIGHT)
        canvas.place(x=0, y=0)

        # Array of field
        self.field = FIELD(w, h, mag)

        # Create instance
        self.player = [PLAYER(i) for i in range(4)]
        self.turn = 0

        self.start_menu()
Exemple #2
0
 def __init__(self):
     init()
     self.n = 0
     self.balls = []
     self.player = PLAYER()
     self.target = TARGET()
     self.target.new()
     display.set_caption('Ball Game')
     self.clock = time.Clock()
     self.Font = font.SysFont("arial", 40)
Exemple #3
0
def start():
    global now_turn
    get_data = request.args.to_dict()
    name = get_data.get('name')
    ip = get_data.get('ip')
    print(name)
    player = PLAYER(name, ip)
    dict = start_give(black, white)
    for j in dict:
        player.Hand.append(j)
    players.append(player)
    now_turn = name
    #print(now_turn)
    return 'good luck'
Exemple #4
0
 def reset(self):
     self.n = 0
     self.balls = []
     self.player = PLAYER()