Ver código fonte

ok

Haut-Bas-souris-frein-accélération
Maurice 3 anos atrás
pai
commit
4b9f8e04de
2 arquivos alterados com 47 adições e 2 exclusões
  1. +0
    -2
      birdie.py
  2. +47
    -0
      birdie000.py

+ 0
- 2
birdie.py Ver arquivo

@@ -27,8 +27,6 @@ def draw():
titi = Actor ('bird1', (100,10)) titi = Actor ('bird1', (100,10))
titi.speed = 1 titi.speed = 1




pgzrun.go() pgzrun.go()





+ 47
- 0
birdie000.py Ver arquivo

@@ -0,0 +1,47 @@
import pgzrun

TITLE = "Paf l'oiseau"
WIDTH = 400
HEIGHT = 708

def on_mouse_down(button):
if button == mouse.LEFT:
print("freinage")
titi.speed -=1
elif button == mouse.RIGHT:
print ("Accélération")
titi.speed += 1

def update():
if titi.bottom > HEIGHT:
titi.top = 0
if titi.top <0:
titi.bottom = HEIGHT
if top.right > WIDTH:
top.left = 0
if top.left <0:
top.right = WIDTH
if top1.right > WIDTH:
top1.left = 0
if top1.left <0:
top1.right = WIDTH

titi.y += titi.speed
top.x += top.speed
top1.x += top1.speed

def draw():
screen.blit('background', (0, 0))
titi.draw()
top.draw()
top1.draw()
titi = Actor ('bird1', (200,50))
top = Actor ('top', (0,450) )
top1 = Actor ('top', (200,200))
titi.speed = 1
top.speed = 1
top1.speed = 1

pgzrun.go()



Carregando…
Cancelar
Salvar