Guest User

Untitled

a guest
Oct 21st, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 4.27 KB | None | 0 0
  1. #include <libge/libge.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <time.h>
  5.  
  6. PSP_MODULE_INFO("Projet Papa", 0, 0, 0);
  7. PSP_HEAP_SIZE_KB(512);
  8.  
  9. //Variables\\
  10. int selecteur = 1, maxselecteur = 12;
  11.  
  12. // Déclarations des resources en global
  13. ge_Font *police;
  14. ge_Image* Back_Ingame;
  15. ge_Image* Back_Marcher;
  16. ge_Image* Back_Ville;
  17. ge_Image* Cadre_Selection;
  18.  
  19. //Fonctions\\
  20. void Aleatoire_Plus(int *Modif);
  21. void Aleatoire_Moins(int *Modif);
  22. void Menu();
  23.  
  24.  
  25. int main(int argc, char *argv[])
  26. {
  27. geInit();
  28.  
  29. // Chargement des resources globales
  30. police = geLoadFont("Arial.ttf");
  31. Back_Ingame = geLoadImage("package.pkg/Ingame.png"); // lors du jeux
  32. Back_Marcher = geLoadImage("package.pkg/Marcher.png"); // lors des achats
  33. Back_Ville = geLoadImage("package.pkg/Ville.png"); // lors des deplacements
  34. Cadre_Selection = geLoadImage("package.pkg/Cadre.png"); // pour selectionner action
  35. ge_Keys *pad = geCreateKeys(), *oldpad = geCreateKeys();
  36. geFontSize(police, 16);
  37.  
  38.  
  39. while (1)
  40. {
  41. geClearScreen(); // Pour effacer l'ecran
  42. geReadKeys(pad); // Pour activer le pad
  43.  
  44.  
  45. Intro(); // fonction deja prete dans mon pc
  46.  
  47. geFontPrintScreen(50, 50, police, "Le jeux commence ici! :) Crazy!");
  48.  
  49. Menu(); // Jouer
  50.  
  51.  
  52. geReadKeys(oldpad);
  53. geSwapBuffers();
  54.     sceKernelExitGame();
  55.     return 0;
  56. }
  57.  
  58. void Menu()
  59. {
  60. geClearScreen(); // Pour effacer l'ecran
  61. geReadKeys(pad); // Pour activer le pad
  62.  
  63. // Menu de Debut \\
  64.  
  65. if(pad->pressed[GEK_DOWN] && !oldpad->pressed[GEK_DOWN])
  66. {
  67.     selecteur++;
  68. }
  69. if(pad->pressed[GEK_UP] && !oldpad->pressed[GEK_UP])
  70. {
  71.     selecteur--;
  72. }
  73. if (selecteur > maxselecteur)
  74. {
  75.     selecteur = 1;
  76. }
  77. else if (selecteur < 1)
  78. {
  79.     selecteur = maxselecteur;
  80. }
  81.  
  82. if (selecteur == 1) {
  83.     geDrawImage(x,y,Cadre_Selection);
  84. }
  85. if (selecteur == 2){
  86.     geDrawImage(x,y,Cadre_Selection);
  87. }
  88. if (selecteur == 3){
  89.     geDrawImage(x,y,Cadre_Selection);
  90. }
  91. if (selecteur == 4){
  92.     geDrawImage(x,y,Cadre_Selection);
  93. }
  94. if (selecteur == 5){
  95.     geDrawImage(x,y,Cadre_Selection);
  96. }
  97. if (selecteur == 6){
  98.     geDrawImage(x,y,Cadre_Selection);
  99. }
  100. if (selecteur == 7){
  101.     geDrawImage(x,y,Cadre_Selection);
  102. }
  103. if (selecteur == 8){
  104.     geDrawImage(x,y,Cadre_Selection);
  105. }
  106. if (selecteur == 9){
  107.     geDrawImage(x,y,Cadre_Selection);
  108. }
  109. if (selecteur == 10){
  110.     geDrawImage(x,y,Cadre_Selection);
  111. }
  112. if (selecteur == 11){
  113.     geDrawImage(x,y,Cadre_Selection);
  114. }
  115. if (selecteur == 12){
  116.     geDrawImage(x,y,Cadre_Selection);
  117. }
  118.  
  119. if(pad->pressed[GEK_CROSS] && !oldpad->pressed[GEK_CROSS] && selecteur == 1)]
  120.  
  121. }//Fa
  122.  
  123. if(pad->pressed[GEK_CROSS] && !oldpad->pressed[GEK_CROSS] && selecteur == 2){
  124.  
  125. }//So
  126.  
  127. if(pad->pressed[GEK_CROSS] && !oldpad->pressed[GEK_CROSS] && selecteur == 3)]
  128.  
  129. }//Jo
  130.  
  131. if(pad->pressed[GEK_CROSS] && !oldpad->pressed[GEK_CROSS] && selecteur == 4){
  132.  
  133. }//Fr
  134.  
  135. if(pad->pressed[GEK_CROSS] && !oldpad->pressed[GEK_CROSS] && selecteur == 5)]
  136.  
  137. }//Bi
  138.  
  139. if(pad->pressed[GEK_CROSS] && !oldpad->pressed[GEK_CROSS] && selecteur == 6){
  140.  
  141. }//Mar
  142.  
  143. if(pad->pressed[GEK_CROSS] && !oldpad->pressed[GEK_CROSS] && selecteur == 7)]
  144.  
  145. }//
  146.  
  147. if(pad->pressed[GEK_CROSS] && !oldpad->pressed[GEK_CROSS] && selecteur == 8){
  148.  
  149. }
  150.  
  151. if(pad->pressed[GEK_CROSS] && !oldpad->pressed[GEK_CROSS] && selecteur == 9)]
  152.  
  153. }
  154.  
  155. if(pad->pressed[GEK_CROSS] && !oldpad->pressed[GEK_CROSS] && selecteur == 10){
  156.  
  157. }
  158.  
  159. if(pad->pressed[GEK_CROSS] && !oldpad->pressed[GEK_CROSS] && selecteur == 11)]
  160.  
  161. }
  162.  
  163. if(pad->pressed[GEK_CROSS] && !oldpad->pressed[GEK_CROSS] && selecteur == 12){
  164.  
  165. }
  166.  
  167. geReadKeys(oldpad);
  168. geSwapBuffers();
  169. }
  170.  
  171.  
  172. void Aleatoire_Plus(int *Modif) // Pour rajouter de l'affect etc...
  173. {
  174.     Int Aleatoire = 0;
  175.     srand(time(NULL));
  176.     Aleatoire = rand()%50;
  177.     if(Aleatoire == 33) *Modif --;
  178. }
  179.  
  180.  
  181. void Aleatoire_Moins(int *Modif) //Pour enlever de l'affect etc...
  182. {
  183.    Int Aleatoire = 0;
  184.    srand(time(NULL));
  185.    Aleatoire = rand()%30;
  186.    if(Aleatoire == 17) *Modif ++;
  187. }
  188.  
  189.  
  190.  
  191. //MAKEFILE\\
  192. /*
  193. TARGET = LibGE
  194. OBJS = main.o
  195.  
  196. CFLAGS = -O2 -G0 -Wall -DPSPFW3xx
  197. CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
  198. ASFLAGS = $(CFLAGS)
  199.  
  200. LIBS = -lge -lfreetype -lpspmp3 -lm
  201.  
  202. EXTRA_TARGETS = EBOOT.PBP
  203. PSP_EBOOT_TITLE = Menu Titotuto
  204.  
  205. PSPSDK=$(shell psp-config --pspsdk-path)
  206. include $(PSPSDK)/lib/build.mak
  207. /*
Add Comment
Please, Sign In to add comment