Pygame Zeroでの矩形の移動方法
グローバル変数を使用する方法:import pgzrun WIDTH = 800 HEIGHT = 600 rect_x = 100 rect_y = 100 def update(): global rect_x, rect_y rect_x += 1 rect_y += 1 def draw(): screen.clear() screen.draw.rect((rect_x, rect_y, 50, 50), 'red') pgzrun.go()>>More