aboutsummaryrefslogtreecommitdiff
path: root/src/entities/antifaShip.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/entities/antifaShip.c')
-rw-r--r--src/entities/antifaShip.c20
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);