Version 0.9
from gemamin import *
Et voilà, vous avez accès à GeMa depuis votre script
Si vous voulez en savoir plus, allez voir notre documentation
Ce script a été créé dans un but, faciliter la création de jeu, et en particulier les visualnovels.
GeMa Engine peut lire et interpréter les fichiers sprites (.pikt ou .pik), et vous permettre de pouvoir bouger des sprites à votre guise En savoir plus
Partagez rapidement votre création sur notre site Partager votre script dès maintenant
_D,_C,_B,_A=(0,0,0),'Score : ','white','[OK]' try:from os import * except:print('err:Omega est requis http://discode.fr/gema/e?e=e_os') try:from ppn import * except:from kandinsky import * from random import *;from ion import *;from time import * def p(a):print(a) def fr(a,b,c,d,e):fill_rect(a,b,c,d,e) def kd(a):return keydown(a) def rch(a):return choice(a) def ra(a,b):return randint(a,b) num=(42,1),(43,2),(44,3),(36,4),(37,5),(38,6),(30,7),(31,8),(32,9),(48,0);alpha='a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',' ','?','!','.','_','-','' def keyboard(key=alpha,base='',v=1): B='num';A='alpha';fr(0,180,360,225,_B);sl(0.25);shi=0 if key==num:m=B else:m=A while True: for i in range(len(key)): if m==A: y=i if i+18>34:y=i-1 if i+18>40:y=i-2 if i+18>46:y=i-3 if kd(i+18): if shi==0:base+=str(key[y]) else:base+=str(key[y].upper()) if m==B and kd(key[i][0]):base+=str(key[i][1]);sl(0.25) if kd(12): if shi==0:shi=1 else:shi=0 sl(0.25) if kd(13): if m==A:keyboard(num,base) else:keyboard(alpha,base) if kd(17): try:lb=list(base);lb.pop();base='' except:tt('Texte vide','>') for s in range(len(lb)):base+=lb[s] sl(0.25) if kd(4)or kd(52):return base if v!=0:gm_w(base+' ','CLAVIER ('+m+', UPPER='+str(shi)+') ') def i(a='',b=0): try: if b==1:return keyboard() else:return input(a) except:return input(a) def re(a,b):rename(a,b) def ds(a,b,c,d=(0,0,0),e=_B):draw_string(a,b,c,d,e) def gm_err(a=""):pu("une erreur est survenue\n"+str(a));gm_r() def gm_i(im,pal,t=4,po=0,py=0): r,i=0,0 while r<len(im): s,n=im[r],'';r+=1 while r<len(im)and'9'>=im[r]>='0':n+=im[r];r+=1 nb=1 if n==''else int(n);c=pal[ord(s)-65] for j in range(nb):fr(po+t*(i%80),py+t*(i//80),t,t,(c[0],c[1],c[2]));i+=1 def pikt(im,pal,whp=(10,10,5,"0"),xy=(100,100)): for i in range(whp[0]*whp[1]): c=pal[int("0x"+im[i])] if im[i]!=whp[3]:fr(xy[0]+whp[2]*(i%whp[0]),xy[1]+whp[2]*(i//whp[0]),whp[2],whp[2],c) def pik_get(): lf,fl=listdir(),[] for j in lf: if ".pik" in j:fl.append(j) if fl==[]:pu("Fichier .PIK ou .PIKT\nintrouvable, mise en place du\nsprite par defaut") else: try:a=int(i(str(fl)+"\n(0,"+str(len(fl)-1)+")[autre=defaut]"));re(fl[a],"pik_open.py");from pik_open import *;re("pik_open.py",fl[a]) except:gm_err("input err") sl(1) a100="" for pi0 in range(100):a100+=str(ra(0,1)) class pik:p=(["pikt","0000000000000000110000000012000000001130011111140011111114001111111000111111100000300300000333333000",[(255,255,255),(62,39,35),(0,0,0),(255,112,67),(255,0,0)],(10,10)],["pikt",a100,[(180,180,180),(50,50,50)]]) def gm_pik(a,b=(10,10),x=0,y=0): if a[0]=="pik":gm_i(a[1],a[2]) else:pikt(a[1],a[2],b,(x,y)) def gm_tp(txt,ma=32,st=""): a,b,A,d=list(txt)+[''],'','\n'+st,[" ","'",",","."];l=len(a) if l>ma: mb=int(ma) for j in range(l//ma): nl=True for i in range(1,ma//4): if d.count(a[mb-i])>=1:a[mb-i]=A;mb+=mb-i;nl=False;break if nl:a.insert(mb,A);mb+=mb for i in range(l):b+=a[i] else:b=str(txt) return b,l//ma def gm_w(txt,perso="",rw=0):a=gm_tp(txt);ds(str(perso),0,180-a[1]*20);ds(str(a[0]),0,200-a[1]*20) def gm_t(txt,perso="",img=0,pal=0,a=4,b=0,c=0): if img==0:gm_w(txt,perso) else:gm_i(img,pal,a,b,c);gm_w(txt,perso) def gm_a(a,b,c,d,e,a5='#err:str?'): ds('[up]'+str(a),0,0) if e>=2:ds('[down]'+str(b),0,18) if e>=3:ds('[left]'+str(c),0,36) if e>=4:ds('[right]'+str(d),0,54) if e>=5:ds(_A+str(a5),0,72) def gm_wi(win="",sco=0): pu('Felicitations, vous avez gagne\n'+str(win));p(_C+str(sco)) if sco!=0:gm_sco(sco) def gm_r():fr(0,0,320,225,_B) def sl(a):sleep(a) def gm_s():co=[(0,0,0),_B];fr(0,0,320,255,co[0]);fr(130,70,60,60,co[1]);fr(140,80,50,40,co[0]);fr(180,100,10,30,co[1]);fr(180,100,-20,10,co[1]);ds('eMa',192,112);ds('Engine',130,132);sl(2.8);fr(0,0,320,255,'grey');sl(0.1);gm_r();ds(_A,0,0) def gm_sco(sco):ds(_C+str(sco),200,0) def tr(a=''): for i in range(32):a=a+rch(['_','-','(',')','@','O','D','{','}','#','%','&','=','[]','|',';','!','?','H','>','<','*',"'",'.','/']) return a def tt(b,c,x=0,y=0): for i in b:c+=i;ds(c,x,y);sl(0.05) def gm_c(a,b,c,d,e,a5=0): while True: if kd(1)and e>=1:return a if kd(2)and e>=2:return b if kd(0)and e>=3:return c if kd(3)and e>=4:return d if kd(4)and e>=5:return a5 def pu(a,c=_B,x=10,y=75,w=300,h=75):fr(x,y,w,h,(0,0,0));fr(x+1,y+1,w-2,h-2,c);ds(gm_tp(a,31," ")[0],x+2,y+2,_D,c);ds(_A,x+2,y+h-20,_D,c);gm_c(1,1,1,1,5,1);sl(0.5) gm_s()#v0.9