Advertisement
Guest User

Menu

a guest
May 21st, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1. PImage backgroundf; //Variable de l’image de fond
  2. int MeilleurScore = 0; //Afficher le meilleure score dans le jeu effectué
  3. boolean Jeu = false; //La variable booléenne ne vaut pas 0
  4.  
  5. void setup() {
  6. backgroundf = loadImage("backgroundf.jpg"); //charge l'image de fond
  7. size(720, 541); //Taille de la fenêtre
  8.  
  9.  
  10. textAlign(CENTER, CENTER); //Aligne le texte au centre
  11. for (int x = 0; x < 13; x++) {
  12. for (int y = 0; y < 25; y++) {
  13. }
  14. }
  15. }
  16.  
  17. void keyPressed() {
  18. if (Jeu) {
  19. if (keyCode == 37) {
  20. for (int i = 0; i < 4; i++) {
  21. }
  22. }
  23. if (keyCode == 38) {
  24. }
  25. if (keyCode == 39) {
  26. boolean Arreter = false;
  27. for (int i = 0; i < 4; i++) {
  28. }
  29. }
  30. if (keyCode == 40) {
  31. }
  32. }
  33. }
  34.  
  35.  
  36. void draw() {
  37. image(backgroundf, 0,0); //dessine l’image de fond qui apparait en arrière plan
  38. textFont(createFont("Courier", 20)); //Police d’écriture
  39. noStroke();
  40. if (Jeu) {
  41. for (int x = 0; x < 10; x++) {
  42. for (int y = 0; y < 20; y++) {
  43. rect(x*15+25, y*15+25, 13, 13);
  44. }
  45. }
  46.  
  47. }
  48. for (int x = 0; x < 13; x++) {
  49. for (int y = 0; y < 25; y++) {
  50.  
  51. }
  52. }
  53. fill(0, 200);
  54. rect(0, 0, width, height);
  55. textFont(createFont("Courier", 40));
  56. fill(255);
  57. text("FLAPPY TELEPORTATION", width/2, 40);
  58. textFont(createFont("Courier", 30));
  59. text("Jouer", width/2, 140); //Width est la largeur, donc ici la largeur est divisée par deux
  60. text("Quitter", width/2, 210);
  61. textFont(createFont("Courier", 20));
  62. text("Votre Meilleur Score : "+MeilleurScore, width/2, 300);
  63. textFont(createFont("Courier", 25));
  64. text("Aide dans le Jeu :", width/2, 400);
  65. textFont(createFont("Courier", 12));
  66. text("Cliquez avec votre souris sur l'écran pour sauter, prenez les nombreux bonus et gagnez !", width/2, 450);
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement