Book Image

JMonkeyEngine 3.0 Cookbook

By : Rickard Eden
Book Image

JMonkeyEngine 3.0 Cookbook

By: Rickard Eden

Overview of this book

Table of Contents (17 chapters)
jMonkeyEngine 3.0 Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Implementing a network code for FPS


Networked FPS games are a genre of games that never seem to lose popularity. In this recipe, we'll look at the basics to get a server and multiple clients up and running. We will emulate a server with a persistent environment, where players can connect and disconnect at any time.

We have the benefit of using some of the code generated in earlier chapters. The code we'll use requires some changes to be adapted to a networked game, but it will again show the benefit of using jMonkeyEngine's Control and AppState classes.

Getting ready

Good recipes to read up on before this are the previous recipes in this chapter (especially Making a networked game – Battleships, on which the architecture relies heavily) and also the Creating a reusable character control recipe from Chapter 2, Cameras and Game Controls, as we will use a similar pattern here for our NetworkedPlayerControl implementations. To avoid repetition, this recipe will not show or explain all of the regular...