Book Image

jMonkeyEngine 3.0 : Beginner's Guide

Book Image

jMonkeyEngine 3.0 : Beginner's Guide

Overview of this book

jMonkeyEngine 3.0 is a powerful set of free Java libraries that allows you to unlock your imagination, create 3D games and stunning graphics. Using jMonkeyEngine's library of time-tested methods, this book will allow you to unlock its potential and make the creation of beautiful interactive 3D environments a breeze."jMonkeyEngine 3.0 Beginner's Guide" teaches aspiring game developers how to build modern 3D games with Java. This primer on 3D programming is packed with best practices, tips and tricks and loads of example code. Progressing from elementary concepts to advanced effects, budding game developers will have their first game up and running by the end of this book.From basic concepts and project creation to building a complex 3D Game, you will learn to layout 3D scenes, make them interactive and add various multi-media effects.You will find answers to common questions including best practices and approaches, how game characters can act and interact, how to simulate solid walls and physical forces, how to take it online to play over a network and much more.From Zero to Hero, start your journey to make your game idea a reality.
Table of Contents (20 chapters)
jMonkeyEngine 3.0 Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – distributing a game


During the development phase, you typically build and run your game right from the jMonkeyEngine SDK. Your users, however, neither have nor want the SDK. They expect to run the game by, for instance, executing a desktop application that runs on their Java Virtual Machine.

Switch to the Files window, and look into the dist folder. Every time you Build this project, the SDK generates an executable JAR file here. When you right-click on the project and choose Clean, the dist folder is deleted—so remember never to move any unique files there.

Let's go through the basic deployment process together:

  1. Right-click on the BasicGame project in SDK, and open the project's Properties window.

  2. Go to the Application | Desktop pane and select the checkboxes for your target operating systems, for example Windows, Mac, and Linux. Click on OK.

  3. Right-click on the BasicGame project, and Clean and Build it.

Look into the Output window to follow the build process.

What just happened?

When the build is finished, switch to your operating system's file explorer:

  1. Browse to the jMonkeyProjects/BasicGame/dist/ folder in your user home.

  2. Unzip and run the BasicGame executable for your operating system.

  3. The application window opens and displays the blue cube demo. Press the Esc key to quit.

This exercise shows you that the SDK generates distributable builds of your BasicGame project that runs fine on your desktop, outside the jMonkeyEngine SDK.

Impressive—you have just built a basic 3D application that runs on the three most widely used operating systems. Notice how you didn't have to configure any CLASSPATH or library paths.