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 work with Photon frequently, to create a project template in Visual Studio, so you already have a base to work from instead of recreating the project from scratch each time.
We'll also create a Game
class just as we did with the Ack
server.
using Photon...