Class GameElement

java.lang.Object
de.tum.cit.ase.maze.objects.GameElement
All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
Direct Known Subclasses:
Character, Collectable, Entry, Exit

public abstract class GameElement extends Object implements com.badlogic.gdx.utils.Disposable
This class is the common superclass for all game objects
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected com.badlogic.gdx.physics.box2d.Body
    Represents the physics body
    protected com.badlogic.gdx.graphics.Texture
    Defines the texture of the object
    protected com.badlogic.gdx.physics.box2d.World
    Saves the box2d world
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract void
    render(com.badlogic.gdx.graphics.g2d.SpriteBatch spriteBatch)
    Renders the appearance of the game object
    abstract void
    update(float deltaTime)
    Updates the Object

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.badlogic.gdx.utils.Disposable

    dispose
  • Field Details

    • world

      protected com.badlogic.gdx.physics.box2d.World world
      Saves the box2d world
    • body

      protected com.badlogic.gdx.physics.box2d.Body body
      Represents the physics body
    • texture

      protected com.badlogic.gdx.graphics.Texture texture
      Defines the texture of the object
  • Constructor Details

    • GameElement

      public GameElement()
  • Method Details

    • render

      public abstract void render(com.badlogic.gdx.graphics.g2d.SpriteBatch spriteBatch)
      Renders the appearance of the game object
      Parameters:
      spriteBatch -
    • update

      public abstract void update(float deltaTime)
      Updates the Object
      Parameters:
      deltaTime - Time since last frame.