Q&A

Q: I have Cell2D set up. Where do I start?

A: Start by understanding the CellGame class. You'll probably want to make a subclass of CellGame to represent your game as a whole.

Q: What's with all of the values of type long?

A: Those values are measured in fracunits. See the Frac class for more details.

Q: How can I make the game wait a certain amount of time before executing some code?

A: Make an Event out of the code and pass it to an appropriate Thinker's setTimerValue() method.

Space

Q: How can I let the player interact with a SpaceState by mousing over/clicking on things in it?

A: Use the CellGame's getMouseX() and getMouseY() methods to find out where the mouse cursor is on the screen. Then, use the appropriate SpaceState or Viewport's getSpacePoint() method to find the corresponding point in the SpaceState's space.

Q: How can I make a SpaceObject stay at a fixed position on the screen?

A: If the SpaceObject is just a display of information about the game world, like a health bar, then you should probably use the HUD class instead. If the SpaceObject represents an actual object in the game world, you can use the appropriate SpaceState or Viewport's getSpacePoint() method to find out where in the SpaceState's space the SpaceObject needs to be.

results matching ""

    No results matching ""