Skip to content

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

Notifications You must be signed in to change notification settings

TomGrill/logic-render-game-loop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages