Зміст курсу
Unreal Engine FPS Game
Unreal Engine FPS Game
Set Up Tiers
The way that we want the difficulty of the game to change is by making the enemies stronger little by little. For this purpose, we are going to count the number of enemies that have been spawned and create three tiers of gameplay. Each tier will set the variable DamageTaken
in our BP_FirstPersonCharacter
to a new value which is higher than the previous one.
We take care of this type of logic in a blueprint called FirstPersonGameMode
. This blueprint automatically runs as soon as we run the game, and therefore is the ideal blueprint for programming this type of logic.
In general, the GameMode
is going to count the enemies, and once the total number of spawned enemies passes a certain threshold, it will set the DamageTaken
to a new value.
Additionally, once we have reached the ceiling of our last tier, the GameMode
communicates to the spawners that they cannot spawn new enemies. Then the GameMode
blueprint will look for the enemies that are alive and with the help of the EnemySpawner
blueprint, we count down this number; once it hits zero
.
If there are no enemies left, the player has won the game. For now, we will just use a Print String to make sure that everything is working, but in the next chapter, we will complete this process by creating the Winning widget and adding it to the viewport.
Дякуємо за ваш відгук!