TomGrill / logic-render-game-loop

libGDX + artemis-odb game loop which seperates game logic and rendering

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

logic-render-game-loop

artemis-odb SystemInvocationStrategy to seperate game logic and rendering within the game loop.

Updates & News

Follow me to receive release updates about this and my other projects (Promise: No BS posts)

https://twitter.com/TomGrillGames and https://www.facebook.com/tomgrillgames

I will also stream sometimes when developing at https://www.twitch.tv/tomgrill and write a blog article from time to time at http://tomgrill.de

Requires:

https://github.com/junkdog/artemis-odb

https://github.com/libgdx/libgdx

###Usage: Register GameLoopSystemInvocationStrategy with your WorldConfiguration

WorldConfiguration config = new WorldConfigurationBuilder()
.dependsOn(MyPlugin.class)
.with(
		new MySystemA(),
		new MySystemB(),
		new MySystemC(),
)
.register(new GameLoopSystemInvocationStrategy(40))  // millis per logic tick. default: 40 ~ 25ticks/second 
.build();

Mark all EntitySystem for processing within the logic part of the game loop like this:

public class MySuperLogicSystem extends EntityProcessingSystem implements LogicRenderEntitySystem{
	
	public MySuperLogicSystem(Aspect.Builder aspect) {
		super(aspect);
	}

	@Override
	protected void process(Entity e) {
		System.out.println("I will only processed when it's logic time.");
	}
}

License

The logic-render-game-loop project is licensed under the Apache 2 License, meaning you can use it free of charge, without strings attached in commercial and non-commercial projects. We love to get (non-mandatory) credit in case you release a game or app using gdx-facebook!

About

libGDX + artemis-odb game loop which seperates game logic and rendering


Languages

Language:Java 100.0%