KreeZe

jeu simpli

Nov 18th, 2019
147
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. """
  2. list_2[["l'Entrée","le Salon","la Salle a manger","la Salle de jeu","la Salle de reception","la Cuisine","la Chambre"],
  3. ["l'Entrée","le Salon","la Salle a manger","la Salle de jeu","la Salle de reception","la Cuisine","la Chambre"],
  4. ["vous avez avancé","vous avez été à gauche","vous avez reculé","vous avez été a droite","erreur","Au revoir"],
  5. ["Couteau","Chandelier","Clé anglaise","Matraque"],
  6. ["Revolver","Corde","Montre", "Appareil Photo","Ecouteur","Pendentifs"],
  7. ["le major-d'home","le policier","le cuisinier","le mécano"],
  8. ["Chandelier.png","Matraque.png","Couteau.png","clef.png"]
  9. ]
  10. """
  11.  
  12. #bibliothèque
  13. from random import*
  14.  
  15. #liste
  16. piece_direction = [ ["l'Entrée",[1,0,0,0]],
  17. ["le Salon",[4,2,0,3]],
  18. ["la Salle a manger",[5,2,2,1]],
  19. ["la Salle de jeu",[6,1,3,3]],
  20. ["la Salle de reception",[4,5,1,6]],
  21. ["la Cuisine",[5,5,2,4]],
  22. ["la Chambre",[6,4,3,6]]
  23. ]
  24.  
  25. indice_main_sec = [ ["Couteau","Chandelier","Clé anglaise","Matraque"],
  26. ["Revolver","Corde","Montre", "Appareil Photo","Ecouteur","Pendentifs"] ]
  27.  
  28. presence_list = ["l'Entrée","le Salon","la Salle a manger","la Salle de jeu","la Salle de reception","la Cuisine","la Chambre"]
  29.  
  30. #fonction choix random (sortie indice_I/II/III et presence_I/II/III)
  31. def indice(nombre,nombreROMAIN,numero):
  32. if nombre == 1 :
  33. nombre_indice = randint(0,3-numero)
  34. nombreROMAIN_indice = indice_main_sec[0][nombre_indice]
  35. return nombreROMAIN_indice
  36. else:
  37. nombre_indice = randint(0,5-numero)
  38. nombreROMAIN_indice = indice_main_sec[1][nombre_indice]
  39. del indice_main_sec[1][nombre_indice]
  40. return nombreROMAIN_indice
  41.  
  42. def presence(nombre,nombreROMAIN,numero):
  43. nombre_presence = randint(1,6-numero)
  44. nombreROMAIN_presence = presence_list[nombre_presence]
  45. del presence_list[nombre_presence]
  46. return nombreROMAIN_presence
  47.  
  48. def rect(numeroLETTRE,numeroCHIFFRE,x1,x2,y1,y2):
  49. numeroLETTRE_zone = pygame.Rect((x1, x2), (y1, y2))
  50. numeroCHIFFRE_rect_surf_ = pygame.Surface(numeroLETTRE_zone.size)
  51. numeroCHIFFRE_rect_surf.set_alpha(0)
  52.  
  53.  
  54. fenetre.blit(numeroCHIFFRE_rect_surf, numeroLETTRE_zone)
  55. pygame.display.flip()
  56.  
  57.  
  58. #fonction main (jeu)
  59. def main():
  60. suite = 0
  61. points_1 = 0
  62. points_2 = 0
  63. points_3 = 0
  64. position = 0
  65. continuer = 0
  66. emplacement = 0
  67. touche = ''
  68. #affectation indice et presence
  69. indice_I = indice(1,"I",0)
  70. indice_II = indice(2,"II",0)
  71. indice_III = indice(3,"III",1)
  72.  
  73. presence_I = presence(1,"I",0)
  74. presence_II = presence(2,"II",1)
  75. presence_III = presence(3,"III",2)
  76.  
  77. while continuer == 0:
  78. #detection touche
  79. touche = str(input("choix"))
  80.  
  81. #mechanisme de jeu
  82. if touche == "z":
  83. position = piece_direction[position][1][0]
  84. elif touche == "q":
  85. position = piece_direction[position][1][1]
  86. elif touche == "s":
  87. position = piece_direction[position][1][2]
  88. elif touche == "d":
  89. position = piece_direction[position][1][3]
  90. elif touche == "Q":
  91. continuer = 1
  92. emplacement = piece_direction[position][0]+".png"
  93. print("image de : "+emplacement)
  94.  
  95. #decouverte indice
  96. if piece_direction[position][0] == presence_I:
  97. print("image de : "+emplacement)
  98. print("vous avez trouvé un indice : "+indice_I)
  99. points_1=1
  100. if piece_direction[position][0] == presence_II:
  101. print("image de : "+emplacement)
  102. print("vous avez trouvé un indice : "+indice_II)
  103. points_2=1
  104. if piece_direction[position][0] == presence_III:
  105. print("image de : "+emplacement)
  106. print("vous avez trouvé un indice : "+indice_III)
  107. points_3=1
  108.  
  109. #fin 1ère phase
  110. if (points_1+points_2+points_3) == 3:
  111. print(points_1+points_2+points_3)
  112. continuer = 1
  113.  
  114. """
  115. pygame.time.delay(1000)
  116.  
  117. rect(premiere,1,100,100,250,300)
  118. rect(deuxieme,2,400,100,250,300)
  119. rect(troisieme,3,700,100,250,300)
  120. rect(quatrieme,4,1000,100,250,300)
  121. """
  122. while suite == 0:
  123. print()
  124.  
  125.  
  126.  
  127.  
  128. main()
RAW Paste Data