from kandinsky import * from random import * from ion import * d=1 e=False s=True g=True x=0 y=0 a=320 b=145 ciel=(200,200,255) fill_rect(0,0,400,400,ciel) fill_rect(0,200,400,400,(0,255,0)) while g: fill_rect(a,b,30,10,(255,200,200)) fill_rect(x,y,40,40,(255,0,0)) if keydown(KEY_UP) and s!=False: y-=2 fill_rect(x,y+40,40,2,ciel) if keydown(KEY_LEFT) and x>0: x-=1 fill_rect(x+40,y,1,40,ciel) if keydown(KEY_RIGHT) and x<280: fill_rect(x,y,40,40,ciel) x+=1 if y <= 160: fill_rect(x,y,40,1,ciel) y+=1 else: s=True if y<50: s=False a-=d fill_rect(a+30,b,1,10,ciel) if a<-50: a=320 if e: fill_rect(0,0,400,400,(0,0,0)) while e: draw_string("GAME OVER",120,100,(255,0,0),(0,0,0))