jgame-20110425
所属分类:游戏引擎
开发工具:Java
文件大小:17463KB
下载次数:62
上传日期:2011-07-06 13:06:43
上 传 者:
yuwin136
说明: no intro
(JGame is an open source 2D game engine that makes multiplatform development easier. It runs on the Java JRE 1.3+ platform with optional OpenGL (JOGL) enhancements, the J2ME (MIDP2.0/CLDC1.1) mobile platform, and the Android (2.1+) platform. There is also a Flash (Actionscript 3) version. It provides a very high-level framework, enabling "classic" type arcade games to be developed with a minimum of code and effort. It is based on sprites with automatic animation and collision detection, and a tile-based background with easy sprite-tile interaction facilities. Games are programmed at a fixed "virtual" resolution, but can be scaled to any screen resolution. The engine provides an enhanced graphics API, with a fallback to simpler and more efficient graphics on J2ME and plain JRE. The API also includes sound and persistent storage.)
文件列表:
JGame (0, 2011-04-26)
JGame\smallgames.jar (590367, 2011-04-26)
JGame\PubManMidlet.jar (55982, 2011-04-26)
JGame\skeleton (0, 2011-04-26)
JGame\skeleton\MyGame.java (2561, 2011-02-13)
JGame\skeleton\make-midp-mygame-preamble (167, 2010-09-21)
JGame\skeleton\icons24x24-d-tr.png (1361, 2010-09-21)
JGame\skeleton\make-jre-mygame-postamble (541, 2010-10-03)
JGame\skeleton\icons8x8-d-tr.png (956, 2010-09-20)
JGame\skeleton\res (0, 2011-02-13)
JGame\skeleton\res\drawable-mdpi (0, 2011-02-13)
JGame\skeleton\res\drawable-mdpi\icon.png (2574, 2011-02-13)
JGame\skeleton\res\drawable-ldpi (0, 2011-02-13)
JGame\skeleton\res\drawable-ldpi\icon.png (1723, 2011-02-13)
JGame\skeleton\res\drawable-hdpi (0, 2011-02-13)
JGame\skeleton\res\drawable-hdpi\icon.png (4147, 2011-02-13)
JGame\skeleton\res\values (0, 2011-02-13)
JGame\skeleton\res\values\strings.xml (108, 2011-02-13)
JGame\skeleton\res\layout (0, 2011-02-13)
JGame\skeleton\res\layout\main.xml (384, 2011-02-13)
JGame\skeleton\icons32x32-d-tr.png (1384, 2010-09-21)
JGame\skeleton\icons16x16-d-tr.png (1123, 2010-09-21)
JGame\skeleton\make-midp-mygame-postamble (1287, 2010-09-21)
JGame\skeleton\AndroidManifest.xml.preamble (207, 2011-02-13)
JGame\skeleton\media.tbl (6291, 2010-09-21)
JGame\skeleton\manifest_midp_mygame (109, 2010-09-20)
JGame\skeleton\gen-skeleton.sh (2450, 2011-02-13)
JGame\skeleton\build.properties (819, 2011-02-13)
JGame\skeleton\make-jre-mygame-preamble (80, 2010-10-03)
JGame\skeleton\make-android-mygame-preamble (148, 2011-02-13)
JGame\skeleton\AndroidManifest.xml.postamble (515, 2011-02-13)
JGame\skeleton\make-android-mygame-postamble (611, 2011-02-13)
JGame\Ogrotron.jar (380359, 2011-04-26)
JGame\dingbats.jnlp (777, 2010-04-11)
JGame\jgame-signed.jnlp (720, 2010-04-11)
JGame\MunchiesMidlet.jar (70979, 2011-04-26)
JGame\LICENSE (2119, 2011-04-05)
JGame\DungeonsOfHackMidlet.jar (60121, 2011-04-26)
JGame\CavernsOfFire-release.apk (1596831, 2011-04-26)
JGame\make-midp-spacerun.bat (1268, 2010-04-11)
... ...
---------------------------------------
JGame - a Java game engine for 2D games
---------------------------------------
----F U N D R A I S E R-------------------------------------
Want to support JGame development?
DONATE NOW at http://www.13thmonkey.org/~boris/jgame/
------------------------------------------------------------
By: Boris van Schooten, schooten@cs.utwente.nl
Website: www.13thmonkey.org/~boris/jgame/
Version: 3.5, 25 apr 2011 (20110425),
JRE (personal computer) platforms:
Java 1.3 or higher; 250Mhz+ with 2D graphics acceleration recommended
for the example games.
Tested on: Linux, FreeBSD, NetBSD, Windows, MacOS X,
Java 1.3.1, 1.4.2, 1.5.0, 1.6.0,
Sun/Oracle JDK, OpenJDK
JOGL (opengl) platforms:
Java 1.4 or higher; 500Mhz+ with 32Mb 3D graphics acceleration recommended
for the example games.
Tested on: Linux, Windows, MacOS X, NetBSD
Java 1.4.2, 1.5.0, 1.6.0
J2ME (MIDP, mobile) platforms:
MIDP2.0/CLDC1.1
Tested on: WTK2.5.x emulator, Sagem My401C, My411X, Sony Ericsson K320i,
T-Mobile Vairy Touch II, Samsung GT-B7610
(I am looking for more test platforms!)
Android platforms:
Eclair/2.1, Froyo/2.2
Tested on: emulator, Archos A28, HTC Desire
Distribution license: Revised BSD license (see LICENSE)
Description: JGame is a small 2D game engine that makes multiplatform
development easier. It runs on the Java JRE 1.3+ platform, the J2ME
(MIDP2.0/CLDC1.1) mobile platform, and the Android (2.1+) platform. It
provides a very high-level framework, enabling "classic" type arcade games to
be developed with a minimum of code and effort. It is based on sprites with
automatic animation and collision detection, and a tile-based background with
easy sprite-tile interaction facilities. Games are programmed at a fixed
"virtual" resolution, but can be scaled to any screen resolution. Graphical
enhancements are available through OpenGL and on the Android platform.
Features:
* Multiplatform.
- Tested on various platforms.
- Can easily be run as applet, from a jar, or as a webstart.
- Games can be run on the J2ME and Android platforms without requiring
changes in the code.
- Games can be run both with and without 3D accelerated back-end, catering
to both basic and high end platforms. So, graphics run efficiently on
MIDP while OpenGL and Android platforms enable extra graphical effects.
- You can program a game at one resolution, but it can be scaled to any
desired resolution when run. Scaling preferences enable precise control
of scaling under J2ME and Android.
* Highly optimised.
- Implementation ensures optimised and accelerated graphics for a
variety of platforms without requiring extra packages; even works well on
remote X11 displays.
- Code is optimised for maximum speed and minimum object creations so it
works well on slower machines such as mobiles.
- Provides very efficient multidirectional scrolling on all platforms.
* Easy handling of sprites and animations.
- Built-in sprite animation
- Load sprites, tiles, and colour fonts directly from sprite sheets.
- Define images, animations, and sounds in a text file.
* Tile-based background handling, with decorative backdrop.
- Scrolling using a virtual screen / viewport model
- Built-in playfield wrap-around facility
- multilayer parallax backdrop and zooming/rotating view in OpenGL
* Automatic collision detection with sprites and background tiles, and
easy background tile interaction.
* Channel-based sound system with sound enable/disable built in
* Can run at both fixed frame rate and variable (video synchronised) frame
rate; built-in facilities for making variable frame rate easier to use.
* A state machine model for in-game sequences.
* A local store API for saving user info / save games
* A standard game state machine and some standard game objects are provided.
* Standard highscore table functions are provided.
* Debugging facilities, which include: visualising bounding boxes, printing
debug messages next to an object on the playfield.
* A web-based game generator for generating prototype games without any
programming (under development).
To do, fixes:
* line number does not take into account lines skipped by readline
* test drawPolygon more thoroughly
* make local store suitable for multi-midlet suites (i.e. multiple stores)
* make jgame canvas resizeable (currently only works on android)
* refactor init() and other duplicate code
* refactor common StdGame functions to superclass
* ensure exit dialog always on top -> can only be done in java 1.5+
* ensure taskbar does not obscure playfield
* file a bug report for the bugs in TextRenderer, which sometimes refuses to
render whitespace and sometimes garbles the result completely.
* file bug report about crashes in glBlendFunc
* look at possibility of non-integer scroll and drawing/sprite offsets, and
compatibility between them. In JOGL, even scaled offsets may be noninteger.
* add a flip x/y function for OpenGL images
* add image getsize, existsImage to JGEngine interface
* sprite textures should have transparent 1-pixel border around them,
otherwise strong magnification will not look right around the borders
* fix scrolling bug on MacOS. I found that there is something wrong with the
bounds of the copied bg areas.
* fix scaling artifacts on MacOS. I found that graphics may get scaled to the
wrong background colour so you get whitish borders around graphics. This
may be a Macos bug; the behaviour is not always reproducible and sometimes
plain erroneous.
* more complete MIDP support: highscores, font size/style, debug facilities.
* implement MIDP hideNotify/showNotify?
* give error when setCanvasSettings or setScalingPreferences are set at the
wrong point
* There is no warning in dbgShowBoundingBoxes that a bbox is not defined
* image maps are sometimes loaded every time an image is extracted? This may
be caused by loadImage not loading the image into a buffered image, and the
unbuffered image being uncached by the system. Check this out!
* appletviewer may give security exceptions when loading a jar from the local
filesystem
* fix the ugly volatileimage code which doesn't work in applets by means of a
conditional compile scheme
* fix the font alignment problem which aligns vertically according to text
height, making alignment dependent on the particular letters used.
To do, new features:
* dynamic depth sorting (by depth value)
* implement canvas layer for drawing arbitrary persistent background
* option to turn off automatic scaling
* shorthands for handling sequences in the sprite table file
* Port the gamegen concept to a more general non-PHP implementation. The
basic work has been done, but is not yet presentable.
* further extend the library of standard objects, and include them in the
gamegen framework
* animated tiles
* add scaling to image definition operations
* full multiple background layer support?
* autodetect OpenGL / switch between OpenGL/AWT runtime
---------------------
Running and compiling
---------------------
The installation comes with pre-compiled classes and Jars. This section
explains what they are and how to use them.
JRE base classes
----------------
* jgame-jre.jar: Java 1.3 classes of JGame library
(you can include the jar in your classpath)
* jgame-jogl.jar: Java 1.4 classes of JGame, using the JOGL (OpenGL) extension
(you can include the jar in your classpath)
People using Java 1.2 have to recompile the classes (see also the notes
below).
If you want to use JOGL, you have to install it first. You need JOGL JSR 231.
This is the new JOGL released by Sun (javax.media.opengl). There is also an
older JOGL (net.java.games.jogl) which is not suitable. Download it from:
https://jogl.dev.java.net/
It has no installer. You can just put the jars in JAVA_HOME/jre/lib/ext, and
the native code libraries in JAVA_HOME/jre/bin, though the README discourages
this (version clashes may occur). An alternative is to set CLASSPATH to point
to the Jars, and pass -Djava.library.path=
to pass the
location of the native libraries to Java. Or:
java -cp PATH_TO_JOGL_AND_GLUEGEN_JAR -Djava.library.path=PATH_TO_NATIVE_LIBS
YOUR_JOGL_APPLICATION
To recompile the JRE base classes and jars (without JOGL):
./make-base (that will be .\make-base or just make-base on Windows)
To recompile the JRE base classes and jars with JOGL backend (you must have
JOGL installed):
./make-base-jogl (.\make-base-jogl or just make-base-jogl on Windows)
JRE applications
----------------
* jgame-all.jar: all examples plus the launcher (without JOGL). Start using:
java -jar jgame-all.jar
You can run individual examples using:
java -classpath jgame-all.jar:. examples.
You can run the examples with OpenGL by putting the JGame-JOGL classes before
the regular classes in the classpath, so that they get loaded first, like so:
java -cp $CLASSPATH:jgame-jogl.jar:jgame-all.jar examples.Launcher (unix)
java -cp %CLASSPATH%;jgame-jogl.jar;jgame-all.jar examples.Launcher (dos)
Here, we assume that you use CLASSPATH to point to the JOGL base classes.
This "class overriding trick" may not work in all cases. Alternatively, you
can recompile the jars for JOGL.
To recompile the JRE examples, tutorials, gamegen, and generate the example
jars:
./make-base
./make-apps (creates the JRE version)
./make-base-jogl
./make-apps-jogl (creates the JOGL version)
Ogrotron and cavens of fire have a new-style package tree. These can be
created separately using:
./examples/ogrotron/make-jre
./examples/cavernsoffire/make-jre
Note that the script must be called from the JGame root directory.
Here's an overview of the individual example game classes:
x examples.nebulaalpha.NebulaAlpha - minimal game using base classes only
examples.Insecticide - example tile-based game using base classes only
examples.ChainReaction - example mouse-based game using base classes
examples.SpaceRun - minimal game using StdGame framework w/ defaults
examples.SpaceRunII - minimal game using StdGame with customisation
examples.SpaceRunIII - minimal game illustrating scrolling
x examples.Munchies - example game using StdGame framework
x examples.waterworld.WaterWorld - example game using StdGame framework
x examples.Ramjet - example game using StdGame framework
x examples.packetstorm.PacketStorm - example game using StdGame framework
x examples.ogrotron.Ogrotron - example game using StdGame framework
x examples.cavernsoffire.CavernsOfFire - example game using StdGame, scrolling
x examples.matrixminer.MatrixMiner - uses StdGame and Std... objects
examples.PubMan - uses StdGame and Std... objects
examples.DungeonsOfHack - uses StdGame, Std... objects, scrolling
examples.guardian.Guardian - uses StdGame, scrolling
examples.dingbats.Dingbats - JOGL game
(x) - game has (some) sound
The desired screen size can be supplied as command line parameters to most of
the applications. If no size is specified, full-screen is assumed. All
applications can be quit by pressing Shift-Esc (this is a standard JGame
feature).
* jgame-gamegen.jar: the (web-based) game generator. For more information
about this program see the subdirectory gamegen/
* smallgames.jar: the smaller games in one jar, for running as applets.
* nebulaalpha.jar, matrixminer.jar, waterworld.jar, packetstorm.jar,
guardian.jar, CavernsOfFire.jar, Ogrotron.jar: the larger games come in
separate packages. Start with java -jar .jar
* dingbats.jar: JOGL version of dingbats (is compiled by jgame-apps-jogl
only). Can be webstarted using dingbats.jnlp.
* html/: HTML for running the games as applets. Try:
appletviewer html/applet--.html
* tutorial/: a tutorial in 9 simple example applications, illustrating the
different features of the game engine. The code is self-documenting.
MIDP base classes
-----------------
* classes-midp/: java 1.3 classes of the JGame API for MIDP.
Note, to run a MIDP game you have to put all classes and resources in a single
Jar, and provide a manifest file with the right data (see section "software
development").
To recompile the MIDP base classes, you must set the WTK_HOME variable to
point to your WTK install. Then you can use:
./make-midp-base
MIDP applications
-----------------
* Midlet.jar and .jad are the Midlet versions of some of the games.
Ensure the WTK_HOME variable points to your WTK install. To recompile the
MIDP examples and generate the JARs and JADs:
./make-midp-spacerun
./make-midp-pubman
./make-midp-munchies
./make-midp-dungeonsofhack
./make-midp-matrixminer
./examples/cavernsoffire/make-midp (new style package tree)
./examples/ogrotron/make-midp (new style package tree)
In DOS, you have to ensure the MIDlet-Jar-Size attribute in the jad is set to
the new jar size. This can be done by using the dir output found in the jad.
In unix, this is done automatically.
The Jars can be shrunk by almost a factor 2 by using proguard (or another code
optimiser). A script doshrinkjar.bat is provided to perform shrinking with
proguard (tested with 3.9 or 4.1). Usage is:
./doshrinkjar [jar-to-shrink-without-file-extension] [manifest-file]
The shrunk jar is written in classes-midp-shrunk. You have to have proguard
installed, and specify the path to proguard in the shell variable
PROGUARD_HOME.
You can compile and shrink all midlets in one go:
./make-midp-apps
The shrunk midlets are compiled into classes-midp-shrunk.
You can run the midlets in the WTK emulator (called runmidlet or emulator), or
download the game to your mobile. Runmidlet is a wrapper around emulator. I
recommend emulator because it shows System.out and System.err. Run it using:
emulator -Xdescriptor:YourMidlet.jad
The easiest way to download the jar to your phone is usually downloading from
the internet, but this usually costs money. Almost all mobiles also enable
applications to be downloaded directly from the PC. However, in some cases
this may be something of a challenge (this may involve, for example, writing
the jars into a hidden directory). Some mobiles use a data cable for this,
some use bluetooth or IRda to transfer files. My own mobile uses a regular
USB mass storage interface. When downloading from the internet, you typically
get the Jad, which then automatically starts download of the Jar. When
downloading from your PC you may require either Jad+Jar or just the Jar.
Android applications
--------------------
* -release.apk are the Android versions of some of the games.
Android makefiles are available only for Caverns of Fire and Ogrotron:
./examples/cavernsoffire/make-android
./examples/ogrotron/make-android
This compiles the APKs to classes-android/bin/. The Android base classes are
not compiled separately. The makefiles are Unix only, I haven't had time to
convert them to DOS.
Javadoc
-------
* javadoc/: the API documentation
To re-generate the javadocs, use:
./make-docs
Gen-skeleton
------------
There is now a skeleton generation (unix/bash) script that generates a
directory with a minimal JGame app in it, with makefiles, a media table, etc.
Note that it does not require any of the platform SDKs to be installed. Run
it like this:
cd skeleton/
./gen-skeleton.sh [path_to_app_dir] [package_name] [main_class_name]
It requires sed, so there is a unix/bash script only and no windows bat file.
Now, ensure that the JGame classes can be found in the root directory where
you run the make scripts. You need the following:
classes-jre, classes-midp, src-base, and src-android.
Complete example usage:
cd skeleton/
./gen-skeleton.sh examples/mygame examples.mygame MyGame
mv examples ../my_directory
cd ..
cp -R classes-jre my_directory
cp -R classes-midp my_directory
cp -R src-base my_directory
cp -R src-android my_directory
cd my_directory
# build JRE version to MyGame.jar
sh examples/mygame/make-jre
# build the MIDP version to MyGameMidlet.jar / jad
export WTK_HOME=/path/to/WTK_root
sh examples/mygame/make-midp
# build the Android version to classes-android/bin/*.apk
export ANDROID_HOME=/path/to/android
sh examples/mygame/make-android
This will create a skeleton and compile it for JRE, MIDP, and Android. Two
JARs named MyGame.jar and MyGameMidlet.jar will be created, plus a Jad. An
APK classes-android/bin/MyGame-release.apk will also be created. Applet and
Webstart are not yet supported (instead, use the instructions below to create
a HTML and JNLP file). Optionally shrink the Midlet Jar using doshinkjar.
--------------------
Software development
--------------------
JGame offers several platform and deployment options which are explained in
this section. Basically, there is the JRE (Java Runtime Environment)
platform, both with and without OpenGL (JOGL) extension, meant for regular
PCs, the J2ME (Java 2 Micro Edition) for mobile phones, and Android for
smartphones. If you want to develop in JRE, you must get the JDK (Java
Development Kit). This includes the javac compiler, the jar tool, etc. You
have to install the JOGL extension separately, if you want to use it (see
above). If you want to develop for J2ME, you must also get the WTK (Wireless
Toolkit), which contains the J2ME base classes, an emulator, the preverify
tool, etc. To run JGame, mobiles need to be CLDC1.1/MIDP2.0 capable. If you
want to develop for Android, you need to get the Android SDK. The next
sections explain how to work with each of the platforms.
Full API documentation is found in the javadoc/ directory; general
documentation about game development and practical issues of working with
JGame are found in the MANUAL file; a tutorial introducing the JGame features
step by step by means of example code is found in the tutorial/ directory.
The example games should also illustrate well how a game may be built with
JGame. More general information about java, games, graphics, etc. you can
find on the JGame website.
For people who want to port their JGame 1 or 2 app to JGame 3, read the
section on porting below.
JRE applications
----------------
Most Java developers are particularly familiar with JRE, and starting software
development should be easy. If you are new to Java, here are some
suggestions. You can start writing your own JGame games by first putting the
jgame package in your classpath. You can do it by adapting the CLASSPATH
variable, so that it points to the JGame classes. You can either point to the
JGame main directory, or point to jgame-jre.jar. For example, using BASH,
stand in the JGame main directory and use:
export CLASSPATH=$CLASSPATH:`pwd`/jgame-jre.jar
In Windows, try:
set CLASSPATH=.; ... ...
近期下载者:
相关文件:
收藏者: