Free Programming Books
Free download ebooks on computer and programming | |||
Free Java Ebook "Advanced Java Game Programming" Sample Chapter
Adv. Java Game Programming
Download chapter
Download Chapter 1: Development Setup Advanced Java Game Programming teaches you how to create desktop and Internet computer games using the latest Java programming language techniques. Whereas other Java game programming books focus on introductory Java material, this book covers game programming for experienced Java developers. David Wallace Croft, founder of the Game Developers Java Users Group (GameJUG), has assembled an open source reusable game library-a Swing animation engine that allows developers to use these techniques and put out new games very rapidly. The open source game library also includes a reusable game deployment framework and a multiplayer networking library with HTTP firewall tunneling capability for applets. All of the code is open source, including the example games. The animation has been scrupulously tested and optimized in the Swing environment, and Croft clearly explains how the code works in great detail. The graphics and audio libraries used in the examples are public domain and may also be used royalty-free for creating new games. Sticking to the CoreThe J2SE defines a standardized application programming interface (API) library with thousands of classes grouped into scores of packages that are considered core. The core classes are guaranteed to be pre-installed on any J2SE-compatible system. This makes the life of a developer much easier because it means less code that needs to be downloaded and installed to the client platform. An example of a core package is java.lang, which contains the basic classes needed in most Java programs. Noncore classes are not guaranteed to be pre-installed on the target platform, so you will probably want to think twice before using them. These non-core classes are known as optional packages. Until recently, they were called standard extensions. They are "extensions" in that they are not distributed with the core, and they are "standard" in that they define standardized interfaces for additional capabilities independent of their underlying implementation. An example of an optional package is javax.media.j3d, a library for rendering a 3D scene graph. It used to be that you could easily tell which packages were core and which were standard extensions because the core package names all started with the java prefix and the standard extension names all started with the javax prefix. This is no longer the case as the core now contains packages that start with names other than java such as javax.swing. I am not sure why Sun Microsystems changed this but I suspect it had something to do with the Microsoft lawsuit. I know that the switch continued to confuse even high-level Sun engineers for some time after the decision was made. At some point they will have to give the Java library a complete overhaul. Perhaps they will call it the Java 3 Platform, Version 2.0. When they do so, I hope they consider changing the package naming convention back to the way it was. Most of the example game code relies upon the core classes exclusively. This ensures that they will run without additional installation steps on all J2SE platforms. A few of the games, however, do rely upon the optional packages. In these cases, I will warn you. The subset of the J2SE for smaller platforms such as embedded devices is the Java 2 Micro Edition (J2ME). The superset for heavy-duty platforms such as application servers is the Java 2 Enterprise Edition (J2EE). This book does not cover J2ME and only covers J2EE lightly. Where you need to use J2EE code, I will forewarn you just as I will when you use optional packages. | |||