gemaddlc.py

Created by frablock

Created on September 26, 2021

2.42 KB

Une adaptation de GeMa pour le jeu dokidoki_fast

Si vous voulez utiliser GeMa pour votre script, nous vous recommandons la version GeMaMIN


_C,_B,_A='Score : ','white','[OK]'
try:from os import *
except:print('Omega est requis')
from random import *;from kandinsky 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 rch(a):return choice(a)
def ra(a,b):return randint(a,b)
def i(a):return input(a)
def re(a,b):rename(a,b)
def ds(a,b,c):draw_string(a,b,c)
def gm_err():gm_w('#>_< - err','',1)
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 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):
 p('***GeMa - Vous avez gagné');gm_r();ds('Félicitations, vous avez gagné\nVous êtes vainqueur :\n'+str(win),0,80);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+choice(['_','-','(',')','@','O','D','{','}','#','%','&','=','[]','|',';','!','?','H','>','<','*',"'",'.','/'])
 return a
def tt(b,c,x=0,y=0):
 for i in range(len(b)):c+=b[i];ds(c,x,y);sl(0.05)
def gm_c(a,b,c,d,e,a5=0):
 while True:
  if keydown(1)and e>=1:return a
  if keydown(2)and e>=2:return b
  if keydown(0)and e>=3:return c
  if keydown(3)and e>=4:return d
  if keydown(4)and e>=5:return a5
def pu(a,x=106,y=75,w=106,h=75):fr(x,y,w,h,(0,0,0));fr(x+1,y+1,w-2,h-2,_B);ds(a,x+2,y+2);ds(_A,x+2,y+h-20);gm_c(1,1,1,1,5,1)
gm_s()

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.