Story
A game I made to play with my friends.
The game right now has 1 game mode: Deathmatch - Get the maximum kills possible to win.
In the future I want to add a hide and seek mode and a game mode inspired in CS:GO.
Features
Player Controller
To move/rotate the player I'm using unity's new input system.
| [W] | Forward thrust |
| [S] | Backward thrust |
| [A] | Strafe left |
| [D] | Strafe right |
| [SPACE] | Strafe up |
| [LCTRL] | Strafe down |
| [E] | Roll to the right |
| [Q] | Roll to the left |
Weapon
Now the game has 1 automatic rifle. In the future I want to add more weapons (examples: railgun, pistols).
Round System
The game has a round system, so when the host joins it starts a timer.
When the round timer reaches 0, means the round is over, so it shows the round winner's name. After that, all players go to a random spawn point.
Scoreboard / Kill feed
To make the scoreboard, first I created a script (ScrollViewContent.cs) that instantiates objects inside of a scroll view. After that's done, the ScoreBoardManager uses the first script to instantiate, and manages the score on the table.
[Code] How to instantiate any object inside of a scroll view:
// File: ScrollViewContent.cs
public GameObject AddContent(GameObject prefab)
{
GameObject instantiatedObject = Instantiate(prefab, spawnPosition.transform.parent, false);
RectTransform rectTransform = instantiatedObject.GetComponent<RectTransform>();
RectTransform spawnRectTransform = spawnPosition.GetComponent<RectTransform>();
Rect spawnRect = spawnRectTransform.rect;
Vector3 positionRectTransfrom = rectTransform.localPosition;
rectTransform.sizeDelta = new Vector2(0.0f, spawnRect.height);
positionRectTransfrom.y -= spawnRectTransform.sizeDelta.y * listPrefabs.Count;
rectTransform.localPosition = positionRectTransfrom;
listPrefabs.Add(instantiatedObject);
return instantiatedObject;
}
Console Commands
The player has access to the console, where it can execute specific commands.
Commands example: