소스 검색

Game(dash)

master
valdoucet 3 년 전
부모
커밋
647e5116b3
1개의 변경된 파일15개의 추가작업 그리고 13개의 파일을 삭제
  1. +15
    -13
      game/code.py

+ 15
- 13
game/code.py 파일 보기

@@ -8,10 +8,11 @@ tb = Actor("bottom", midtop=(490, 350))
th = Actor("top", midbottom=(490, 125))
didi = Actor("bird1", (245, 245))
end = 0
gravitée = 2
saut = -35
saut = -7
gravite = 0.2
frotement = 1
gamemod_speed = -3
flash = -30
dash = 0
espassement = 1

def draw():
@@ -21,7 +22,7 @@ def draw():
tb.draw()

def update():
global end
global end, saut, gamemod_speed, dash
if didi.y == 475 and end == 0:
print("--Game over--")
@@ -32,9 +33,9 @@ def update():
tb.x += gamemod_speed

if th.x <= 0:
tb.x = 490
tb.x = 490
tb.y = random.randrange(520,600)
th.x = 490
th.x = 490
th.y = random.randrange(-160, -40)

if didi.y <= 15:
@@ -45,18 +46,19 @@ def update():
end = 1

if didi.y < 475 and end == 0 :
didi.y += gravitée
didi.y += saut
saut += gravite
gamemod_speed += dash

if dash < 0 and end == 0:
dash += frotement

def on_mouse_down(button):
global saut, dash
if button == mouse.LEFT:
didi.y += saut
saut += -5
elif button == mouse.RIGHT:
th.x += flash
tb.x += flash
dash += -1



pgzrun.go()

불러오는 중...
취소
저장