Skip to content

Commit

Permalink
Improved map and start all phases with no fuel in jetpack
Browse files Browse the repository at this point in the history
  • Loading branch information
ivansansao committed May 22, 2023
1 parent 9520198 commit 3b09c03
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 23 deletions.
9 changes: 5 additions & 4 deletions src/model/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ void Game::win() {
text_gamewin.setFont(font_roboto);
text_gamewin.setCharacterSize(16);
text_gamewin.setFillColor(sf::Color::White);
text_gamewin.setString(L"ESC - Voltar ao menu");
text_gamewin.setString(L"V - Voltar ao menu");
text_gamewin.setPosition(sf::Vector2f(600 - text_gamewin.getGlobalBounds().width / 2, window.getSize().y / 2 - text_gamewin.getGlobalBounds().height / 2 + 120));
window.draw(text_gamewin);

Expand All @@ -228,7 +228,7 @@ void Game::win() {

window.display();

if (sf::Keyboard::isKeyPressed(sf::Keyboard::Escape)) {
if (sf::Keyboard::isKeyPressed(sf::Keyboard::V)) {
gamewin_loaded = false;
sounds.music_gamewin.stop();
game_loaded = false;
Expand Down Expand Up @@ -262,13 +262,13 @@ void Game::over() {
text_gameover.setFont(font_roboto);
text_gameover.setCharacterSize(16);
text_gameover.setFillColor(sf::Color::White);
text_gameover.setString(L"ESC - Voltar ao menu");
text_gameover.setString(L"V - Voltar ao menu");
text_gameover.setPosition(sf::Vector2f(600 - text_gameover.getGlobalBounds().width / 2, window.getSize().y / 2 - text_gameover.getGlobalBounds().height / 2 + 120));
window.draw(text_gameover);

window.display();

if (sf::Keyboard::isKeyPressed(sf::Keyboard::Escape)) {
if (sf::Keyboard::isKeyPressed(sf::Keyboard::V)) {
gameover_loaded = false;
sounds.music_gameover.stop();
game_loaded = false;
Expand Down Expand Up @@ -320,6 +320,7 @@ void Game::load_phase() {
// dariu.score.bananas = 0;
dariu.score.thophy = 0;
dariu.jetPack = false;
dariu.jetPackFuel = 0;

// Read quantity of bananas from tilemap.
dariu.score.bananas_total = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/model/tilemap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ bool Tilemap::free_path(int i, int j) {
}
bool Tilemap::free_path_bullet(int i, int j) {
if (this->is_valid(i, j)) {
return this->map[i][j] == ' ' || this->map[i][j] == '@' || this->map[i][j] == '^' || this->map[i][j] == 'V' || this->map[i][j] == '>' || this->map[i][j] == '<' || this->map[i][j] == 'M' || this->map[i][j] == 'P' || this->map[i][j] == 'Q' || this->map[i][j] == 'Z' || this->map[i][j] == 'k' || this->map[i][j] == 'g' || this->map[i][j] == 'x' || this->map[i][j] == 'j' || this->map[i][j] == 'Y' || this->map[i][j] == '.' || this->map[i][j] == 'T' || this->map[i][j] == '0' || this->map[i][j] == '1' || this->map[i][j] == '2' || this->map[i][j] == '3' || this->map[i][j] == '4' || this->map[i][j] == '5' || this->map[i][j] == '6' || this->map[i][j] == '7' || this->map[i][j] == '8' || this->map[i][j] == '9';
return this->map[i][j] == ' ' || this->map[i][j] == '@' || this->map[i][j] == '^' || this->map[i][j] == 'V' || this->map[i][j] == '>' || this->map[i][j] == '<' || this->map[i][j] == 'M' || this->map[i][j] == 'P' || this->map[i][j] == 'Q' || this->map[i][j] == 'Z' || this->map[i][j] == 'k' || this->map[i][j] == 'K' || this->map[i][j] == 'g' || this->map[i][j] == 'x' || this->map[i][j] == 'j' || this->map[i][j] == 'Y' || this->map[i][j] == '.' || this->map[i][j] == 'T' || this->map[i][j] == '0' || this->map[i][j] == '1' || this->map[i][j] == '2' || this->map[i][j] == '3' || this->map[i][j] == '4' || this->map[i][j] == '5' || this->map[i][j] == '6' || this->map[i][j] == '7' || this->map[i][j] == '8' || this->map[i][j] == '9';
}
return false;
}
Expand Down
28 changes: 14 additions & 14 deletions src/resource/map_1.dtm
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
E E ERR RE EP3 Z D.....E
E E ER RER Q3 E EEEEEEEEEEEEEEEEEEEEE T D.....E
E T G3 E EBBBB BBBBBBE E E D...P6E
EK4 G3 E EER RE EBBB ABBBC D.....E
E EY G3 ERR RE EP3 Z D.....E
E T EBBBBBBBBB ER RER Q3 E EEEEEEEEEEEEEEEEEEEEE T D.....E
E G3 E EBBBB BBBBBBE E E D...P6E
EK4 YBBY G3 E EERY RE EBBB ABBBC D.....E
EEEEEEEEEEEEE E BBBBBBBBBBBBBBBBB EEEEEEEEEE E D.....E
E E E P4E E B EE E .DQ5.K2E
E E Z Z Z ER K1 E EBBBBEBBBBBRBBBBBBBEEBBBBBBBBBBBBB E AEBBBBBE
E E EBBBBBBBBBBBE EK5 RRE E
EQ9.....EQ7.............. E RE .......B...............E
E E E Y P4E E B Y Z EE E .DQ5.K2E
E E Z Y Z ER K1 Y E EBBBBEBBBBBRBBBBBBBEEBBBBBBBBBBBBB E AEBBBBBE
E Y E EBBBBBBBBBBBE EK5 RRE E
EQ9.....EQ7.............. E Y RE .......B...............E
EBBBBB EBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBE EbbbbbbbEEEEEEEEEE EEEB BBBBBBBEBBBBBBBBBBBBBBBE
E E ...... ER E E REE E E
E E T ...... ERR BBBBBBBBBEBBBBBBB E EE Q2 E Q4 P5E
X.......E ...... ERRR E G4 H E EE E DBBBBBBBBBBBBBBBBBE
EBBBBBBBE ABBBBBBB EEEEEEEEEEEEEEEEEEE E EEEEEEEEEEEEEEEEEEEEEEE EE E D T D Q6 D E
X...B...E ...... ERRR E G4 H E EE E DBBBBBBBBBBBBBBBBBE
EBBBEBBBE ABBBBBBB EEEEEEEEEEEEEEEEEEE E EEEEEEEEEEEEEEEEEEEEEEE EE E Z D T D Q6 D E
E EE E E E EE E DQ8 JD D E
E EBBBBBBBBBBBBBBBBBE E BBBBBBBBBBBBBE AE G5 EE EBBBBBBEEEEEE D K3E
E G1 RE E EEEEE EEEEE E G5 REE D G2 D ABE
E G1 RRE EE E EEEEEEEEEEEEEEEE D G2 AD E
EBBBBBBBE RRREEbbbbEEEEEEEEEEEEEEEEEEEEEE EEE EEE P2 D ABB D E
E P1 RRRRE ........................E...........EEE..EEEEEE..EEEEEEEEEEEEEEEEEE E G2 E
E@ RRRRREP9.............................RR..........EEEEEE...G4............P8EQ1 EP7 G2 JE
E Y G1 RRE EE E EEEEEEEEEEEEEEEE D G2 AD E
EBBBBBBBE RRREEbbbbEEEEEEEEEEEEEEEEEEEEEE Y EEE EEE P2 D ABB D E
E P1 RRRRE .........................E...........EEE..EEEEEE..EEEEEEEEEEEEEEEEEE E G2 E
E@ RRRP9 .............................RR..........EEEEEE...G4............P8EQ1 EP7 G2 JE
EBBBBBBBBBBBBBBBBBBBBBBBBEEEBBBBBBBBBBBBBBBBBBBBBBBBBBBBBEEEEBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBEBBBBBBBBBBE
[ENDBLOCK]
[TERRAIN]
Expand Down
8 changes: 4 additions & 4 deletions src/resource/map_2.dtm
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
E ERQ4 K2 EF V < E
E E Y Y EF ABBBBC B E
E ABC E EF DQ5 G2 B Q2 E T E
E B B ER RABBBBCP5 K1EF ABBBBBBBBBBBBEBBBBBC V E E
E ERQ4 EF V < E
E E Y Y EF ABBBBBC B E
E ABC E EF DQ5K1 F Q2 E T E
E B B ER RABBBBCP5 EF ABBBBBBBBBBBBBBBBBBC V E E
E B B EBBBBBBBEF DBBBBBBEF DRR P4RREF V M< EBBC ABE
E E E E DR REF > V DEF DEE
E B B E T DQ3 B Y Z Y EF DEF DEE
Expand Down

0 comments on commit 3b09c03

Please sign in to comment.