minigun bullet offset

This commit is contained in:
nemo 2024-10-28 17:43:14 +01:00
parent 5b2c7e729d
commit 34ec872727
1 changed files with 10 additions and 2 deletions

View File

@ -36,8 +36,16 @@ void process_minigun(Vector2 pos, Camera2D *real_cam, Camera2D *effect_cam)
Vector2 toward = Vector2Normalize((Vector2) {cos(angle * PI/180), sin(angle * PI/180)});
real_cam->target = Vector2Subtract(world, Vector2Scale(toward, back_speed));
bullet_spawn(BULLET_MINIGUN, Vector2Subtract(world, Vector2Scale(toward, 5*1.0)), angle);
bullet_spawn(BULLET_MINIGUN, Vector2Subtract(world, Vector2Scale(toward, 5*6.0)), angle);
Vector2 b1 = Vector2Scale(toward, 5*1.0);
Vector2 b2 = Vector2Scale(toward, 5*6.0);
b1.x += GetRandomValue(-7, 7);
b1.y += GetRandomValue(-7, 7);
b2.x += GetRandomValue(-7, 7);
b2.y += GetRandomValue(-7, 7);
bullet_spawn(BULLET_MINIGUN, Vector2Subtract(world, b1), angle);
bullet_spawn(BULLET_MINIGUN, Vector2Subtract(world, b2), angle);
}
if (key_down(KC_SPECIAL) || !key_down(KC_SHOOT)) {
back_speed = DEFAULT_BACK_SPEED;