From 7f7c5c56dce30d47c32fb57fad6d839d0990b054 Mon Sep 17 00:00:00 2001 From: WBoerenkamps Date: Wed, 8 Jan 2025 10:08:03 +0100 Subject: enemy spawn working + enemy shooting --- game/player/PlayerSubScene.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'game/player/PlayerSubScene.cpp') diff --git a/game/player/PlayerSubScene.cpp b/game/player/PlayerSubScene.cpp index c1e5e2f..99a0fb4 100644 --- a/game/player/PlayerSubScene.cpp +++ b/game/player/PlayerSubScene.cpp @@ -18,7 +18,7 @@ using namespace crepe; using namespace std; PlayerSubScene::PlayerSubScene(Scene & scn) { - GameObject player = scn.new_object("player", "player", vec2(-100, 200)); + GameObject player = scn.new_object("player", "player", vec2(300, 200)); Asset player_bullet {"asset/other_effects/effect_smgbullet.png"}; Sprite & player_bullet_sprite = player.add_component( @@ -143,11 +143,11 @@ PlayerSubScene::PlayerSubScene(Scene & scn) { player.add_component(Rigidbody::Data { .gravity_scale = PLAYER_GRAVITY_SCALE, .body_type = Rigidbody::BodyType::DYNAMIC, - .linear_velocity = vec2(PLAYER_SPEED * 0.02, 0), + //.linear_velocity = vec2(PLAYER_SPEED * 0.02, 0), .collision_layers - = {COLL_LAY_BOT_TOP, COLL_LAY_ZAPPER, COLL_LAY_LASER, COLL_LAY_MISSILE}, + = {COLL_LAY_BOT_TOP, COLL_LAY_ZAPPER, COLL_LAY_LASER, COLL_LAY_MISSILE,COLL_LAY_BULLET}, .collision_layer = COLL_LAY_PLAYER, }); - player.add_component().set_script().active = false; + player.add_component().set_script().active = true; player.add_component().set_script().active = false; } -- cgit v1.2.3