From 2ad15f3efab481659543a1c03cd70a36fd297538 Mon Sep 17 00:00:00 2001 From: WBoerenkamps Date: Wed, 8 Jan 2025 16:40:17 +0100 Subject: fixed angular dt --- game/player/PlayerBulletScript.cpp | 2 +- game/player/PlayerBulletSubScene.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'game/player') diff --git a/game/player/PlayerBulletScript.cpp b/game/player/PlayerBulletScript.cpp index a76b7eb..a823375 100644 --- a/game/player/PlayerBulletScript.cpp +++ b/game/player/PlayerBulletScript.cpp @@ -17,7 +17,7 @@ void PlayerBulletScript::fixed_update(crepe::duration_t dt) { Camera & camera = this->get_components_by_name("camera").front(); Transform & cam_transform = this->get_components_by_name("camera").front(); Rigidbody & bullet_body = this->get_component(); - transform.rotation += bullet_body.data.angular_velocity; + transform.rotation += bullet_body.data.angular_velocity * dt.count(); transform.position += bullet_body.data.linear_velocity * dt.count(); vec2 half_screen = camera.viewport_size / 2; float despawn_location = cam_transform.position.x + half_screen.x + 50; diff --git a/game/player/PlayerBulletSubScene.cpp b/game/player/PlayerBulletSubScene.cpp index 795747b..5e1c66e 100644 --- a/game/player/PlayerBulletSubScene.cpp +++ b/game/player/PlayerBulletSubScene.cpp @@ -25,7 +25,7 @@ int PlayerBulletSubScene::create(Scene & scn, int counter) { .gravity_scale = 0, .body_type = Rigidbody::BodyType::KINEMATIC, .linear_velocity = vec2 {400, 0}, - .angular_velocity = 10, + .angular_velocity = 300, .kinematic_collision = false, .collision_layers = {COLL_LAY_ENEMY, COLL_LAY_ZAPPER}, -- cgit v1.2.3