This is part 2 of 2 of Development in Shooting Games and in Side Scroller Games. Click on this link for the first part.
In terms of development for the FPS game, there is a few bits of notes to consider, especially when making something like a base for an FPS. There are walls you need to make in the form of colliders and rigidbodies where you need to consider the limitations and the structure of the overall scenario. In an FPS game, its basically player vs AI on the battle to the death with guns, due to its shooting nature.
The structure of what makes an FPS is functioned based off of the shoot-em-up elements in the game is that the basics of shooting an enemy relies on a lot of aspects of functions:
Namely: You do the same as giving an HP system. Weapons get attack system which allows for status changes and that HP is reduced to 0 due to weapon’s shot or attack hits the enemy using triggers and colliders.
To structure it in a scripting format would be concluded as follows:
Use a takedamage function which hits for a float damage. Reduce health based on the damage taken on the float. Apply an if statement which sets such that if hp is less than equal to 0, you gain points, transfer it into your gamecontroller/gamemanager and destroy the game object to prevent the object from keeping itself on the scene. You may add explosion effects, though the scripts for this is advanced and extensive.
Apply the script above to your enemy AI and it will interact as such. You also need to check if it touches the ground at some point, hence you may require a collision check if it stays or exits the area. You have to provide a conditional branch for each function to check if it stays in the area or it leaves the area. Though this is one of the possible scripts that you can put. As open-ended as it seems, you can put your own take on the script and limit it to however you like.
The most important thing is to apply effects of your own and develop different effects based on the corresponding design overall. Applying movement script and attach it onto the player as well as applying a weapon script allows for some massive possibilities to the application of an FPS game. It all comes down to how you work on it. You can check the reference for tutorials on more details covering up on the development of an FPS game from Unity.
From the side scroller side of things, there are a lot of movement scripts to consider. Though from one perspective, one would see that movement is always a necessity and often times can be quite detailed in terms of how one would work out specific details. Due to the vagueness of the game’s genre and style, I’ll be covering this along with a platformer type which will cover some similarities but in different styles and details.
There are two different scripting style we can go about this, but for now we’ll start with the 3D style movement.
When you figured out your basic movements, you can call upon player states as an enumerator construct, called enum, in order to call upon different animation states for different characters. For instance, using idle is the default animation. But when done a specific task, you call upon that component and change the player state to match the task that it was given. Its like giving a specific command to a user of sorts allowing the “character” to act in ways that the command is given.
You then call upon the animation using IEnumerator, allowing foreach functions to work. Meaning that for each function or action you take, it will apply that command.
Apply controls based on the basic functionality of the designs of your game. Check if the object collides with the platform in order for the player to keep them grounded. This allows parent platform to allow the player to stick to a specified area.
Though this is a more 3d formatting. Using a more 2d formatting, you have a more standard formation of colliders and collisions in place.
As an example, using interactions in 2D allows for slightly simpler controls. Though it may be much harder to provide the assets to the way that people would want because of how difficult it is to set up the pieces together. Though it would be of a much simpler control in terms of how the platforms work.
Simple controls such as this replace a great deal towards the grounded on trigger function that is used in the 3d format. Though you need to have the basic foundations for understanding transform functions for this to work.
After this, the steps are yours to command. You can add effects and the like to make things more impactful depending on your interests in developing the game on your own way.
The next development progress will be a defense tower development game. Based on what I can work off of, this may be able to work depending on the context of the situation. But I will cover up as much progress on this as I can, with as much information as I can probably give due to the nature of this assignment.