Tanks Game (Playable Preview)

Hi all.



I am publishing a playable demo of Tanks!



Tanks (Preview 2011-02)



Usage



Download the zip file, uncompress, and double click the jgf.jnlpl file inside. It should work as long as Java Web Start is installed.



Keys



Gameplay is simple. Destroy all enemy tanks. Game will break after mission 4 (there are only 4 missions so far).



W, A, S, D move the Tank, mouse and left mouse button aim and shoot.



Mouse cursor can be shown and hidden during game time pressing ‘M’.



Background



JGF stands for Java Game Framework, an open source framework based on JME. Tanks! is a sample game written on JGF. Still in a very early stage. Artists are asked to contribute. The project now also needs an experienced AI programmer for the Tanks game.



Visit Java Game Framework for more information on JGF.

1 Like

I get an exception when I try to start it (MacBook Pro, OSX 10.6)


BadFieldException[ Das Feld href weist einen ungültigen Wert auf: jgf.jnlp,jgf.jnlp]
at com.sun.javaws.jnl.XMLUtils.getAttributeURL(XMLUtils.java:102)
at com.sun.javaws.jnl.XMLFormat.parse(XMLFormat.java:139)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(LaunchDescFactory.java:84)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(LaunchDescFactory.java:102)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(LaunchDescFactory.java:127)
at com.sun.javaws.Main.launchApp(Main.java:408)
at com.sun.javaws.Main.continueInSecureThread(Main.java:279)
at com.sun.javaws.Main$1.run(Main.java:117)
at java.lang.Thread.run(Thread.java:680)
1 Like

Could you please try modifying the following line in the jgf.jnlp file:



[xml]<jnlp spec="1.0+" href="jgf.jnlp">[/xml]



with:



[xml]<jnlp spec="1.0+" codebase="/path/to/installation/folder/" href="jgf.jnlp">[/xml]



And let me know if you succeed?



Thanks for trying!

Nope, same error.

:frowning: well it’s a JWS error, the application is not launching. I’m sorry I don’t have a MacOS so I can’t try myself :-s.



Try to ensure that the codebase attribute in the jnlp file is correct and points to the folder that contains jgf.jnlp.



This line works for me (in my environment).:Note the triple slash following the file protocol.



[xml]<jnlp spec=“1.0+” codebase=“file:///home/jjmontes/Proyectos/jgf/target/project-skel/target/jws” href=“jgf.jnlp”>[/xml]

Yeah, I tried, doesn’t seem to work… Neither does starting from command line… Maybe a simple jar with manifest would be simpler than this local jnlp stuff? Or upload the webstart somewhere where one can start it directly from the web.

Yes, indeed. But I just happened to have the JNLP stuff working and thought it should just work :(. Launching from command line should work if the classpath includes all jar files in the package, or at least you should be seeing a different exception.



Sorry for the nuisance.



I’ll try to make a better bundle soon, but it will take a few days.

I encountered a different error on Ubuntu 10.10 64-bit GeForce 8600M GT:

java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.javaws.Launcher.executeApplication(Launcher.java:1804)
at com.sun.javaws.Launcher.executeMainClass(Launcher.java:1750)
at com.sun.javaws.Launcher.doLaunchApp(Launcher.java:1512)
at com.sun.javaws.Launcher.run(Launcher.java:130)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1734)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1028)
at org.lwjgl.Sys$1.run(Sys.java:73)
at java.security.AccessController.doPrivileged(Native Method)
at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
at org.lwjgl.Sys.loadLibrary(Sys.java:82)
at org.lwjgl.Sys.(Sys.java:99)
at org.lwjgl.opengl.Display.(Display.java:130)
at com.jmex.editors.swing.settings.GameSettingsPanel.(GameSettingsPanel.java:119)
at com.jmex.editors.swing.settings.GameSettingsPanel.prompt(GameSettingsPanel.java:418)
at com.jmex.editors.swing.settings.GameSettingsPanel.prompt(GameSettingsPanel.java:410)
at net.jgf.jme.engine.JMEEngine.start(JMEEngine.java:203)
at net.jgf.system.Application.start(Application.java:344)
at net.jgf.example.tanks.Tanks.main(Tanks.java:56)
... 9 more
1 Like

Ummm, please try to replace the following line in jgf.jnlp:



[xml] <resources os="Linux" arch="i686"> [/xml]



with:



[xml] <resources os="Linux" arch="x86_64"> [/xml]

