aboutsummaryrefslogtreecommitdiff
path: root/game
diff options
context:
space:
mode:
Diffstat (limited to 'game')
-rw-r--r--game/CMakeLists.txt4
-rw-r--r--game/GameScene.cpp7
-rw-r--r--game/main.cpp2
-rw-r--r--game/menus/MenusConfig.h2
4 files changed, 12 insertions, 3 deletions
diff --git a/game/CMakeLists.txt b/game/CMakeLists.txt
index 47adb11..9251b2c 100644
--- a/game/CMakeLists.txt
+++ b/game/CMakeLists.txt
@@ -16,6 +16,7 @@ add_executable(main
background/ForestSubScene.cpp
background/HallwaySubScene.cpp
background/StartSubScene.cpp
+ background/HallwayScript.cpp
# mainscenes
GameScene.cpp
@@ -39,9 +40,9 @@ add_executable(main
preview/NpcScript.cpp
preview/PrevPlayerSubScene.cpp
preview/PrevPlayerScript.cpp
+ main.cpp
# scripts
- background/HallwayScript.cpp
MoveCameraManualyScript.cpp
StartGameScript.cpp
@@ -58,7 +59,6 @@ add_executable(main
workers/CollisionScript.cpp
# menus
- main.cpp
menus/BannerSubScene.cpp
menus/ButtonSubScene.cpp
menus/IButtonScript.cpp
diff --git a/game/GameScene.cpp b/game/GameScene.cpp
index 9376eab..f2471fc 100644
--- a/game/GameScene.cpp
+++ b/game/GameScene.cpp
@@ -10,7 +10,10 @@
#include "hud/HudSubScene.h"
#include "hud/SpeedScript.h"
#include "menus/endgame/EndGameSubScene.h"
+#include "missile/MissilePool.h"
+#include "missile/SpawnEvent.h"
#include "player/PlayerSubScene.h"
+#include "scheduler/ObjectsScheduler.h"
#include "workers/WorkersSubScene.h"
#include <cmath>
@@ -47,11 +50,15 @@ void GameScene::load_scene() {
camera.add_component<BehaviorScript>().set_script<CoinSystemScript>();
camera.add_component<BehaviorScript>().set_script<HudScript>();
camera.add_component<BehaviorScript>().set_script<SpeedScript>();
+ camera.add_component<BehaviorScript>().set_script<ObjectsScheduler>();
+ camera.add_component<BehaviorScript>().set_script<MissileSpawnEventHandler>();
camera.add_component<Rigidbody>(Rigidbody::Data {});
PlayerSubScene player(*this);
+ MissilePool missile_pool(*this);
+
WorkersSubScene workers(*this);
GameObject floor = new_object("floor", "game_world", vec2(0, 325));
diff --git a/game/main.cpp b/game/main.cpp
index e341353..5c050f4 100644
--- a/game/main.cpp
+++ b/game/main.cpp
@@ -2,6 +2,7 @@
#include <crepe/api/Script.h>
#include "GameScene.h"
+#include "PreviewScene.h"
#include "menus/mainmenu/MainMenuScene.h"
#include "menus/shop/ShopMenuScene.h"
@@ -12,6 +13,7 @@ int main() {
gameloop.add_scene<MainMenuScene>();
gameloop.add_scene<ShopMenuScene>();
gameloop.add_scene<GameScene>();
+ gameloop.add_scene<PreviewScene>();
return gameloop.main();
}
diff --git a/game/menus/MenusConfig.h b/game/menus/MenusConfig.h
index 6ec5689..968f8cc 100644
--- a/game/menus/MenusConfig.h
+++ b/game/menus/MenusConfig.h
@@ -6,7 +6,7 @@ static constexpr int STARTING_SORTING_IN_LAYER = 7;
static constexpr const char * CAMERA_NAME = "camera";
//Scene names
static constexpr const char * START_SCENE = "scene1";
-static constexpr const char * PREVIEW_SCENE = "scene1";
+static constexpr const char * PREVIEW_SCENE = "preview scene";
static constexpr const char * SHOP_SCENE = "shopmenu";
static constexpr const char * MAINMENU_SCENE = "mainmenu";
//button config