- [x] Game Over quand on tombe

This commit is contained in:
xdrm-brackets 2016-03-16 14:36:46 +01:00
parent 2ff038998b
commit 68d965e810
9 changed files with 388 additions and 375 deletions

View File

@ -290,344 +290,45 @@ Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from left
Grass collided with Mario from right
bottom
Grass collided with Mario from left
Grass collided with Mario from right
bottom
Grass collided with Mario from left
Grass collided with Mario from right
bottom
Grass collided with Mario from left
Grass collided with Mario from right
bottom
Grass collided with Mario from left
Grass collided with Mario from right
bottom
Grass collided with Mario from left
Grass collided with Mario from right
bottom
Grass collided with Mario from left
Grass collided with Mario from right
bottom
Grass collided with Mario from left
Grass collided with Mario from right
bottom
Grass collided with Mario from left
Grass collided with Mario from right
bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from left
Grass collided with Mario from right
bottom
Grass collided with Mario from left
Grass collided with Mario from right
bottom
Grass collided with Mario from left
Grass collided with Mario from right
bottom
Grass collided with Mario from left
Grass collided with Mario from right
bottom
Grass collided with Mario from left
Grass collided with Mario from right
bottom
Grass collided with Mario from left
Grass collided with Mario from right
bottom
Grass collided with Mario from left
Grass collided with Mario from right
bottom
Grass collided with Mario from left
Grass collided with Mario from right
bottom
Grass collided with Mario from left
Grass collided with Mario from right
bottom
Grass collided with Mario from left
Grass collided with Mario from right
bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
@ -656,52 +357,24 @@ Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
@ -750,8 +423,17 @@ Grass collided with Mario from right
bottom
Grass collided with Mario from right
bottom
Grass collided with Mario from right
bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from right
bottom
Grass collided with Mario from right
bottom
Grass collided with Mario from right
bottom
Grass collided with Mario from right
@ -857,7 +539,6 @@ Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
green-shell collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
@ -959,3 +640,301 @@ Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
green-shell collided with Mario from left
green-shell collided with Mario from left
green-shell collided with Mario from left
green-shell collided with Mario from left
green-shell collided with Mario from left
Grass collided with Mario from bottom
green-shell collided with Mario from left
green-shell collided with Mario from left
green-shell collided with Mario from left
green-shell collided with Mario from left
green-shell collided with Mario from left
green-shell collided with Mario from left
green-shell collided with Mario from left
green-shell collided with Mario from left
Grass collided with Mario from bottom
green-shell collided with Mario from left
Grass collided with Mario from bottom
green-shell collided with Mario from left
Grass collided with Mario from bottom
Grass collided with Mario from bottom
green-shell collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from left
bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
Grass collided with Mario from bottom
mario collide with WINDOW
mario collide with WINDOW
mario collide with WINDOW
mario collide with WINDOW
mario collide with WINDOW
mario collide with WINDOW
mario collide with WINDOW
mario collide with WINDOW
mario collide with WINDOW
mario collide with WINDOW
mario collide with WINDOW
mario collide with WINDOW
mario collide with WINDOW
mario collide with WINDOW
mario collide with WINDOW
mario collide with WINDOW

BIN
SDL#4/exe

Binary file not shown.

View File

@ -2,7 +2,6 @@
// On cree un sdl-toplevel statique
static xManager *mgr = NULL;
static bool running = true;
static xMarioMario *mario = NULL;
@ -90,7 +89,7 @@ int main(int argc, char* argv[]) {
/* [n-1] Boucle infinie
/* [n-2] Boucle infinie
=========================================================*/
// Gestion des evenements
@ -110,7 +109,8 @@ int main(int argc, char* argv[]) {
// Boucle de traitement
mgr->update();
mgr->manageFps(FPS);
while(running){
mgr->state = 0;
while(mgr->state==0){
// Gestion des evenements
@ -150,7 +150,16 @@ int main(int argc, char* argv[]) {
}
/* [n-1] Gestion de l'arret
=========================================================*/
if( mgr->state == 2 ){
mgr->clearAll(); // On vire tout
mgr->setBackground(0, 0, 0); // Fond noir
mgr->setImage("src/game_over.jpg"); // Image GAME OVER
mgr->update(); // Mise a jour du rendu
sleep(3); // Attente 3 sec
}
@ -177,7 +186,7 @@ int main(int argc, char* argv[]) {
*/
void quitEventHandler(SDL_Event *e){
cout << "Exiting program" << endl;
running = false;
mgr->state = 1;
}

Binary file not shown.

BIN
SDL#4/src/game_over.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 KiB

View File

@ -1,15 +1,15 @@
A FAIRE
=======
- [ ] Erreur accrochage quand saut sur un coin
- [ ] Verifier toute la trajectoire pour move()
- [x][ ] Gestion du saut unique ou double (limitation)
EN COURS
========
- [...] Gestion sprites de mario en fonction mouvement
- [ ] Erreur accrochage quand saut sur un coin
FAIT
====
- [x] Game Over quand on tombe
- [x] Gestion des briques cassables quand collision
- [?] Liberation memoire car lag
- [x] Gestion du nombre de saut avant de casser Brick ou MysteryBloc

View File

@ -57,6 +57,12 @@ void xMarioMario::moveFromVelocity(){
after = this->move(_velocity[0], _velocity[1]);
if( _velocity[0] != after[2] )
cout << "col. on X : " << _velocity[0] << endl;
if( _velocity[1] != after[3] )
cout << "col. on Y : " << _velocity[1] << endl;
/* (2) On modifie la velocite en fonction des collisions */
_velocity[0] = (double) after[2];
_velocity[1] = (double) after[3];
@ -93,8 +99,6 @@ void xMarioMario::moveFromVelocity(){
// TROUBLE
if( !this->onFloor() )
_velocity[1] += _gravity;
cout << "ON FLOOR: " << this->onFloor() << endl;
// TROUBLE
// TROUBLE
// TROUBLE

View File

@ -242,7 +242,11 @@ bool xManager::hit(xSprite* current, int movex, int movey){
|| (a.x+a.w > _winrect.x+_winrect.w ) // Inclus a gauche
|| (a.y < _winrect.y ) // Inclus en haut
|| (a.y+a.h > _winrect.y+_winrect.h ) // Inclus en bas
){
){
// Si on tombe, on meurt
if( a.y+a.h > _winrect.y+_winrect.h )
state = 2;
cerr << _indexes[xIndex] << " collide with WINDOW" << endl;
_mutex_hit.unlock();
return true;
@ -393,6 +397,16 @@ void xManager::pull(xSprite* sprite){
/* [CLEARALL] Supprime toutes les sprites
=========================================================*/
void xManager::clearAll(){
_indexes.erase( _indexes.begin(), _indexes.end() );
_sprites.erase( _sprites.begin(), _sprites.end() );
}
/* [MANAGEFTP] Gestion de la vitesse de boucle
=========================================================*/

View File

@ -22,6 +22,7 @@
void push(string index, xSprite* sprite);
void pull(string index);
void pull(xSprite *sprite);
void clearAll(); // Supprime toutes les sprites
void update();
@ -33,6 +34,14 @@
void manageEvents(SDL_Event* event);
// Boucle infinie
int state;
// 0 -> Boucle infinie
// 1 -> Arret jeu
// 2 -> mort
// DEBUG
void debug();
@ -65,8 +74,6 @@
mutex _mutex_pull;
mutex _mutex_update;
mutex _mutex_hit;
// DEBUG
SDL_Rect _debug;