Skip to content
Benedikt S. Vogler edited this page Aug 22, 2017 · 8 revisions

An entity is an object which is not bound to the grid. Entities may move around (MovableEntitiy).

Entities must derive from com.bombinggames.wurfelengine.core.AbstractEntity. UML class diagram for AbstractEntity They can be spawned to the map with the method spawn(Point point)

Example

Enemy enemy = (Enemy) new Enemy().spawn(new Coordinate(5,5,5).getPoint());

To remove the from the game you call dispose(). If you just want to remove them from the map call removeFromMap().

Sprites

By default entities use sprite category 'e'. Sprite of entities with an id 0-9 are reserved by the engine. Here is a list of the entities currently used by the engine.

  1. invisible stuff
  2. not in use
  3. not in use
  4. destruction decals
  5. not in use
  6. benchmark ball
  7. shadow
  8. sprites on the ground like gras and stones
  9. cursor
  10. cursor normal

Registering entities

You can register entities in order to spawn them from the map editor. AbstractEntity.registerEntity(String name, Class<? extends AbstractEntity> entityClass);

Clone this wiki locally