O'Reilly logo

Unity Multiplayer Games by Alan Stagner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a simple RTS prototype

Using the knowledge we've gained about Player.IO and applying the concepts from the previous chapter, we're going to create a simple RTS style game.

The player will own five bots. Each of these bots can be commanded to move, or attack another bot. The number of bots killed and lost will be recorded (and persisted to the database for a leaderboard).

Upon losing all five bots the player is kicked out of the game to the main menu.

The server-side code

We'll start by modifying the server code as follows:

using System; using System.Collections.Generic; using System.Text; using System.Collections; using PlayerIO.GameLibrary; using System.Drawing; namespace BotWarsGame { public class Player : BasePlayer { public string Name; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required