mirror of
https://github.com/BreizhHardware/Poulpes-de-l-Espace-La-derniere-ligne-de-Defense.git
synced 2026-01-18 16:27:20 +01:00
Fix gameover menu and change base health from 150 hp to 200
# To do: - Dasagne - Better rules
This commit is contained in:
@@ -21,7 +21,7 @@ Game::Game(Menu* menu) : menu(menu)
|
||||
gameMap = new Map(this);
|
||||
|
||||
// Create the player object
|
||||
player = new Player(150, 0, 10, 10, 1, ":/ressources/player.png", 0, 0, *gameMap, *this);
|
||||
player = new Player(200, 0, 10, 10, 1, ":/ressources/player.png", 0, 0, *gameMap, *this);
|
||||
|
||||
// Create the text items for the health, gold and wave number
|
||||
healthDisplay = new QGraphicsTextItem();
|
||||
@@ -65,7 +65,7 @@ Game::Game(Menu* menu) : menu(menu)
|
||||
void Game::start() {
|
||||
// Heal the player to full health (150)
|
||||
int preiousHealth = player->getHealth();
|
||||
player->heal(150 - preiousHealth);
|
||||
player->heal(200 - preiousHealth);
|
||||
|
||||
// Create the map
|
||||
gameMap->generateMap(25, 14, this);
|
||||
@@ -275,7 +275,7 @@ void Game::gameOver() {
|
||||
|
||||
auto* gameOver = new Gameover(this);
|
||||
connect(gameOver, &Gameover::restartGameSignal, this, &Game::start);
|
||||
gameOver->setFixedSize(200, 100);
|
||||
gameOver->setFixedSize(200, 170);
|
||||
gameOver->show();
|
||||
}
|
||||
|
||||
|
||||
@@ -5,17 +5,22 @@
|
||||
#include "Gameover.h"
|
||||
|
||||
Gameover::Gameover(Game* game, QWidget *parent) : QWidget(parent), game(game) {
|
||||
this->setStyleSheet("background-color: #071A22; color: #9EB1BD;");
|
||||
restartButton = new QPushButton("Restart", this);
|
||||
quitButton = new QPushButton("Quit", this);
|
||||
|
||||
restartButton->setFixedSize(100, 50);
|
||||
quitButton->setFixedSize(100, 50);
|
||||
restartButton->setStyleSheet("background-color: #0A385A; color: #9EB1BD; font-size: 40px; font-weight: bold;");
|
||||
quitButton->setStyleSheet("background-color: #0A385A; color: #9EB1BD; font-size: 40px; font-weight: bold;");
|
||||
|
||||
connect(restartButton, &QPushButton::clicked, this, &Gameover::onRestartButtonClicked);
|
||||
connect(quitButton, &QPushButton::clicked, this, &Gameover::onQuitButtonClicked);
|
||||
|
||||
restartButton->setFixedHeight(53);
|
||||
quitButton->setFixedHeight(53);
|
||||
|
||||
auto *buttonLayout = new QVBoxLayout();
|
||||
buttonLayout->addWidget(restartButton);
|
||||
buttonLayout->addSpacing(53);
|
||||
buttonLayout->addWidget(quitButton);
|
||||
|
||||
auto* mainLayout = new QGridLayout(this);
|
||||
|
||||
@@ -7,6 +7,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
|
||||
this->setCentralWidget(menu);
|
||||
this->setWindowTitle("Poulpes de l'espace: La dernière ligne de défense");
|
||||
//this->setFixedSize(1320, 760);
|
||||
this->resize(1320, 760);
|
||||
|
||||
helpMenu = menuBar()->addMenu(tr("&Help"));
|
||||
QAction* actionHelp = new QAction(tr("&About"), this);
|
||||
|
||||
Reference in New Issue
Block a user