Interface GameLoop


public interface GameLoop
Interface for building simple games with the SaxionApp. The loop method is the main method that should contain the (re)drawing of your application.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Method that will be executed before the loop starts.
    void
    This method will be called when there is keyboard interaction.
    void
    Method that will be executed every n milliseconds.
    void
    This method will be called when there is mouse interaction.
  • Method Details

    • init

      void init()
      Method that will be executed before the loop starts. Use this method to initialize your state variables. This method can be called again to reset the application. Note: don't do any drawing in this method!!!
    • loop

      void loop()
      Method that will be executed every n milliseconds. This amount can be defined when you start the SaxionApp and adjusted by using the `SaxionApp.setGameLoopTimeMs(int ms)` method.
    • keyboardEvent

      void keyboardEvent(KeyboardEvent e)
      This method will be called when there is keyboard interaction.
      Parameters:
      e - details about the keyboard event
    • mouseEvent

      void mouseEvent(MouseEvent e)
      This method will be called when there is mouse interaction.
      Parameters:
      e - details about the mouse event