vi.py

Created by frablock

Created on February 19, 2021

3.44 KB

Un test de création de jeu avec GeMa (https://workshop.numworks.com/python/frablock/gema)


from gema import *
#on definit les images (attention,cette partie prends de la place(3ko environ))
pal=[[65, 27, 73], [78, 38, 81], [83, 51, 91], [59, 46, 87], [64, 36, 78], [48, 36, 78], [91, 49, 89], [74, 56, 95], [97, 62, 99], [103, 60, 96], [88, 65, 101], [37, 25, 67], [116, 75, 107], [108, 80, 112], [52, 15, 61], [44, 20, 64]]
im="AB3AB19C17D5E4D4F2DF6D17A3B15G10C12ED8E3F2D2F6D5H4D9A3B14G7IGI4C13D2H2D5ED12H12D3A3B13G3JG4I11K2C8H6D11H3KH11D3A3B9G5J7I2JI15C4H29DHD3AB11G4J11I2GI14KC3KC2K3H19D7AB7G7J11I2ABI15K13H14LD7B8G5J11IJ2IAEGIMI11K13H11FD11B6G4J6M2J4M4JMEABM3INI3NI2KIK10H15D11B4G7J4M12CA2BMNMN11K13H9D13B3G5J6M12BA3EIN14KIN2KI2KIK5H7D11F2G5J9M11GCA2E2I2N12K13H8D11F3G4J10M10GJ2BA2G2CIN14K3H2K5H8D8F6G6J9M9AJG2A2GIECIN11K10H10D8F6G4J2GJ8M8BAIB2ABGIE2CIN17K5H9D7F6G3JG2J10M7A2JBAEGBGE2C2N12MN4K6HKH8D3F8G3JG3J11M4CA2IBAB2E4C2IN17K5H9D7F5G6J12M4A3CGAE3AE3C2IN14KNK3HKH8D8FDFDFG5JGJ9MJM4AEA2GAE2BE3BC2I2N15K4H7DHD9F4G6J9M7AEBAIA2CNCE3BC2I2N15K4HKH8D8F3G7J8M7ABA2JGBEN2E4C3I4N13K6H8D10G8J8M6ABEAIBG2NMNE4C4K2CN12K5H12D7G10J10M2ABE2GABIMN3E3BC6HN10K4H10D9F2B3G9J9IA2E2GAEGM2N3CE2BC6DKN2K9H9D8F5B6G10J6BEBEBAEBIMIK2NKE2BEC3DE2K8H6D18FAB8G7J6B3ABE2BGINK5E10HK3H8D13F7ABA3B6G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AP11L6EKDH3D5F8L5O30AOA4O3EP10L7DFLFHD4F9L5O33AO4P12L8ED2HD4F8L6O32AO6P10L6E3F2HD4F9L6O38P12L8FL2D4F8L7O31AO2PO3P13L6PL4D2F9L7O38P13L6FH2F2LFDF8"
def choix(c):
  if c==1:
    gm_save("vi","1")#sauvegarde, ici "1" est sauvegarde dans le fichier "vi"
    gm_txt("Vous pouvez tout faire","frablock",im,pal)  
    gm_act("par exemple ?","affiche une erreur !!!",0,0,2)
    choix(gm_clic(3,"a",0,0,2))
  elif c==2:
    #txt min
    gm_write("triste              ","Jeu          ")
    sleep(3)
    gm_gameover("Pop, tu dois essayer de gagner",0)
  elif c==3:
      gm_txt("Affichage images et optimisation","frablock",im,pal)
      gm_act("Affiche ma victoire","je peux perdre ?",0,0,2)
      choix(gm_clic(4,5,0,0,2))
  elif c==4:
    gm_win("Fin normale",0)
  elif c==5:
    gm_gameover("Mourrez!!!",0)
  else:
    print(c)
    gm_error()
#debut load
try:
  if int(gm_load_c())==1:
    choix(int(gm_load("vi")))
  else:
    gm_txt("Bienvenue sur le jeu de test","personnage",im,pal)
    gm_act("en savoir plus","non",0,0,2)
    choix(gm_clic(1,2,0,0,2))
except :
  print("Une erreur est survenue -  sa")
  #intro
  gm_txt("Bienvenue sur le jeu de test","personnage",im,pal)
  gm_act("en savoir plus","non",0,0,2)
  choix(gm_clic(1,2,0,0,2))
  #fin load

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.