Bob -pygame


ygame
import time
# 1.初始化 loading 加載中
pygame.init()
# 2.設置一個窗口和大小  dis分開  分開玩 0展覽館 display展示zhanlan
screen = pygame.display.set_mode((500, 500))
# 3.設置一個遊戲名稱   caption標題
pygame.display.set_caption("test2")
ballx = 250
bally = 250
# 4.刷線頁面  up上 date日期 刷新,升級
while True:
    # 讓電腦來監控我們的操作:事件 event
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            pygame.quit()
    screen.fill((1,2,3))
    if ballx > 500:
        ballx = 0
    ballx = ballx + 1
    pygame.draw.circle(screen, (0,255,0),(ballx,bally),10)
    pygame.display.update()

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章