Multiplayer functionality which allows players to host or join two-player lobbies.
The ability to select the piece’s colour.
A menu which gives the player access to commands which will affect the game.
This was made for an assignment during my Bachelor's degree which had me recreate Snakes and Ladders in Unity and implement multiplayer functionality using Photon Unity Network (PUN).
I used Photon Unity Network to handle the game’s multiplayer aspect. This involved sending Remote Procedure Calls (RPC) which lets the clients (players in the lobby) know the current game state. Examples of this included the rolling of the die animation to ensure all clients saw the same die sides during the animation, moving the pieces, selecting a piece colour, and ending a player’s turn.
When a player presses start the game will look for existing lobbies if there are none then it will host a lobby. When there are two players in the lobby the game starts with the players selecting their piece colours. To avoid the players having the same colour they take turns selecting, with the host getting first pick.
The gameplay follows the standard snakes and ladders rules with players taking turns to roll a die and then moving forward the number they rolled. The first round sees the players roll the die to determine which player gets to start, the highest roll goes first. Landing on a tile which has a snake’s mouth results in the player having to go to the corresponding tile which contains that snake’s tile. Meanwhile landing on a tile which has the base of a ladder sends the player to the top of that ladder. The winner is the player who reaches the final tile first.
The player clicks the die to roll, while the piece is automatically moved to the correct tile, along with performing the necessary actions should it land on a tile containing a snake or ladder.
When a player holds down for 3 seconds they will activate the cheat menu. This menu gives the player access to instantly win the game and force the die to roll a specific number.
Copyright © 2024 Kooldiagon - All Rights Reserved.
Powered by GoDaddy