5.4 화면에 파이프(오브젝트) 나타내기와 움직이기
TITLE = 'Flappy Bird'
WIDTH = 400
HEIGHT = 708
GRAVITY = 0.3
drop_speed = 0
# Actor 객체들
flappy_bird = Actor('bird1', (75, 350))
top_pipe = Actor('top', (350,0))
bottom_pipe = Actor('bottom', (350, 500))
def draw():
screen.blit('background', (0, 0))
flappy_bird.draw()
top_pipe.draw()
bottom_pipe.draw()
def update():
global drop_speed
drop_speed += GRAVITY
flappy_bird.y += drop_speed
def on_mouse_down():
global drop_speed
drop_speed = -6.5
Last updated