mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-05-26 15:58:12 +00:00
add time component
This commit is contained in:
@@ -26,6 +26,7 @@ namespace BBM
|
||||
LobbyScene,
|
||||
TitleScreenScene,
|
||||
CreditScene,
|
||||
ScoreScene = MainMenuScene,
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "Drawables/2D/Text.hpp"
|
||||
#include "Component/Gravity/GravityComponent.hpp"
|
||||
#include "Component/BumperTimer/BumperTimerComponent.hpp"
|
||||
#include "Component/Timer/TimerComponent.hpp"
|
||||
#include "Model/Model.hpp"
|
||||
#include "Map/Map.hpp"
|
||||
#include "Component/Score/ScoreComponent.hpp"
|
||||
@@ -42,6 +43,10 @@ namespace BBM
|
||||
{SoundComponent::BOMB, "assets/sounds/bomb_drop.ogg"},
|
||||
//{SoundComponent::DEATH, "assets/sounds/death.ogg"}
|
||||
};
|
||||
scene->addEntity("Timer")
|
||||
.addComponent<TimerComponent>(std::chrono::seconds(60), [](WAL::Entity &, WAL::Wal &) {
|
||||
Runner::gameState.nextScene = GameState::ScoreScene;
|
||||
});
|
||||
scene->addEntity("player")
|
||||
.addComponent<PositionComponent>(0, 1.01, 0)
|
||||
.addComponent<Drawable3DComponent, RAY3D::Model>("assets/player/player.iqm", true, std::make_pair(MAP_DIFFUSE, "assets/player/blue.png"))
|
||||
|
||||
@@ -16,6 +16,6 @@ namespace BBM {
|
||||
for (auto & [_ , healthComponent]: this->_wal.getScene()->view<HealthComponent>())
|
||||
alivePlayersCount += (healthComponent.getHealthPoint() != 0);
|
||||
if (alivePlayersCount <= 1)
|
||||
Runner::gameState.nextScene = Runner::gameState.MainMenuScene;
|
||||
Runner::gameState.nextScene = Runner::gameState.ScoreScene;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user