aboutsummaryrefslogtreecommitdiff
path: root/game
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2025-01-07 10:40:16 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2025-01-07 10:40:16 +0100
commitbcfa2d9543c2fc7d83003b243e526ab64efab6e1 (patch)
tree00f63efe0c5ecf1aa8eaabad92f4e85277ea8644 /game
parentd46548ab15699f7ae91227625302553e79a126bc (diff)
cleanup
Diffstat (limited to 'game')
-rw-r--r--game/GameScene.cpp17
-rw-r--r--game/prefab/ZapperObject.cpp1
2 files changed, 1 insertions, 17 deletions
diff --git a/game/GameScene.cpp b/game/GameScene.cpp
index 4193581..c393ef7 100644
--- a/game/GameScene.cpp
+++ b/game/GameScene.cpp
@@ -74,23 +74,6 @@ void GameScene::load_scene() {
GameObject start_game_script = new_object("start_game_script", "script", vec2(0, 0));
start_game_script.add_component<BehaviorScript>().set_script<StartGameScript>();
- // zapper, laser and missile (below) for testing purpose only!!!
- GameObject zapper = new_object("zapper", "zapper", vec2(1000, 0));
- Asset zapper_asset {"asset/obstacles/zapper/regular_zappers/zapEffect.png"};
- Sprite & zapper_sprite = zapper.add_component<Sprite>(
- zapper_asset,
- Sprite::Data {
- .sorting_in_layer = SORT_IN_LAY_OBSTACLES,
- .order_in_layer = 0,
- .size = vec2(100, 100),
- }
- );
- zapper.add_component<Rigidbody>(Rigidbody::Data {
- .body_type = Rigidbody::BodyType::KINEMATIC,
- .kinematic_collision = false,
- .collision_layer = COLL_LAY_ZAPPER,
- });
- zapper.add_component<BoxCollider>(vec2(100, 100));
GameObject laser = new_object("laser", "laser", vec2(2000, 0));
Asset laser_asset {"asset/obstacles/laser/laserPower.png"};
Sprite & laser_sprite = laser.add_component<Sprite>(
diff --git a/game/prefab/ZapperObject.cpp b/game/prefab/ZapperObject.cpp
index 8df2075..944a53f 100644
--- a/game/prefab/ZapperObject.cpp
+++ b/game/prefab/ZapperObject.cpp
@@ -77,6 +77,7 @@ ZapperObject::ZapperObject(crepe::GameObject && base)
body {add_component<Rigidbody>(Rigidbody::Data {
.body_type = Rigidbody::BodyType::KINEMATIC,
.kinematic_collision = false,
+ .collision_layer = COLL_LAY_ZAPPER,
})},
collider {add_component<BoxCollider>(vec2(0, 0))} {
this->place(this->transform.position, 0, 300);