Connecting a client to a server
In order to play a game online, you must first connect to other players. In the early days of computer gaming, this was done with a direct connection from one computer to another. These days, it is far more common for all players involved to connect to a server in order to enjoy multiplayer games. Let's take a look at how to create a server/client relationship using GameMaker.
Getting ready
Since we're going to learn how to connect a client to a server, we're going to need both a client and server. For this purpose, you'll need two different projects open at one time: network_test_server.gmx
and network_test_client.gmx
, each with a single room. You'll need to create specific objects during this tutorial instead of in preparation for it, so make sure you pay attention to the project file you're working with at all times.
How to do it...
- In
network_test_server.gmx
, create an object calledobj_server
. - Add a Create event and drag a code...