Code: Select all
# Make the ball chase Tux
if bx>=tx: bx=bx1
else: bx=bx+1
if by>=ty: by=by1
else: by=by+1
fx=fx4
if fx<=10:
fx=600; fy=random.randint(0,370)
# Collision Detection (Tux & Fish, Tux & Ball)
if fx<=tx+50 and fx>=tx and fy>=ty30
and fy<=ty+70:
toy.play(); fx=600;fy=random.randint(0,370); score +=1
if bx<=tx+40 and bx>=tx40
and by>=ty50
and by<=ty+60:
burp.play(); bx=600; by=15;
lives =
1; tx=280; ty=180Code: Select all
tx=280; ty=180; txd=0; tyd=0
bx=600; by=15
fx=600; fy=random.randint(0,370)
bkcol=[127,212,255]
lives=3; score=0; run = True;