Advertisement
-AleX-

Projet "Papa"

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