from math import * from kandinsky import * from ion import * #from os import * from time import * from random import * lib="" def drawTab(tab,offsetx,offsety,selected=None,width=61,height=17): try: lib.draw() except: fill_rect(0,0,320,222,(255,255,255)) j=-1 for j in range(len(tab)): player=tab[j] draw_string((player[0]+" "*100)[0:int(width/10)],130+(j-offsetx)*width+1,-1,(255,255,255),(100,100,100)) fill_rect(130+(j-offsetx)*width,0,1,222,(0,0,0)) fill_rect(130+(j-offsetx)*width+width,0,1,222,(0,0,0)) if offsety+10.2: key=[] tick=monotonic() try: lib.main() except: pass try: lib.move() except: x=p["x"] y=p["y"] s=p["s"] w=p["w"] if KEY_RIGHT in key: x+=1 if KEY_LEFT in key: x-=1 if p["x"]!=len(scores): if KEY_DOWN in key: s+=1 if KEY_UP in key: s-=1 if KEY_PLUS in key: w+=10 if KEY_MINUS in key: w-=10 if KEY_ANS in key: w=61 if x<0: x=len(scores) if x>len(scores): x=0 if x!=len(scores): if s<1: s=len(scores[x])-1 if s>len(scores[x])-1: s=1 if s-y<1: while s-y<1: y-=1 if s-y>11: while s-y>11: y+=1 if y<0: y=0 if w<21: w=21 p={"x":x,"y":y,"s":s,"w":w} if KEY_OK in key: try: lib.edit() except: if p["x"]==len(scores): e() v=input("Joueur "+str(len(scores)+1)+" > ") if v: scores.append([v,0]) else: e() v=input("Modifier valeur > ") if v: scores[p['x']][p['s']]=int(v) if KEY_VAR in key: try: lib.add() except: if p["x"]!=len(scores): e() v=input("Ajouter valeur > ") if v: scores[p['x']].append(int(v)) if KEY_BACKSPACE in key: try: lib.rem() except: if p["x"]!=len(scores): e() v=input("Supprimer valeur ? > ") if v: scores[x].pop(p['s']) p['s']=1 if not len(scores[p['x']])-1: scores.pop(p['x']) if KEY_TOOLBOX in key: e() v=input("Nom du mod > ") if v: try: scores=[] p['x']=0 p['y']=0 p['s']=1 lib=__import__(v) except: print("Impossible de charger le mod") sleep(1) if key: drawTab(scores,p['x'],p['y'],p['s'],p['w'])