浏览代码

MAJ

chapitre-1-start
gaetanv 3 年前
父节点
当前提交
a08aac1b04
共有 1 个文件被更改,包括 44 次插入0 次删除
  1. +44
    -0
      bird.py

+ 44
- 0
bird.py 查看文件

@@ -0,0 +1,44 @@
import pgzrun
# Le corps du programme devrait se trouver ici...
TITLE = "Paf l'oiseau"
WIDTH = 400
HEIGHT = 700

titi = Actor('bird1', (75, 350))
tutu = Actor ('bird2', ( 300, 20))
top = Actor('top', (300, -150))
bottom = Actor ('bottom', (300, 800))

def draw():
screen.blit('background', (0, 0))
titi.draw()
tutu.draw()
top.draw()
bottom.draw()
def on_mouse_down(pos):
print( pos, 'est la position lors du clic gauche')
titi.speed = 0
tutu.speed = 0

def on_mouse_up (pos):
print( pos, 'est la position lors du clic droit')
titi.speed = 1
tutu.speed = 1
def update():
titi.x += titi.speed
tutu.y += tutu.speed




def update():
titi.x += titi.speed
tutu.y += tutu.speed
titi.speed = 1
tutu.speed = 2
pgzrun.go()

正在加载...
取消
保存