瀏覽代碼

chap-2 maSolution

chap-2-maSolution
verkamerloic 3 年之前
父節點
當前提交
c2a7256d04
共有 1 個文件被更改,包括 13 次插入0 次删除
  1. +13
    -0
      birdie.py

+ 13
- 0
birdie.py 查看文件

@@ -10,12 +10,25 @@ def on_mouse_down():


def update(): def update():
titi.y += titi.speed titi.y += titi.speed
tube_inf.x -= vitesse_defilement
tube_supp.x -= vitesse_defilement
if tube_supp.right < 0 :
tube_supp.left= WIDTH


def draw(): def draw():
screen.blit('background', (0, 0)) screen.blit('background', (0, 0))
titi.draw() titi.draw()
tube_supp.draw()
tube_inf.draw()


titi = Actor('bird1', (75, 350)) titi = Actor('bird1', (75, 350))
titi.speed = 1 titi.speed = 1
ecart = 140
tube_supp = Actor("top",(300,0))
tube_inf = Actor("bottom",(300,tube_supp.height + ecart))

print(tube_supp.width,tube_supp.height)

vitesse_defilement = 1


pgzrun.go() pgzrun.go()

Loading…
取消
儲存