diff options
author | nathansmithsmith <nathansmith7@mailfence.com> | 2023-10-27 20:15:37 -0600 |
---|---|---|
committer | nathansmithsmith <nathansmith7@mailfence.com> | 2023-10-27 20:15:37 -0600 |
commit | fa14227560c9be143b7c26ada4e41c6636966896 (patch) | |
tree | 0736bb8e301942028f18f1a416dd1b842f116768 /src/entities/antifaShip.c | |
parent | 4c5b7bdbe8c1cfef9ed7a3ef639f3f83411b2b0e (diff) |
Playing with targeting more
Diffstat (limited to 'src/entities/antifaShip.c')
-rw-r--r-- | src/entities/antifaShip.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/entities/antifaShip.c b/src/entities/antifaShip.c index fbcb138..54f5aa9 100644 --- a/src/entities/antifaShip.c +++ b/src/entities/antifaShip.c @@ -36,7 +36,7 @@ void initAntifaShip(Entity * entity, Game * game) { // Targeting PID indeed (: PIDConfig targetingPIDConfig = (PIDConfig){ - .kP = 500.0, + .kP = 1000.0, .kI = 0.1, .kD = 0.0, .angleMode = false, @@ -272,10 +272,22 @@ void drawAntifaShip(Game * game, Entity * entity) { // Draw bullet. AntifaShip * data = (AntifaShip*)entity->data; - if (data->doAutoTarget) { + // Debug targetting. + if (data->doAutoTarget) DrawLine3D(entity->position, Vector3Add(Vector3Scale(data->gunTarget, 100), entity->position), YELLOW); - //printVector3(data->gunTarget); - } + + if (IsMouseButtonDown(MOUSE_RIGHT_BUTTON)) + DrawCylinderWiresEx( + entity->position, + Vector3Add( + entity->position, + Vector3Scale(Vector3RotateByQuaternion((Vector3){0.0, 0.0, 1.0}, entity->rotation), 10.0) + ), + entity->radius / 2.0, + ANTIFA_START_AUTO_TARGET_MAX * 10.0, + 16, + BLUE + ); if (GetTime() - data->timeSinceLastBullet <= ANTIFA_DRAW_BULLET_FOR) DrawRay(data->lastBulletShot.ray, BLUE); |