{"id":20266349,"url":"https://github.com/ikajdan/aimwave","last_synced_at":"2026-05-05T16:07:36.987Z","repository":{"id":262102882,"uuid":"885594782","full_name":"ikajdan/aimwave","owner":"ikajdan","description":"A simple 3D first-person shooter demo developed in Unity","archived":false,"fork":false,"pushed_at":"2024-12-18T21:45:19.000Z","size":2403,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-02T19:51:10.225Z","etag":null,"topics":["3d","first-person-shooter","game","game-development","oop","unity","unity3d"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ikajdan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-08T22:40:22.000Z","updated_at":"2024-12-18T21:45:22.000Z","dependencies_parsed_at":"2024-11-10T15:41:39.868Z","dependency_job_id":null,"html_url":"https://github.com/ikajdan/aimwave","commit_stats":null,"previous_names":["ikajdan/aimwave"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ikajdan%2Faimwave","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ikajdan%2Faimwave/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ikajdan%2Faimwave/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ikajdan%2Faimwave/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ikajdan","download_url":"https://codeload.github.com/ikajdan/aimwave/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241746796,"owners_count":20013165,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3d","first-person-shooter","game","game-development","oop","unity","unity3d"],"created_at":"2024-11-14T12:08:48.832Z","updated_at":"2026-05-05T16:07:31.935Z","avatar_url":"https://github.com/ikajdan.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cimg src=\".images/logo.png\" alt=\"AimWave\" width=\"150\" height=\"auto\"/\u003e\n  \u003cbr\u003e\u003cbr\u003e\n  AimWave\n  \u003cbr\u003e\u003cbr\u003e\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#gameplay\"\u003eGameplay\u003c/a\u003e •\n  \u003ca href=\"#controls\"\u003eControls\u003c/a\u003e •\n  \u003ca href=\"#user-interface\"\u003eUser Interface\u003c/a\u003e •\n  \u003ca href=\"#world\"\u003eWorld\u003c/a\u003e •\n  \u003ca href=\"#project-structure\"\u003eProject Structure\u003c/a\u003e\n\u003c/p\u003e\n\nAimWave is a simple 3D first-person shooter developed in Unity. In this game, players shoot targets to score points within a 30-second time limit, aiming to achieve the highest possible score before time runs out.\n\n## Gameplay\n\nThe game features a simple scoring system, granting 1 point for each target hit. Targets randomly appear along the walls facing the player, and must be shot to score. Each wall has 3 targets, and to make them reappear, all 3 must be destroyed. The next set of targets will spawn after a brief delay. The game ends when the 30-second timer runs out. Players can reload their gun at any moment, though the weapon can only hold 10 bullets at a time.\n\n\u003cbr\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/user-attachments/assets/a8402c7d-a4df-4e0b-9473-d73122da7a46\" width=\"700\" height=\"auto\"/\u003e\n  \u003cbr\u003e\u003cbr\u003e\n  \u003cem\u003eGameplay Highlight.\u003c/em\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\n## Controls\n\nTo control the game, the player can use the mouse to aim the gun and move the character using the \u003ckbd\u003eW\u003c/kbd\u003e, \u003ckbd\u003eA\u003c/kbd\u003e, \u003ckbd\u003eS\u003c/kbd\u003e, and \u003ckbd\u003eD\u003c/kbd\u003e keys. Shooting is triggered by pressing the \u003ckbd\u003eLeft Mouse Button\u003c/kbd\u003e. Reloading the gun is done by pressing the \u003ckbd\u003eR\u003c/kbd\u003e key. The game begins with a press of the \u003ckbd\u003eSpace\u003c/kbd\u003e key. Pressing \u003ckbd\u003eEsc\u003c/kbd\u003e quits the game immediately.\n\nThe following table lists the controls in the game:\n\n| Action       | Key                                                    |\n|--------------|--------------------------------------------------------|\n| Shoot        | \u003ckbd\u003eLeft Mouse Button\u003c/kbd\u003e                           |\n| Move         | \u003ckbd\u003eW\u003c/kbd\u003e, \u003ckbd\u003eA\u003c/kbd\u003e, \u003ckbd\u003eS\u003c/kbd\u003e, \u003ckbd\u003eD\u003c/kbd\u003e |\n| Reload       | \u003ckbd\u003eR\u003c/kbd\u003e                                           |\n| Start Game   | \u003ckbd\u003eSpace\u003c/kbd\u003e                                       |\n| Exit Game    | \u003ckbd\u003eEsc\u003c/kbd\u003e                                         |\n\n## User Interface\n\nThe HUD provides essential information to the player, allowing them to track their progress and manage their resources.\nIt displays the score, time left and the ammo count. The crosshair is used to aim the gun.\n\n\u003cbr\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\".images/interface.png\" width=\"700\" height=\"auto\"/\u003e\n  \u003cbr\u003e\u003cbr\u003e\n  \u003cem\u003eHead-Up Display (HUD).\u003c/em\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\n## World\n\nThe arena map is designed as a simple, enclosed space with walls that serve as the spawning points for targets. The layout is straightforward to ensure that players can focus on shooting targets without unnecessary distractions.\n\n\u003cbr\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\".images/map.png\" width=\"700\" height=\"auto\"/\u003e\n  \u003cbr\u003e\u003cbr\u003e\n  \u003cem\u003eArena Layout.\u003c/em\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\n## Project Structure\n\nThe project is structured around several scripts that manage different aspects of the game, such as player movement, shooting, target spawning, and audio management. The game features a variety of scripts, prefabs, and assets that work together to create a cohesive gameplay experience.\n\n### Scene\n\nThe game consists of a single scene that contains all the elements required for gameplay. The scene is organized into different game objects that represent various components of the game, such as the player, targets, arena, and user interface elements.\n\n- Logger: A script that logs messages to a file for debugging and tracking events during gameplay.\n- Ground: The base of the arena where the player moves and interacts.\n- Arena: A defined space that includes walls and box colliders acting as sensors to detect the presence of targets.\n- Directional Light: Provides ambient lighting for the scene.\n- Skybox: A procedural skybox material used for environmental effects.\n- GlobalReference: A singleton script that manages global references such as the bullet prefab, ensuring a central point of access for resources across the code.\n- SoundManager: Centralized control for playing sound effects, handling the audio of actions such as shooting, reloading, and time events.\n- TargetManager: Responsible for spawning, managing, and destroying targets within the arena.\n- TimeManager: Handles the countdown timer for the game, controlling time-based events such as the start and end of a round.\n- HUD: User Interface elements that display the crosshair, score, remaining time, and current ammo.\n- MainCamera: The camera that follows the player’s viewpoint, used to simulate first-person view.\n- Body: Represents the player character, controlled by the player’s input.\n- GroundCheck: A collider used to check if the player is grounded, influencing movement and gravity.\n- Rifle: The player's weapon, attached to the character.\n    - BulletSpawn: The point from which bullets are instantiated when fired.\n    - MuzzleFlashEffect: Particle system that displays the muzzle flash animation when the rifle fires.\n\n```mermaid\ngraph TD\n    %% Core Script References\n    GlobalReference --\u003e|Provides bulletPrefab| Weapon\n    GlobalReference --\u003e|Provides bulletPrefab| TargetSpawner\n    SoundManager --\u003e|Plays gunshot and reload sounds| Weapon\n    TimeManager --\u003e|Manages countdown and time-up| TargetSpawner\n\n    %% Weapon Interaction with Other Scripts\n    Weapon --\u003e|Updates score| TargetSpawner\n    Weapon --\u003e|Updates ammo UI| HUD\n    Weapon --\u003e|Triggers animations| Animator\n    Weapon --\u003e|Instantiates and fires| Bullet\n    Bullet --\u003e|Triggers destruction on hit| TargetSpawner\n\n    %% HUD Interactions\n    HUD --\u003e|Displays UI elements| Weapon\n    HUD --\u003e|Displays score| TargetSpawner\n\n    %% Movement and Aim Controls\n    PlayerMovement --\u003e|Moves player in game world| Arena\n    MouseMovement --\u003e|Controls camera view| Weapon\n\n    %% Target Spawning and Management\n    TargetSpawner --\u003e|Spawns targets in arena| Target\n    Target --\u003e|Checks respawn status| TargetSpawner\n    Target --\u003e|Updates score on hit| HUD\n    Target --\u003e|Handles tracking and collisions| Bullet\n\n    %% Game Exit\n    ExitGameOnEsc --\u003e|Handles escape key exit| UnityEditor\n\n    %% Descriptions\n    GlobalReference --\u003e|Provides global references| SoundManager\n    PlayerMovement --\u003e|Handles movement| Arena\n    MouseMovement --\u003e|Handles camera rotation| PlayerMovement\n    SoundManager --\u003e|Plays sounds for actions| TimeManager\n```\n\n\u003cbr\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003cem\u003eGame Script Interactions Diagram.\u003c/em\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\n### Scripts\n\nScripts are used to control various aspects of the game, including player movement, shooting, target spawning, and audio management.\n\n#### Weapon Management\n\nThe `Weapon` script handles firing, reloading, ammo management, and the visual effects associated with shooting. It controls the fire rate, ammo count, and reload time.\n\n#### Target Spawning and Management\n\nThe `TargetSpawner` manages the spawning of targets at random positions along the arena's walls. It checks if there are any targets on the walls before respawning them.\n\nBox collider sensors on the walls detect if a target is present, allowing for intelligent respawning when a wall is clear of targets.\n\nTargets are destroyed when hit by bullets, and the score is updated accordingly.\n\n#### Game Flow and Events\n\nThe `CountdownTimer` manages the countdown before the round starts and the timer during the round, handling the start, end, and time-up events.\n\nThe `TargetSpawner` increments the score whenever a target is destroyed, and the score is displayed on the HUD.\n\n#### Audio Management\n\nThe `SoundManager` handles different sounds such as gunshots, reloads, countdowns, and time-ups. The script uses `AudioSource` components for each sound effect, ensuring all audio elements are controlled centrally.\n\n#### Player Input\n\n`MouseMovement` anages player mouse input for aiming the camera and rotating the player's view.\n\n`PlayerMovement` handles the player's movement across the arena with respect to gravity and ground detection. The `CharacterController` is used for smooth movement.\n\n#### Scene Management\n\nThe `GlobalReference` singleton ensures that global objects, like the bullet prefab, are accessible across all scenes without creating unnecessary duplicates.\n\n#### Physics and Collisions\n\nBullets are instantiated and moved using physics (RigidBody). They are destroyed after a set lifetime or upon collision with a target. The `Bullet` script ensures that collisions with targets trigger appropriate actions such as scoring and target destruction.\n\n`PlayerMovement` script uses a ground check and gravity system to simulate realistic movement and falling physics for the player.\n\n#### Logging and Debugging\n\nThe `Logger` script provides a centralized logging system for debugging and tracking events during gameplay. It logs messages to the the `game_log.json` file with timestamps and class tags. For example, the following code logs an event when a bullet hits a target:\n\n```csharp\nLogger.Instance.LogEvent(\"Bullet\", \"Hit target: \" + collision.gameObject.name);\n```\n\nThe log file is structured as follows:\n\n```json\n{\n    \"entries\": [\n        {\n            \"eventType\": \"All targets destroyed.\",\n            \"message\": \"TargetSpawner\",\n            \"timestamp\": \"2024-11-10 14:27:55.695\"\n        },\n        {\n            \"eventType\": \"Score reset to 0.\",\n            \"message\": \"TargetSpawner\",\n            \"timestamp\": \"2024-11-10 14:27:55.695\"\n        },\n        {\n            \"eventType\": \"Timer reset.\",\n            \"message\": \"CountdownTimer\",\n            \"timestamp\": \"2024-11-10 14:27:55.695\"\n        },\n        {\n            \"eventType\": \"Countdown started.\",\n            \"message\": \"CountdownTimer\",\n            \"timestamp\": \"2024-11-10 14:27:55.707\"\n        },\n        {\n            \"eventType\": \"Target spawning started.\",\n            \"message\": \"TargetSpawner\",\n            \"timestamp\": \"2024-11-10 14:27:58.689\"\n        },\n        {\n            \"eventType\": \"Weapon fired. Ammo left: 9\",\n            \"message\": \"Weapon\",\n            \"timestamp\": \"2024-11-10 14:27:58.965\"\n        }\n    ]\n}\n```\n\n### Animations\n\nRifle animatios are used to control the rifle's behavior during different actions.\n\n- Idle: When the rifle is at rest.\n- Recoil: Triggered when the player fires the weapon, simulating gun recoil.\n- Reload: Animates the reloading process when ammo is being reloaded.\n\n```mermaid\nstateDiagram-v2\n    [*] --\u003e Idle\n    Idle --\u003e Recoil\n    Recoil --\u003e Idle\n    Idle --\u003e Reload\n    Reload --\u003e Idle\n```\n\n\u003cbr\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003cem\u003eRifle Animation State Diagram.\u003c/em\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\n### Prefabs\n\nThe `Bullet` prefab is instantiated when the player shoots, handling bullet behavior like movement, collisions, and destruction.\n\nThe `Target` prefab represents the objects the player must shoot to score points. Targets are spawned and managed by the `TargetSpawner` script.\n\n### Audio Assets\n\nGunshot, reload, countdown, and time-up sounds are used to enhance the game experience. These sounds are managed by the `SoundManager` script and played at appropriate times during gameplay.\n\n### External Assets\n\nThe game uses several external assets to enhance the visual and audio experience.\n\n- [Low Poly Sci-Fi Weapons Lite](https://assetstore.unity.com/packages/3d/props/guns/low-poly-sci-fi-weapons-lite-296460): The rifle model used in the game, providing a futuristic aesthetic to the weapon.\n- [Particle Pack](https://assetstore.unity.com/packages/vfx/particles/legacy-particle-pack-73777): Particle effects like muzzle flashes are used to enhance the visual feedback when the player shoots.\n- [Prototyping Pack](https://assetstore.unity.com/packages/3d/prototyping-pack-free-94277): The ground is built using an asset from this pack.\n- [Crosshair](https://kenney.nl/assets/crosshair-pack): A visual crosshair asset used to indicate the player's aim on the screen.\n- [HUD Font](https://www.dafont.com/spy-agency.font): The font used for the HUD elements, providing a futuristic and sleek look to the text.\n- [Sound Effects](https://pixabay.com/sound-effects/search/public-domain/): Sounds are used to enhance the immersive experience of the game.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fikajdan%2Faimwave","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fikajdan%2Faimwave","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fikajdan%2Faimwave/lists"}