from math import * from kandinsky import * from ion import * from time import monotonic w,h=100,100 # view dimensions sw,sh=10,10 # street dimensions cw,ch=10,10 # cell dimensions ct=[ # cell types [0,0] ] cl=[None,(0,0,0),(1,1,1)] # colors c=[0]*(sw*sh) # cells bb=[None]*(w*h) # back buffer def rt(t,b,x,y): # render tile c=ct[t] for px in range(c[0]): for py in range(c[1],0,-1): pv = c[px+py*c[0]] if pv!=None: b[px+x+(py+y+ch)*w] = pv def ds(): # draw screen b=[None]*(w*h) for px in range(sw): for py in range(sh): rt(c[px+py*sw],b,px*cw,(py+1)*ch) b=bb s = monotonic() ds() draw_string(str(monotonic()-s),0,0) while not keydown(KEY_OK): pass