|
I am putting together a simple game framework that can be used to create games with Slick that use Phys2d. It has a pretty simple class layout right now.
EntityManager
This class manages the Entitys in the game, and controls initialization, updating, and rendering of all entities in the game. It also handles the addition of phys2d Bodys to the phys2d World.
Entity can delete themselves, and, if extended, can delete other entities. One thing I like about this system is that it doesn't tie down what an Entity can do. Want to use Slick's drawing functions to draw an entity? Sure! Want to use particle effects? Sure! Want to use pure LWJGL OpenGL calls to draw something? Sure! Even embeding SUI objects as Entities isn't too hard..
on init:
Entity that recieve input are added as InputListeners
PhysicsEntity have their associated Body added to the world
on update:
Entity all have their update function run, which is passed a time delta
The phys2d World is stepped, using the delta for frame rate independant physics.
Entity
Entity can be assigned to different layers so that they are drawn in order. IE. Background, then the Main layer, then the Foreground, then the GUI.
------------------------
Stuff being worked on
------------------------
Demo Game - Epsilon Tanks
More Base Entity Classes
|