A Godot 4.5.1 Sharpshooter game of shooting targets and stopping them from getting past the red line.
This is a short game I planned and made to experiment with a different way to plan out and execute my personal projects. The article describing this will will be found on https://rlsoft.dev/.
This game isn't fully feature complete and there may be bugs that appear. But, you can play it from start to finish. I might add onto it later, but maybe not.
What is included within this game.
These are all static/permanent elements to be used when creating the HUD (Heads Up Display). They are made to be moved around and placed wherever you want them on the screen. They are all stand alone and don't require any other Actor to use.
TargetsKilledHUD displays the number of targets killed within the game. This does not auto update. It needs to be set via the setTargetsKilled method. It is used within the Player actor to display and update the value.
TargetsRemainingHUD displays the number of targets remaining with the game and the total number of targets for that wave. This does not auto update. It needs to be set via the setTargetsRemaining method. It is used with the Player actor to display and update the value.
WaveNumberHUD displays the current wave number within the game. This does not auto update. It needs to be set via the setWaveNumber method. It is used with the Player actor to display and update the value.
ShotsRemainingHUD is the the HUD component that renders how many shots are remaining on the screen. This does not auto update. It needs to be set via the setShotsRemaining method. It is used within the Player actor to display and update the value.
ScopeHUD is the HUD component that renders the Scope's crosshairs on the screen. You can modify the Scope Size and thickness. It is used within the Player actor to display on the HUD at the center of the screen.
ZoomHUD displays the current zoom level for the player. This does not set itself. You can set the displayed zoom times amount with the setZoomLevel method. It is used within the Player actor to display and update.
These are the actors/systems/components that are used within the game. They use components from the other sections of the program.
These are the spawnable actors that are used within the game.
aBullet is the bullet/projectile actor that is fired by the player and used to hit targets. It works off of a RigidBody3D object that uses kinematics to soar through the air.
It spawns with a set velocity and a direction that is set by the spawner. Every frame it updates the location/velocity with gravitational acceleration.
It appears after a certain amount of time. It destroys itself if it doesn't hit anything after a certain amount of time.
It checks to see every so many ticks if it hits anything between checks. If it hits something it destroys itself. If it hits a target with a "handleHit" function it sends the info to the target.
It is spawned within the Player actor. It is meant to hit the aTarget actor.
Player is the main player actor that handles input, firing, camera recoil/sway, UI/HUD, and starting the game with GameState.
It is heavily connected to all other components within the game.
aTarget is the target actor that is made to be hit by the projectile. If it is hit it tells the GameState that it has been hit and by how much. If its health drops to 0 it destroys itself and tells GameState
It is mainly connected to the GameState.
GameState is the global game state that is called and handles all game state related updates. Such as starting/restarting the game, telling the player what is going on, recieving updates from the target/player, wave start/stats, etc.
It is mainly connected to aTarget and Player
All of the model materials used within the project. There are no textures it is all done via these materials.
Menus are interactable UI elements that constitute full menus with multiple layers or interactions. They are mainly self contained, but do pull from Popups and have links to other game scenes to load them in.
The MainMenuScene comprises the entire main menu of the game. When it starts it is the first thing you see.
It includes two main menu structures. The MainMenu and the InstructionsMenu. The Main menu is the first thing you see that allows you to view the InstructionsMenu, Start the game, or try to exit the game. The InstructionsMenu is a temporary menu that displays the instructions for the game and allows you to traversa back to the MainMenu or start the game.
This uses the ExitConfirmationPopup to confirm exit.
The PauseGameMenu is the menu that is called by the Player actor when the player pauses the game.
It is a pretty bare bones menu that mainly allows you to unpause or quit the game.
This uses the ExitConfirmationPopup to confirm exit.
Popups are small UIs/Menus that are created via other parts of the program to provide quick information or quick decisions for the player. They are made to be self contained and require no externals. To manage them you use the functions provided in them.
The ExitConfirmationPopup is a quick menu created by menus when they want to confirm the player wants to close the program. If the player does it does close the program by itself.
The GameOverPopup is a quick menu that is created when the GameState has told the player the game is over. It asks if the player wants to quick or start again.
It has a setup function that is called to set a Wave number variable.
This is a quick popup that displays that a target has been hit and where it has been it. It then disappears after a short time.
It has "setCOLOR" functions that allow the target/GameState to set where it hit via color.
This is a quick popup that displays the current wave that is starting for the player. After a short amount of time it disappears.
It has a setup function to set the wave number.