Package controller

Class MainController

java.lang.Object
com.badlogic.gdx.ScreenAdapter
controller.MainController
All Implemented Interfaces:
com.badlogic.gdx.Screen, IOnLevelLoader

public abstract class MainController extends com.badlogic.gdx.ScreenAdapter implements IOnLevelLoader
The heart of the framework. From here all strings are pulled.
  • Field Details

    • batch

      protected com.badlogic.gdx.graphics.g2d.SpriteBatch batch
      The batch is necessary to draw ALL the stuff. Every object that uses draw need to know the batch.
    • entityController

      protected EntityController entityController
    • camera

      protected DungeonCamera camera
    • painter

      protected Painter painter
      Draws objects
    • hudBatch

      protected com.badlogic.gdx.graphics.g2d.SpriteBatch hudBatch
      This batch is used to draw the HUD elements on it.
    • hudController

      protected HUDController hudController
    • hudPainter

      protected HUDPainter hudPainter
      Draws hud
    • levelAPI

      protected LevelAPI levelAPI
    • generator

      protected IGenerator generator
      Generates the level
  • Constructor Details

    • MainController

      public MainController()
  • Method Details

    • setup

      protected abstract void setup()
    • beginFrame

      protected abstract void beginFrame()
    • endFrame

      protected abstract void endFrame()
    • render

      public final void render(float delta)
      Main game loop. Redraws the dungeon and calls the own implementation (beginFrame, endFrame and onLevelLoad).
      Specified by:
      render in interface com.badlogic.gdx.Screen
      Overrides:
      render in class com.badlogic.gdx.ScreenAdapter
      Parameters:
      delta - Time since last loop.
    • setSpriteBatch

      public void setSpriteBatch(com.badlogic.gdx.graphics.g2d.SpriteBatch batch)
    • setHudBatch

      public void setHudBatch(com.badlogic.gdx.graphics.g2d.SpriteBatch batch)