This commit is contained in:
Masashi 2025-12-18 22:07:12 +05:30
commit 7b8e798662
2 changed files with 9 additions and 6 deletions

Binary file not shown.

View file

@ -714,8 +714,9 @@ int main(void) {
Vector3 camPos = v3(0, 5.0f, 6);
float yaw = 0.0f, pitch = 0.0f;
float recoilYaw = 0.0f, recoilPitch = 0.0f, crossSpread = 0.0f;
float fireCooldown = 0.0f;
float recoilYaw = 0.0f, recoilPitch = 0.0f, crossSpread = 0.0f;
int scoped = 0;
float fireCooldown = 0.0f;
int shotsInBurst = 0;
float burstResetTimer = 0.0f;
@ -870,6 +871,8 @@ int main(void) {
buttons |= BTN_USE_MEDKIT;
if (IsKeyPressed(KEY_SPACE))
buttons |= BTN_JUMP;
if (IsKeyPressed(KEY_Z))
scoped = !scoped;
if (myId != 255) {
MsgInput in = {0};
@ -921,7 +924,7 @@ int main(void) {
cam.position = camPos;
cam.target = v3_add(camPos, forward);
cam.up = v3(0, 1, 0);
cam.fovy = 75.0f;
cam.fovy = scoped ? 30.0f : 75.0f;
cam.projection = CAMERA_PERSPECTIVE;
BeginDrawing();
@ -1068,14 +1071,14 @@ int main(void) {
// Crosshair
{
int cx = sw / 2, cy = sh / 2;
int gap = 6 + (int)crossSpread;
int len = 10, thick = 2;
int gap = scoped ? 2 : 6 + (int)crossSpread;
int len = scoped ? 5 : 10, thick = 2;
Color col = (Color){240, 240, 245, 220};
DrawRectangle(cx - gap - len, cy - thick / 2, len, thick, col);
DrawRectangle(cx + gap, cy - thick / 2, len, thick, col);
DrawRectangle(cx - thick / 2, cy - gap - len, thick, len, col);
DrawRectangle(cx - thick / 2, cy + gap, thick, len, col);
DrawCircleLines(cx, cy, 3.0f, (Color){240, 240, 245, 160});
DrawCircleLines(cx, cy, scoped ? 1.5f : 3.0f, (Color){240, 240, 245, 160});
}
EndDrawing();