SAE11_2023/snake/ecran_lancement.c

94 lines
1.3 KiB
C
Raw Normal View History

2023-12-19 11:49:49 +01:00
/* Fonction qui affiche l'écran principale du jeu
Written by Yann KERAUDREN and Titouan LERICHE */
#include <stdlib.h>
#include <stdio.h>
#include "ecran_lancement.h"
2023-12-20 00:09:59 +01:00
unsigned char ecran_lancement(void) {
2023-12-19 11:49:49 +01:00
couleur grey, green, yellow, red;
grey = CouleurParComposante(50,205,50);
ChoisirCouleurDessin(grey);
RemplirRectangle(0,0,1450,840);
yellow = CouleurParComposante(255,255,0);
ChoisirCouleurDessin(yellow);
RemplirRectangle(100,100,1200,6);
RemplirRectangle(1300,100,6,220);
RemplirRectangle(90,320,1216,6);
RemplirRectangle(90,320,6,165);
RemplirRectangle(90,485,200,6);
RemplirRectangle(250,465,50,46);
DessinerSegment(300, 470, 380, 440);
DessinerSegment(300, 469, 380, 439);
DessinerSegment(300, 468, 380, 438);
DessinerSegment(300, 467, 380, 437);
DessinerSegment(300, 507, 380, 537);
DessinerSegment(300, 506, 380, 536);
DessinerSegment(300, 505, 380, 535);
DessinerSegment(300, 504, 380, 534);
2023-12-19 12:01:49 +01:00
2023-12-19 11:49:49 +01:00
EcrireTexte(700,200, "SNAKE", 2);
red = CouleurParComposante(255,0,0);
ChoisirCouleurDessin(red);
EcrireTexte(400,500, "space = play", 2);
EcrireTexte(1000,500, "echap = quit", 2);
if (Touche() == XK_space ) {
2023-12-20 00:09:59 +01:00
return 1 ;
2023-12-19 11:49:49 +01:00
}
if (Touche() == XK_Escape) {
2023-12-20 00:09:59 +01:00
return 0 ;
2023-12-19 11:49:49 +01:00
}
}