![]() ![]() ![]() We'll also add some obstacles to give the players something to navigate around. Next, we'll create some barriers/walls, which will surround our scene and stop tanks from being able to leave the camera boundaries. And set the sorting layer of your Main Canvas to ‘HUD’. We want to create three layers, Shell, Tank and HUD. To set the draw-order of our HUD, select the ‘Main Canvas’ object and then click on the Sorting Layer drop-down menu:Ģ. Most importantly, the HUD needs to be always drawn on top of everything else.ġ. There will be a number of sprites in this game and each of them will need to be drawn on different layers. The only other thing we've done for these text-fields is center the text and align them to fit one above the other.īefore we finish with the game HUD, we need to plan out our sorting layers. Add two UI Text objects to each player’s empty GameObject and name them ‘player_name’ and ‘player_score’.Space these objects equidistant from each other along the HUD bar. For each player, add a new empty GameObject and name the object.This panel should cover the screen from left to right, but only come down a few pixels (we used a height of 50 pixels). Add a new UI Panel to the ‘Main Canvas’ object in the scene hierarchy.To set up your HUD like this, follow these steps: The HUD will therefore look something like this: A second text-field for the number of enemies each player has destroyed.Our game's head-up display (HUD) will contain two pieces of information: We'll focus on five parts for setting up the scene: Once you have the tank-sprites ready, we can move onto the main-game scene. We've set the pixel per unit size to 150 for this tutorial, but you can leave it at 100 if you like. You need to set this texture to the multiple sprite-mode and then split the sprite-sheet yourself using the automatic-splice option. The important texture for this tutorial is the one called ‘tankSprites’. Once you have those assets downloaded, you can add the Textures folder to the Assets folder of your project. THANKS! The assets used in this tutorial are open-source and many thanks to the creator for providing these assets. ![]() In order to follow this tutorial you will need the game-assets available in here. Sending updates about each tank to all other players.We'll be handling all the events and collisions in-game.Then we'll set up the scripts we need to control the game and instantiating our players into the level.To get started, we'll create a scene and set up all of our game-objects such as the spawn-points, tanks, shells, and walls as well as our HUD.If you require Realtime and/or Matchmaking for your game and do not have access under your current plan, please contact us to discuss the Enterprise Pricing Tier. Realtime and Matchmaking Availability? The Realtime and Matchmaking features are no longer available to games created on or after February 19th, 2019, or for games created before February 19th, 2019 that had not yet used these features. RT Project so far? You can download and review the completed project so far and covering the previous tutorials in this section before you attempt this next tutorial. In this final tutorial, we follow the previous one and use the real-time services to create a simple multiplayer game based on Atari’s Tank! (1974). It included a simple introduction to how packets are sent and received using our real-time services. In the previous tutorial, we looked at how to set up a simple chat-system so that players found through the match-making process can communicate with each other. ![]()
0 Comments
Leave a Reply. |