Java[tm] BluePrints for Wireless Gaming Sample Applications 1.0 Early Access > Running the Pre-Built Sample Applications |
These instructions describe how to run the sample applications using the J2ME Wireless Toolkit. The sample applications bundle includes pre-built binaries that you can use to run the sample applications. If you make any modifications to the source code, you'll need to follow a different set of instructions on building the applications.
This sample application is a stand-alone game, so you just need to start the emulator.
If you are using Solaris or Linux:
Bring up a shell prompt.
Change the current directory to
{blueprints.dir}
.
Enter the following command:
$J2MEWTK_HOME/bin/emulator
-Xdescriptor:jbricks.jad
If you are using Windows:
From the Start menu, select Programs > J2ME Wireless Toolkit 1.0.4 > Run MIDP Application....
Using the subsequent file dialog, go to {blueprints.dir}
and open jbricks.jad
.
A phone emulator will appear, at which point you can use the application.
There are two parts to the Java Slugs sample application: A J2ME client, and a server using the J2SE APIs. You need one instance of the server and at least two instances of the client to start a game.
Run the server.
Bring up a shell or command prompt.
Change the current directory to
{blueprints.dir}
.
Enter the following command:
java -jar slugs-server.jar
Run a client.
If you are using Solaris or Linux:
Bring up a shell prompt.
Change the current directory to
{blueprints.dir}
.
Enter the following command:
$J2MEWTK_HOME/bin/emulator
-Xdescriptor:slugs-client.jad
If you are using Windows:
From the Start menu, select Programs > J2ME Wireless Toolkit 1.0.4 > Run MIDP Application....
Using the subsequent file dialog, go to {blueprints.dir}
and open slugs-client.jad
.
Run another client.
The Java Slugs sample application is a two-player game, so you need two emulators running. Just repeat the previous step once more.
You can also run the sample applications using the setup script in the sample applications bundle.
Bring up a shell or command prompt, change the current directory to
{blueprints.dir}
, and type:
setup
.sh
<argument>
(Solaris or Linux)
setup
.bat
<argument>
(Windows)
The following table lists arguments you can use with the setup
script in {blueprints.dir}
, and what using each of
these arguments accomplishes.
Argument | Purpose |
---|---|
emulate-jbricks |
Runs the Java Bricks sample application in the emulator. |
emulate-slugs |
Runs a Java Slugs sample application client in the emulator. |
run-server-slugs |
Runs the Java Slugs sample application server. |