Skip to Content
Killer Game Programming in Java
book

Killer Game Programming in Java

by Andrew Davison
May 2005
Intermediate to advanced
998 pages
26h
English
O'Reilly Media, Inc.
Content preview from Killer Game Programming in Java

An Overview of NetTour3D

Figure 32-2 shows the main objects involved in a NetTour3D world.

The application uses a threaded client/server model, much like the threaded chat application in Chapter 30.

The NetTour3D application is the client. It creates a WrapNetTour3D object to build the world and to handle communication with the TourServer server. The world consists of a checkerboard, background, lighting, and scenery loaded from a tour file with the help of a PropManager object (first used in Chapter 16). No 3D objects or images need to be transferred over the network; all the necessary 3D models are present on the client.

Objects in a NetTour3D world

Figure 32-2. Objects in a NetTour3D world

WrapNetTour3D starts a TouristControls object to monitor the client's key presses, which move the client's local sprite (the ones colored blue in Figure 32-1) or adjust the third-person camera. TouristControls is unchanged from the Tour3D example in Chapter 18.WrapNetTour3D sends messages to the server, and the monitoring of messages coming from the server is delegated to a TourWatcher object. Most of these messages will be related to the creation and movement of distributed sprites (the sprites representing other clients, colored orange in Figure 32-1). TourWatcher manages these sprites and updates them in response to the server's messages.

TourServer creates a TourServerHandler thread for each client who connects to it ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Learning Java Through Games

Learning Java Through Games

Lubomir Stanchev

Publisher Resources

ISBN: 0596007302Errata Page