How to compile AsteroidPanic game?

Hi,

I downloaded the sources of zay-es using checkout svn and while zay-es compiles fine (by correcting the JDK1.6 to 1.7). AsteroidPanic fails to build. It asked for lemur, I downloaded the sources and tried to add the jar files as libraries. Now its complaining about error in GuiControl.java.

[java] float z = cam.getViewToProjectionZ( cam.getLocation().z );
[/java]

The log on output is as follows::
[java]ant -f C:\Users\Gursimar\Documents\JMonkey\zay-es\examples\AsteroidPanic jar
init:
Deleting: C:\Users\Gursimar\Documents\JMonkey\zay-es\examples\AsteroidPanic\build\built-jar.properties
deps-jar:
Updating property file: C:\Users\Gursimar\Documents\JMonkey\zay-es\examples\AsteroidPanic\build\built-jar.properties
Zay-ES.init:
Zay-ES.deps-jar:
Created dir: C:\Users\Gursimar\Documents\JMonkey\zay-es\build
Updating property file: C:\Users\Gursimar\Documents\JMonkey\zay-es\examples\AsteroidPanic\build\built-jar.properties
Created dir: C:\Users\Gursimar\Documents\JMonkey\zay-es\build\classes
Created dir: C:\Users\Gursimar\Documents\JMonkey\zay-es\build\empty
Created dir: C:\Users\Gursimar\Documents\JMonkey\zay-es\build\generated-sources\ap-source-output
Compiling 37 source files to C:\Users\Gursimar\Documents\JMonkey\zay-es\build\classes
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Zay-ES.compile:
Created dir: C:\Users\Gursimar\Documents\JMonkey\zay-es\dist
Copy libraries to C:\Users\Gursimar\Documents\JMonkey\zay-es\dist\lib.
Building jar: C:\Users\Gursimar\Documents\JMonkey\zay-es\dist\Zay-ES.jar
To run this application from the command line without Ant, try:
java -jar “C:\Users\Gursimar\Documents\JMonkey\zay-es\dist\Zay-ES.jar”
Zay-ES.jar:
Created dir: C:\Users\Gursimar\Documents\JMonkey\zay-es\examples\AsteroidPanic\build\classes
Created dir: C:\Users\Gursimar\Documents\JMonkey\zay-es\examples\AsteroidPanic\build\empty
Compiling 26 source files to C:\Users\Gursimar\Documents\JMonkey\zay-es\examples\AsteroidPanic\build\classes
warning: [options] bootstrap class path not set in conjunction with -source 1.5
C:\Users\Gursimar\Documents\JMonkey\zay-es\examples\AsteroidPanic\src\panic\MainMenuState.java:40: error: cannot find symbol
import com.jme3.audio.AudioSource;
symbol: class AudioSource
location: package com.jme3.audio
C:\Users\Gursimar\Documents\JMonkey\zay-es\examples\AsteroidPanic\src\panic\SinglePlayerState.java:40: error: cannot find symbol
import com.jme3.audio.AudioSource;
symbol: class AudioSource
location: package com.jme3.audio
C:\Users\Gursimar\Documents\JMonkey\zay-es\examples\AsteroidPanic\src\panic\BoundaryState.java:75: error: cannot find symbol
float z = cam.getViewToProjectionZ( cam.getLocation().z );
symbol: method getViewToProjectionZ(float)
location: variable cam of type Camera
C:\Users\Gursimar\Documents\JMonkey\zay-es\examples\AsteroidPanic\src\panic\MainMenuState.java:74: error: no suitable constructor found for Container(SpringGridLayout,ElementId,String)
menu = new Container(new SpringGridLayout(), new ElementId(PanicStyles.MENU_ID), “retro”);
constructor Container.Container(GuiLayout,boolean,ElementId,String) is not applicable
(actual and formal argument lists differ in length)
constructor Container.Container(GuiLayout,String) is not applicable
(actual and formal argument lists differ in length)
constructor Container.Container(ElementId,String) is not applicable
(actual and formal argument lists differ in length)
constructor Container.Container(String) is not applicable
(actual and formal argument lists differ in length)
constructor Container.Container(GuiLayout) is not applicable
(actual and formal argument lists differ in length)
constructor Container.Container() is not applicable
(actual and formal argument lists differ in length)
C:\Users\Gursimar\Documents\JMonkey\zay-es\examples\AsteroidPanic\src\panic\MainMenuState.java:80: error: cannot find symbol
start.addCommands(Button.ButtonAction.HighlightOn, new Highlight());
symbol: variable HighlightOn
location: class ButtonAction
C:\Users\Gursimar\Documents\JMonkey\zay-es\examples\AsteroidPanic\src\panic\MainMenuState.java:84: error: cannot find symbol
exit.addCommands(Button.ButtonAction.HighlightOn, new Highlight());
symbol: variable HighlightOn
location: class ButtonAction
C:\Users\Gursimar\Documents\JMonkey\zay-es\examples\AsteroidPanic\src\panic\MainMenuState.java:118: error: package AudioSource does not exist
if( music == null || music.getStatus() == AudioSource.Status.Stopped ) {
C:\Users\Gursimar\Documents\JMonkey\zay-es\examples\AsteroidPanic\src\panic\PanicHudState.java:136: error: cannot find symbol
FillMode.EVEN, FillMode.FORCED_EVEN));
symbol: variable FORCED_EVEN
location: class FillMode
C:\Users\Gursimar\Documents\JMonkey\zay-es\examples\AsteroidPanic\src\panic\SinglePlayerState.java:280: error: package AudioSource does not exist
if( music == null || music.getStatus() == AudioSource.Status.Stopped ) {
Note: C:\Users\Gursimar\Documents\JMonkey\zay-es\examples\AsteroidPanic\src\panic\MainMenuState.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
9 errors
1 warning
C:\Users\Gursimar\Documents\JMonkey\zay-es\examples\AsteroidPanic\nbproject\build-impl.xml:918: The following error occurred while executing this line:
C:\Users\Gursimar\Documents\JMonkey\zay-es\examples\AsteroidPanic\nbproject\build-impl.xml:308: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 2 seconds)[/java]

