Dev Log#29: Implementing Teams
- camjhill737
- Jan 22
- 1 min read
I created a new game mode class to implement Team deathmatch.

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 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.

Comentarios