Disclaimer: I'm new to GWT/PlayN, so this might be an obvious mistake that I'm making.
When I have a basic (starter) PlayN project, my BlahGame
class method implements the Game
interface, which requires three methods: init
, paint
, and update
. The starter class looks something like:
public class BlahGame implements Game {
public void init() { ... }
public void paint(float alpha) { ... }
public void update(float alpha) { ... }
}
I created a BaseGame
class to implement game, like so:
public class BaseGame implements Game {
public void init() { ... }
public void paint(float alpha) { ... }
public void update(float alpha) { ... }
}
My main game class then became a sublass of BaseGame
like so:
public class BlahGame extends BaseGame {
public void init() { ... base.init(); ... }
}
Everything compiles and works from Java. But when I try to GWT-compile the HTML version of my game, I get this error:
com.google.gwt.dev.jjs.InternalCompilerException: Failed to get JNode
at com.google.gwt.dev.jjs.impl.TypeMap.get(TypeMap.java:140)
at com.google.gwt.dev.jjs.impl.TypeMap.get(TypeMap.java:71)
at com.google.gwt.dev.jjs.impl.BuildTypeMap.getType(BuildTypeMap.java:730)
...
[ERROR] <no source info>: public class com.deengames.BaseGame
extends java.lang.Object
implements : playn.core.Game
/* methods */
public void <init>()
public void init()
[unresolved] public void paint(float)
[unresolved] public void update(float)
[unresolved] public int updateRate()
I'm not sure what I'm missing here. Is it that some GWT classes need to be updated? Or is it something else? I had expected the HTML vesrion to compile since the Java version compiles; the signatures of the classes shouldn't change from subclassing.
Edit: I'm using a brand new, boilerplate PlayN project. In the class, if I extend the base class AND implement the interface, it still doesn't compile; only removing the base class extension works.