What version of the jME SDK are you using?

I assume the error relates to getViewToProjectionZ? that was added around November last year.

@wezrule said: What version of the jME SDK are you using?

I assume the error relates to getViewToProjectionZ? that was added around November last year.

Latest version
jMonkeyEngine SDK 3.0RC2
Java 1.7.0_25

That’s not the latest version, although it will work if you used the nightly updates for RC2. Otherwise download the 3.0 Release

http://hub.jmonkeyengine.org/forum/topic/jmonkeyengine-3-0-release/

@simar.i3r said: Latest version jMonkeyEngine SDK 3.0RC2 Java 1.7.0_25

I though the ‘Check for updates’ check for SDK updates as well.
But anyway I’m downloading the latest release and will let you know whether it fixes it or not.

Even after the update to 3.0, I’m still not able to build the project.

[java]ant -f C:\Users\Gursimar\Documents\JMonkey\zay-es\examples\AsteroidPanic jar
Building jar: C:\Users\Gursimar\Documents\JMonkey\zay-es\examples\AsteroidPanic\build\assets.jar
init:
Deleting: C:\Users\Gursimar\Documents\JMonkey\zay-es\examples\AsteroidPanic\build\built-jar.properties
deps-jar:
Updating property file: C:\Users\Gursimar\Documents\JMonkey\zay-es\examples\AsteroidPanic\build\built-jar.properties
Zay-ES.init:
Zay-ES.deps-jar:
Updating property file: C:\Users\Gursimar\Documents\JMonkey\zay-es\examples\AsteroidPanic\build\built-jar.properties
Zay-ES.compile:
Copy libraries to C:\Users\Gursimar\Documents\JMonkey\zay-es\dist\lib.
Building jar: C:\Users\Gursimar\Documents\JMonkey\zay-es\dist\Zay-ES.jar
To run this application from the command line without Ant, try:
java -jar “C:\Users\Gursimar\Documents\JMonkey\zay-es\dist\Zay-ES.jar”
Zay-ES.jar:
Compiling 26 source files to C:\Users\Gursimar\Documents\JMonkey\zay-es\examples\AsteroidPanic\build\classes
warning: [options] bootstrap class path not set in conjunction with -source 1.5
C:\Users\Gursimar\Documents\JMonkey\zay-es\examples\AsteroidPanic\src\panic\MainMenuState.java:74: error: no suitable constructor found for Container(SpringGridLayout,ElementId,String)
menu = new Container(new SpringGridLayout(), new ElementId(PanicStyles.MENU_ID), “retro”);
constructor Container.Container(GuiLayout,boolean,ElementId,String) is not applicable
(actual and formal argument lists differ in length)
constructor Container.Container(GuiLayout,String) is not applicable
(actual and formal argument lists differ in length)
constructor Container.Container(ElementId,String) is not applicable
(actual and formal argument lists differ in length)
constructor Container.Container(String) is not applicable
(actual and formal argument lists differ in length)
constructor Container.Container(GuiLayout) is not applicable
(actual and formal argument lists differ in length)
constructor Container.Container() is not applicable
(actual and formal argument lists differ in length)
C:\Users\Gursimar\Documents\JMonkey\zay-es\examples\AsteroidPanic\src\panic\MainMenuState.java:80: error: cannot find symbol
start.addCommands(Button.ButtonAction.HighlightOn, new Highlight());
symbol: variable HighlightOn
location: class ButtonAction
C:\Users\Gursimar\Documents\JMonkey\zay-es\examples\AsteroidPanic\src\panic\MainMenuState.java:84: error: cannot find symbol
exit.addCommands(Button.ButtonAction.HighlightOn, new Highlight());
symbol: variable HighlightOn
location: class ButtonAction
C:\Users\Gursimar\Documents\JMonkey\zay-es\examples\AsteroidPanic\src\panic\PanicHudState.java:136: error: cannot find symbol
FillMode.EVEN, FillMode.FORCED_EVEN));
symbol: variable FORCED_EVEN
location: class FillMode
Note: C:\Users\Gursimar\Documents\JMonkey\zay-es\examples\AsteroidPanic\src\panic\MainMenuState.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
4 errors
1 warning
C:\Users\Gursimar\Documents\JMonkey\zay-es\examples\AsteroidPanic\nbproject\build-impl.xml:924: The following error occurred while executing this line:
C:\Users\Gursimar\Documents\JMonkey\zay-es\examples\AsteroidPanic\nbproject\build-impl.xml:308: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 3 seconds)
[/java]

Most likely, the issue is that AstroidPanic doesn’t compile with latest release of lemur(compiled from sources) very well. The issue is with the Container…

[java] menu = new Container(new SpringGridLayout(), new ElementId(PanicStyles.MENU_ID), “retro”);
exit.addCommands(Button.ButtonAction.HighlightOn, new Highlight());
[/java]

Commenting these compiles the game though and it works fine…

I may have been a bad boy and not checked in all changes to Lemur. I will check it at my next opportunity.

Sorry for the trouble.

no issues :smiley:

It seems that SVN was up to date but maybe you are compiling directly against the Lemur.jar?

If so, I’ve uploaded a new Lemur.jar to the Lemur/release directory and downloading a new one should fix your issue.

Since I use projects like Asteroid Panic as a tool for testing and developing parts of Zay-es and Lemur, I have project to project dependencies instead of direct jars. It makes refactoring across these projects much easier. So for me, Asteroid Panic is always using the latest Lemur without requiring a release.

…so sometimes I forget.