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

Building a star collector game

Our star collector game will be a semi-server-authoritative game. That is, players send move commands (which makes it possible to speedhack, teleport, and so on) but the server gets control over spawning players, stars, controlling star pickup, and other game logic.

Upon joining the server, players are spawned. Players will find stars they can collect. When all stars have been collected, the winner is announced in chat based on the player with the most stars, the stars are re-spawned, and the players reset.

Preparing the class library

Again, we're going to make a class library for our game server. This class library, as before, contains the Peer class and the Application class.

Note

You may find it easier, if you will ...

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