diff options
Diffstat (limited to 'game/enemy/EnemyBulletSubScene.cpp')
-rw-r--r-- | game/enemy/EnemyBulletSubScene.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/game/enemy/EnemyBulletSubScene.cpp b/game/enemy/EnemyBulletSubScene.cpp index 1660607..488dc03 100644 --- a/game/enemy/EnemyBulletSubScene.cpp +++ b/game/enemy/EnemyBulletSubScene.cpp @@ -21,21 +21,21 @@ int EnemyBulletSubScene::create(Scene & scn){ vec2 size = {20, 20}; static int counter = 0; - string unique_name = "enemyBullet_" + to_string(counter++); - GameObject bullet = scn.new_object(unique_name.c_str(),"EnemyBullet",vec2{0,-750},0,1); + string unique_name = "enemy_bullet_" + to_string(counter++); + GameObject bullet = scn.new_object(unique_name.c_str(),"enemy_bullet",vec2{0,-750},0,1); Rigidbody& bullet_body = bullet.add_component<Rigidbody>(Rigidbody::Data { .gravity_scale = 0, - .body_type = Rigidbody::BodyType::DYNAMIC, - .linear_velocity = vec2{-300,0}, - .collision_layers = {COLL_LAY_PLAYER}, - .collision_layer = COLL_LAY_BULLET, - + .body_type = Rigidbody::BodyType::KINEMATIC, + .linear_velocity = vec2{-300,0}, + .kinematic_collision = false, + .collision_layers = {COLL_LAY_MISSILE}, + .collision_layer = COLL_LAY_BULLET }); bullet_body.active = false; BoxCollider& bullet_collider = bullet.add_component<BoxCollider>(vec2(60, 40)); - bullet_collider.active = false; + //bullet_collider.active = false; Asset bullet_asset {"asset/other_effects/effect_smgbullet_x2.png"}; Sprite & bullet_sprite = bullet.add_component<Sprite>( bullet_asset, |