diff --git a/IMACMan/include/Board.h b/IMACMan/include/Board.h index 5d9044c..43d619d 100644 --- a/IMACMan/include/Board.h +++ b/IMACMan/include/Board.h @@ -42,5 +42,5 @@ class Board { void displayLives(Pacman *p); }; -Board* Board::board = nullptr; +//Board* Board::board = nullptr; #endif //IMACGL_BOARD_H diff --git a/IMACMan/include/Pacman.h b/IMACMan/include/Pacman.h index fc27b97..4c0da6d 100644 --- a/IMACMan/include/Pacman.h +++ b/IMACMan/include/Pacman.h @@ -42,5 +42,6 @@ class Pacman : public Personnage{ }; -Pacman* Pacman::pacman = nullptr; +//Pacman* Pacman::pacman = nullptr; + #endif //IMACGL_PACMAN_H diff --git a/IMACMan/src/Board.cpp b/IMACMan/src/Board.cpp index d22ec5c..676e008 100644 --- a/IMACMan/src/Board.cpp +++ b/IMACMan/src/Board.cpp @@ -46,7 +46,7 @@ int Board::getTime() const { return time; } -static Board* Board::getInstBoard(){ + Board* Board::getInstBoard(){ if (!board) board = new Board(9,500); return board; diff --git a/IMACMan/src/Pacman.cpp b/IMACMan/src/Pacman.cpp index 383fa96..bab7dc3 100644 --- a/IMACMan/src/Pacman.cpp +++ b/IMACMan/src/Pacman.cpp @@ -91,7 +91,7 @@ int Pacman::getPoints(){ } Pacman *Pacman::getInstPac() { - if(!pacman){ + if(!pacman){ pacman = new Pacman(); } return pacman; @@ -124,6 +124,13 @@ int Pacman::keyPressed(glimac::SDLWindowManager windowManager) { if(windowManager.isKeyPressed(SDLK_LEFT)){ return 4; } + + if(windowManager.isKeyPressed(SDLK_p)){ + std::cout << "Pause" << std::endl; + getchar(); + } + + return 0; }