top of page

Week 7: Final touches

The last thing that i have to do in our game is add transition between level scene and the boss fight. This is quite easy so this post will be short and won't have a lot of screenshots. I will post one picture with the code block in it and then walk it trough.

This script must be attached to a object that's not the Player in the Flying scene. The reason behind that is when the player dies the object is that we are disabling the PaperPlane object and this will turn off the script. I will explain why are we disabling it a few lines below.

First we must declare 4 variables: public Texture which will be the image that we display, a counter that checks time, bool flag to let us know when to turn the picture on and instance of the Player.

Then in the Start() function we set the bool to false and we find PaperPlane object. In the Update function we are using the counter. Since Update() calls itself on everyframe it is the perfect timer counter. We need a few checks to see how much frames is good enough for us. I decided to stop the level on 4500 frames. If this condition is met we are displaying the image in front of the screen and disabling the Plane object so the user can't die when he stops seeing the screen. The displaying is done by changing the flag for GUI on true which will call the OnGui() function. After the counter reaches over 6500 we load the BossFight scene. When you are ready with all of that don't forget to drag your image to the inspector.

And this is all. Now we have good looking loading screen for our game.

Featured Posts
Recent Posts
Archive
Search By Tags
Follow Us
  • Facebook Basic Square
  • Twitter Basic Square
  • Google+ Basic Square

Email:
kabadzhg@uni.coventry.ac.uk

bottom of page