Create 2d online mulitplayer game POC with Java, Netty and FXGL
Recently I wrote about netty in the context of creating a chat room. Chat, like online multiplayer games, are based on client server architecture. I will use here the existing client server implementation that I described in the previous publication. I will introduce POC for online multiplayer games. The POC will consist of two small applications, server and client. This will be a game that allows you to control the movement of the rectangle by using the arrow keys. Two clients will connect to the server. On the screen, the user will be represented as a blue rectangle and his opponent will be a red rectangle (client #2).
What will you learn from this publication?
It will certainly allow you to understand better how online games work. If you are a programmer or want to become one, you can understand how the communication flow in the client-server architecture works and how event propagation from your client to other clients works.
Let’s start by adding the FXGL dependency in pom.xml
<dependency>
<groupId>com.github.almasb</groupId>
<artifactId>fxgl</artifactId>…