Project Training--Unity Multiplayer Game Development--Part 8

Game Logic of Game Forest Adventure

review

The last few articles mainly involved some code logic and other content of the stand-alone game Fantasy Jump. In this article, we mainly introduce some logic of the game Forest Adventure and the content that needs to be implemented.

content

The game is mainly a racing game, mainly involving two scenes, the first scene is a cartoon style of a forest, and the second scene is a modern style of a city. The pattern is basically the same, this time we mainly introduce the first scene.

Gameplay

The game is mainly a racing type game, the same effect is completed at the same time, and the fastest to complete wins.

Therefore, in this game, we set that each player collects 10 apple props within a certain period of time, and the apple props will be distributed to every corner of the map at different times. There are many ways to find apples, and there are many ways we design to get apples, and we will explain them separately below.

Among them, we have an object that can randomly get 1 or deduct 1 apple, and an object that can randomly get 2 or deduct 2 apples, so that we can decide whether to pick this object by guessing.

The other is to get apples through cool running. For example, we build a ladder through each platform, so that players can climb these platforms by jumping, and finally reach the top. At the top, we set up an apple. Players can Get this apple. In this way, it will not only test the player's control ability, but also test the player's eyesight, find the starting point of the cool run, control the character, complete the cool run, reach the end point, and get the apple.

There is another way to get apples, but it is also risky. That is, we placed three monsters on the map. There are apples around the monsters, and the player needs to get the apples without being touched by the monsters. Otherwise, once the monster catches up with the player, the number of apples for the player will decrease. , Therefore, players need to avoid monsters as much as possible, look for apples, and collect them as soon as possible to reach the end.

game picture

The following mainly introduces the main scene pictures of this game.
There are three types of props
Apple Props
insert image description here

Barrel props
insert image description here

box props
insert image description here

With characters and monsters

The character adopts the model of a little fox
insert image description here

The monster uses the four-legged monster model
insert image description here

The resources of the overall scene use the free resources in the assert store of unity to build the scene by yourself

game script

The game mainly uses the character control that has been downloaded from the store and has been written. Because of the needs of the scene, we have carried out the operation of changing the model to achieve the match between the scene and the character.

The game has a global control script, which is mainly responsible for the overall situation of the game, including scene switching, start, character prop generation, game end and other functions.

There is also a character control script, which is responsible for handling character events, including the effects of touch and so on.

At the same time, the character's self-moving script is required, which is responsible for the processing of movement and animation, as well as the follow-up of the camera.

Summarize

This time mainly introduces the gameplay and type of the game, as well as the main functions of the script. Multiplayer is introduced below.

Guess you like

Origin blog.csdn.net/qq_53259920/article/details/125137889