feat: Added basic shooting

This commit is contained in:
2025-10-05 22:35:34 +01:00
parent 3eb8683ce3
commit 319bb441ed
10 changed files with 39 additions and 13 deletions

View File

@@ -42,8 +42,8 @@ void PlayerInput(SDL_Event *event, Player *player)
// shooting
player->bulletsLoaded -= 1;
player->controls.shot = true;
player->shotPos = V2F(mouseBtn.x, mouseBtn.y);
printf("shot %f %f\n", mouseBtn.x, mouseBtn.y);
player->shotPos = player->world->mouseProjected;
printf("shot %f %f\n", player->shotPos.x, player->shotPos.y);
} else if(player->reloadTimer == 0) {
player->reloadTimer = PLAYER_RELOAD_TIME;
printf("reloading\n");