top of page
Search

Dev Log#29: Implementing Teams

I created a new game mode class to implement Team deathmatch.


Game state class responsible for scores and the Team's player states
Game state class responsible for scores and the Team's player states

Before creating the game mode class it was important to set up this class as it's where the the teams scores are being replicated and the Team arrays will be accessed a lot in the game mode class.

I'm overriding these functions from the parent class of ATeamsGameMode which is EverzoneGameMode
I'm overriding these functions from the parent class of ATeamsGameMode which is EverzoneGameMode

I have implemented friendly fire via the calculate damage function. what happens is the damage the player receives will be passed into this function and if the attacking player belongs to the same team as the player receiving the damage. I'm overriding the damage variable and changing it to 0. A player can still eliminate themselves via not making this change.

A lot of games have friendly fire as togglable in custom games its often an option people can enable or disable. So if I wanted to take this one step further I could create a boolean for friendly fire. If I wanted to do friendly fire based on the game mode I could create the boolean on the game mode class, then enable and disable it via what the current game mode is. Then pass this boolean into the calculate damage function and add another conditional statement if true do damage else change the damage variable to 0.


How I'm assigning players to teams when the game starts
How I'm assigning players to teams when the game starts

 
 
 

Comentarios


bottom of page