diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2025-01-07 15:01:02 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2025-01-07 15:01:02 +0100 |
commit | f8ffac3b14d41e7d1e43ffe64750d910ed333b0d (patch) | |
tree | 1417b93d5e57df858f0cd4177e3c8b5ffbcc021b /game/GameScene.cpp | |
parent | 5d798c30af7026099344a068e91e1684018b4386 (diff) | |
parent | f31bd86ae5d7df21b788a273d4f2e530136ec184 (diff) |
another merge + WIP
Diffstat (limited to 'game/GameScene.cpp')
-rw-r--r-- | game/GameScene.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/game/GameScene.cpp b/game/GameScene.cpp index c30276a..8bd6c74 100644 --- a/game/GameScene.cpp +++ b/game/GameScene.cpp @@ -14,10 +14,12 @@ #include "menus/endgame/EndGameSubScript.h" #include "player/PlayerSubScene.h" #include "prefab/ZapperPoolSubScene.h" +#include "workers/WorkersSubScene.h" #include <cmath> #include <crepe/api/Animator.h> #include <crepe/api/Asset.h> +#include <crepe/api/AudioSource.h> #include <crepe/api/BehaviorScript.h> #include <crepe/api/BoxCollider.h> #include <crepe/api/Camera.h> @@ -55,6 +57,8 @@ void GameScene::load_scene() { PlayerSubScene player(*this); + WorkersSubScene workers(*this); + GameObject floor = new_object("floor", "game_world", vec2(0, 325)); floor.add_component<Rigidbody>(Rigidbody::Data { .body_type = Rigidbody::BodyType::STATIC, @@ -91,6 +95,14 @@ void GameScene::load_scene() { HudSubScene hud; hud.create(*this); + GameObject background_music = new_object("background_music", "audio", vec2(0, 0)); + Asset background_music_asset {"asset/music/level.ogg"}; + background_music.add_component<AudioSource>(background_music_asset); + + GameObject boom_audio = new_object("boom_audio", "audio", vec2(0, 0)); + Asset boom_audio_asset {"asset/sfx/window_smash.ogg"}; + boom_audio.add_component<AudioSource>(boom_audio_asset); + GameObject laser = new_object("laser", "laser", vec2(2000, 0)); Asset laser_asset {"asset/obstacles/laser/laserPower.png"}; Sprite & laser_sprite = laser.add_component<Sprite>( |