Repository navigation
Class list
This page's goal is to provide a comprehensive list of the useful C++ classes within this project.
Please do note that every function and property in this page is declared as public in the code, unless explicitly stated.
This does not have every single property or function from every class, redundant stuff is excluded and built-in functions (like Tick, BeginPlay, etc) are excluded as well, unless heavy logic is done in them.
FWord was made to simply hold a single word in a DataTable row and allow it to be manipulated by other classes later.
The word held by the FWord struct. Default is "".
FWordList, as its name suggests, is made to hold multiple FWords, however it should only hold FWords of the same length.
The data table holding the FWords. No check is made to ensure this Data Table actually holds FWords.
The length of all the FWords in WordList. Again, no check is made to ensure this - such an operation would be quite expensive anyways.
FWave represents a pre-entered Wave of enemies, meaning this structure is only used when data is manually entered and insterted in a data table.
The enemies that will spawn in the wave, in order.
and
are used to determine the time between enemies spawn.
This class is used as a "wrapper" to EnemyBase to allow an arbitrary points value on an enemy, which will be used in the procedural wave generation once the pre-entered FWaves run out.
The enemy to spawn in the wave.
How much points the enemy is worth. This is not used at all when calculating score, only when doing calculations for procedural wave generation.
The base class for the Game Instance. It allows easy access to the word database by other classes.
Fills up the database from a list of FWordList, which is most likely going to be a DataTable.\
Returns a random word in the database with the corresponding length.
The word database itself. While freely accessible, it's recommended to use GetRandomWordOfLength instead.
Other properties are values that need to be preserved through level transitions.
The class responsible for handling everything around the main character - typing, health, money, shooting animation, etc.
This function is called whenever the player needs to lose damage, so it can be called by itself or by any enemies.
This is a protected function, however it needs to be explained due to its involvement in everything.
This function checks if the key pressed is alphabetical, and if so, it compares the letter typed to the next letter in the target word.
Depending on the context, this might be different. As an example, this does not happen if we are in the shop, and handling the key press is left to the shop itself.
Another example is when you complete a word : then the word resets and the gun fire animation starts.
This function starts the gun animation and deals damage to the nearest enemy. For more information on how damage is dealt, please check this page.
As the name suggests, this resets the target word using the function provided by the game instance.
Rotates the player around so the camera is facing the shop.
This is a protected function. It is used by Fire and returns the nearest enemy, or nullptr if no suitable actor was found.
This function is used by the User Interface Widget to show colored text on successful/missed letters.
The word that the player has to type.
The word that the player currently typed. Will never exceed the length of TargetWord.
The health points (HP) and money the player currently has. The player dies if HP is equal to or under 0, after which the scene changes to a leaderboard.
A multiplier on money won by killing enemies.
A multiplier on damage dealt on enemies per correct letter.
Recoil is done in the Tick function, so an explanation is needed.
When Fire() executes, it sets RecoilAmount to the value corresponding to the number of correct letters.
Then, Tick moves the model of the gun in space using and modifying the variables RecoilMovementCurrent and RecoilMovementMult.
The calculation can be found in detail here
The base class for all enemies. Contains a handful of functions as well as some properties that will alter the enemy's behavior when set.
Gets the player. This function is only expensive the first time, as a variable is set and reused for all subsequent calls.
Resets some properties to default values. This is not done in the base class and has to be implemented in the child classes, if needed. Called on BeginPlay
Same as above, this has to be implemented in the child classes if needed, however the base version gives money to the player, so child classes need to call super or implement that another way. Called when the enemy dies, before it's destroyed, so no need to call Destroy() here.
The enemy's current health. default 10.0
The enemy's movement speed multiplier. This is applied on the Character Movement's movement speed, as this class derives from ACharacter. default 0.0
Money gained when defeating the enemy (by default, can be changed in OnDeath). default 0.0
Multiplier for the damage dealt to the player. default 1.0
A simple AI controller class that will just load a BehaviorTree and run it. In this case, the behavior tree just runs a Uk3ShooterTaskNodeMoveToPlayer node.
Despite being named like so, this task node doesn't actually move to the player and leaves this to the "Move To" tree node. All this does is set a blackboard variable to the player position.
Object used to handle interactions regarding the shop - it acts as a proxy between the player character and the shop items.
Called by Ak3ShooterCharacter, this handles the key presses differently than the player, however checking if the key pressed is alphabetic is done by the character so this is already a guarantee.
After typing a letter, if the word typed corresponds to one of the Shop Items, it tries to buy it.
A StartsWith implementation for FString, used by OnKeyPress to compare words.
The currently typed word. It can't be something that isn't the start of an item.
The items registered in the shop. This array fills itself with all items in the scene on BeginPlay.
Items that will appear in shop. This is the base class for an item, it shouldn't be used by itself.
Checks if the player has enough money to buy the item, then calls Buy() if so
This is a private function. This doesn't do any checks and runs the effect of the item immediately. This is not implemented in the base class and needs to be in child classes.
The word that needs to be typed to buy the item.
The price of the item.
This is the enemy spawner object, both in logic and on the map. It's the class that loads pre-entered waves, but it's also the class that procedurally generates waves.
This is an override on the built-in Tick function, all the spawning logic is done in there. For more information on that, you can check the dedicated page, but in short, we check if the player is on a break (= at the end of a wave and all enemies dead), if not, we check if it's time to spawn an enemy yet, and if so we spawn an enemy according to the data.
Used for procedural wave generation. Gets a random enemy from the list, based on how many points are left for enemy spawn. More info on waves available here.
The DataTable object with the pre-entered waves info. The waves are FWaves.
The zone in which enemies are allowed to spawn. They will spawn at a random point within the bounds of the box.
True if we're on a break, else False.
Time left before the break ends. Decreases in Tick according to DeltaTime.
Current wave number.
Current wave. Only used when in waves with pre-entered wave data.
Time until next enemy spawn.
Current points of this wave, used for procedural generation.
The enemies available to use for procedural wave generation.