Works great on win7 and Ati card

Nice work, it’s nice and fun :wink:

1 Like

Hmmm nope, same error I’m afraid. Will try it on Win7 later though.

Maybe arch=“amd64” would work. Do you happen to know what the os.arch value is for your system?

That did the trick! Had a few goes with it :slight_smile: The water was rendered differently pretty much every time I played the game ^^

Here’s one example though:





I can show a video later if this is an unknown bug (this is why it’s always useful to see a gameplay video made by the game creator, he he). Other than that it worked very well for a preview :slight_smile:

When I tried to download the demo I was receiving this from rapid share:



Unassigned file limit of 10 downloads reached.

Does anybody know of a good file sharing site?

yeh, try http://gamejolt.com its a pretty good host for indiegames. You can upload your game their as a downloadable version or even a jME applet.

Just use your Google Docs. Make your file public, presto!

I have updated the link in the first post. Downloads should work now.

I had to change the jnlp to this for Windows Vista 64bit… (explicit paths to all jars…)



[xml]<?xml version="1.0" encoding="utf-8"?>

<jnlp spec="1.0+" href="file:///Users/AY/Downloads/jgf-tanks/jws/jgf.jnlp">



<information>

<title>Tanks</title>

<vendor>JGF</vendor>

<homepage href="http://code.google.com/p/jgf/"/>

<description>JGF Game</description>

<description kind="short">JGF Game</description>

<offline-allowed />

</information>

<security>

<all-permissions/>

</security>

<resources>



<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/jgf-core-0.6.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/jgf-example-0.6.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/jgf-example-resources-0.6.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/jgf-jme-0.6.jar" />



<!-- <jar href="file:///Users/AY/Downloads/jgf-tanks/jws/jgfapp.jar" /> -->



<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/bsh-core-2.0b4.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/commons-beanutils-bean-collections.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/commons-beanutils-core.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/commons-beanutils.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/commons-collections-3.2.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/commons-configuration-1.5.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/commons-digester-1.8.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/commons-jxpath-1.3.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/commons-lang-2.3.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/commons-logging-1.1.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/commons-logging-adapters-1.1.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/commons-logging-api-1.1.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/commons-net-1.4.1.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/dom4j-1.6.1.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/jakarta-oro-2.0.8.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/jcore.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/log4j-1.2.14.jar" />



<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/jme-audio.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/jme-awt.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/jme-collada.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/jme-editors.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/jme-effects.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/jme-font.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/jme-gamestates.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/jme.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/jmejtree_jme2.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/jme-model.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/jme-ogrexml.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/jme-scene.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/jme-swt.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/jme-terrain.jar" />



<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/lwjgl.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/lwjgl_util.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/lwjgl_util_applet.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/jorbis-0.0.17.jar" />



<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/miglayout-3.7-swing.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/propertytable.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/scenemonitor_jme2.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/sceneworker.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/sm_properties_jme2.jar" />



<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/nifty-1.2.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/nifty-default-controls-1.2.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/nifty-style-black-1.2.jar" />

<jar href="file:///Users/AY/Downloads/jgf-tanks/jws/xpp3-1.1.4c.jar" />



</resources>



<resources os="Windows">

<j2se version="1.5+"/>

<nativelib href="file:///Users/AY/Downloads/jgf-tanks/jws/jme-native-windows.jar"/>

</resources>



<resources os="Mac OS">

<j2se version="1.5+"/>

<nativelib href="file:///Users/AY/Downloads/jgf-tanks/jws/jme-native-macos.jar"/>

</resources>



<resources os="Linux" arch="i386">

<j2se version="1.5+"/>

<nativelib href="file:///Users/AY/Downloads/jgf-tanks/jws/jme-native-linux.jar"/>

</resources>



<resources os="Linux" arch="x86_64">

<j2se version="1.5+"/>

<nativelib href="file:///Users/AY/Downloads/jgf-tanks/jws/jme-native-linux.jar"/>

</resources>



<resources os="Linux" arch="amd64">

<j2se version="1.5+"/>

<nativelib href="file:///Users/AY/Downloads/jgf-tanks/jws/jme-native-linux.jar"/>

</resources>



<application-desc main-class="net.jgf.example.tanks.Tanks"/>



<component-desc />



</jnlp>

[/xml]

Thx!



Erlend, I knew about the water but it’s annoying to see it failing in yet another machine. I don’t really know what’s going on there. Thanks for the screenshot :).