The second iteration work record

The second iteration work record

 

A music player singleton

Music player singleton included in the MVC framework, inherited from the first round of the iteration has been created MonoSingleton, it has AudioSource (audio source component) m_Bg types of background music and sound effects m_effect , and resource directory Reso. Among them, methods are:

① Awake: music player singleton initialization.

PlayBG ② (background music): This method takes String type audioName parameters, determine whether the music currently being played needs to be replaced, use of resources Reso load and play music while playing music.

③ PlayEffect (Audio Playback): This method takes String type audioName parameter is determined without directly using Reso loading resources and a sound.

 

Second, the scene of obstacles

  Obstacle is the base class Obtacles class that inherits from ReusableObject, which parent generation effects, also defines a number of virtual methods to achieve such effects is generated, sound, recycling.

① fence

Fence divided into high, medium and low, can only be bent by high fences, jump through the low fence only, while the fence with these two methods can be adopted. Collision detection is determined by the Player will tag (Tag) is generated if the player strikes the obstacle, and sends a message (if there is a collision, transmitting location information of the collision) to produce the act related classes.

When the player encounters an obstacle, these cases will appear: slow down, special effects, sound effects and recovery. Decelerated by Player is completed, and thus the method comprising the barrier class actions:

A. Effects: coroutine by turning, it is automatically recovered to produce striking effects of a period of time ( Effect class).

B. Sound: by playing music singleton play sound PlayEffect method.

C. Recovery: Direct use Unspawn recovered, the first location information is initialized prior to recovery of the sub-pool.

② container

Container divided into two types, one is the only escape container, dead on impact, and the other is uphill walk containers, also jumped from above, but if you move the container from the side direction, collision and death.

Where the player has encountered situations and fencing container of similar, but different sound, while collision resulting in death, so send EndGame event, replace the UI interface to death, such an event will be sent after the game the player dies.

③ car

Automobile divided into two types, one is the non-moving car, it has the same properties and container, can be moved to another car, via the trigger operation.

Movable automobile disposed at a distance ahead of the vehicle detected crash box, when the player enters the area, i.e. away from the car to a certain distance near the front driving car.

Collision to special effects, sound processing and recycling of containers and when the car is similar, not repeat them.

④ pedestrian

When the player enters the trigger region pedestrian, generating a trigger detection, pedestrian notification message received from the roadside ran across, during running if the player hits a pedestrian is hit fly, the player will slow down production.

Before and similar obstacles, People (pedestrians) inherited Obstacles, rewrite method Awake, HtiPlayer, OnSpawn and OnUnSpawn in the script. When the player encounters a pedestrian, a pedestrian method will achieve special effects, the pedestrian is hit fly (added speed variable x and y axes, and add the video clip fly its components) and recovered. Players Player deceleration is still done in years.

 

Third, reward items

Is the base class bonus items Item class inherits from ReusableObject, we define a number of virtual methods for implementation: generating effects, place is rotated around the y axis, make sounds, and send a message collision recovery.

① gold

And generating a sound when the player gold collision effects (and other items will not be generated collision effects, other items directly recovered). Therefore Similarly, the method by passing in gold class of location information that location effects occur, and Obtacles very similar.

The method also SendMassage, a message to the UI interface, increase the display gold.

② stars

Players get buff after eating the stars, that is, after a period of time to get the number of gold doubled. By accessing GameModel property, get a default set of skills, duration, and then open the coroutine, the number of coins after the end of this time, no longer eat double.

Because it may eat the new stars in the skill duration, skills need to be updated for the duration of the initial value (maximum), you need to open the coroutine former judge coroutine is turned on, if turned on, turning off and re-current coroutine open coroutine.

③ magnet

After the players eat magnets within the skill duration will absorb the gold on the next path.

Players encounter magnet will produce a trigger near the player, once the coins into the trigger range, the player will move to the center, then recovered.

④ finish line

Finish line also is a kind of bonus items, crossing the finish line when the player can continue the game time will be longer. It will directly send message View, add long.

⑤   whistle

Invincible whistle on behalf of the state. When the players eat whistle, at skill duration time, ignoring some of the obstacles (can not ignore such an object container and automobile), judging by the current object collision of Tag whether smallFence and BigFence (fence Tag) to ignore the fence.

Four, UI interface

All UI interface scripts are inherited from the View, to change the interface of gold coins by writing a script to display the value of distance.

① UIBoard interface

UIBoard interface is normal game interface, including a progress bar, displays the acquired gold, has traveled from the display, there is continued progress bar shows the shot button, three skill buttons, three skills when the pause switch, met goal time

② UIFinalScore interface

UIFinalScore interface is the end of the game interface, it is a combination of these parts together: panel background score, score display field, gold coins, from the number of goals and values ​​as well as their background panel, the player's level and experience bar, shopping button , Home button and continue the game buttons.

This interface will be placed so that it can not operate on UIBoard.

③ UIDead interface

UIDead game interface is the interface failure. It shows a background panel, the "bribe referees' instructions word, the required number of coins resurrection, as well as bribery button and exit button.

④ UIPause interface

UIPause pause the game interface is the interface, which shows a background panel, there are players on the current scores, coins, distance, return to the main interface buttons, buttons and continue the game Panda a place to play ball.

 

 

Next iteration goal

1. Increase the facelift system.

2. Increase game elements shot, goalkeeper

3. Increase equipment interface

4. Complete multi-platform release

Guess you like

Origin www.cnblogs.com/oose-rungame/p/11997704.html