Search in sources :

Example 1 with PongGame

use of com.ilargia.games.entitas.PongGame in project Entitas-Java by Rubentxu.

the class DelaySystem method execute.

@Override
public void execute(float deltatime) {
    for (CoreEntity e : _group.getEntities()) {
        Delay delay = e.getDelay();
        delay.time += deltatime;
        if (delay.time > delay.duration) {
            PongGame.ebus.post((ChangeStateCommand<PongGame>) (nameState, game) -> game.changeState(game.getPongState(), game.getSlideTransition()));
            delay.time = 0;
        }
    }
}
Also used : CoreEntity(com.ilargia.games.entitas.core.CoreEntity) PongGame(com.ilargia.games.entitas.PongGame) ChangeStateCommand(com.ilargia.games.entitas.egdx.api.ChangeStateCommand) Group(com.ilargia.games.entitas.group.Group) CoreMatcher(com.ilargia.games.entitas.core.CoreMatcher) IExecuteSystem(com.ilargia.games.entitas.api.system.IExecuteSystem) CoreContext(com.ilargia.games.entitas.core.CoreContext) Delay(com.ilargia.games.logicbrick.component.Delay) CoreEntity(com.ilargia.games.entitas.core.CoreEntity) Delay(com.ilargia.games.logicbrick.component.Delay) PongGame(com.ilargia.games.entitas.PongGame)

Aggregations

PongGame (com.ilargia.games.entitas.PongGame)1 IExecuteSystem (com.ilargia.games.entitas.api.system.IExecuteSystem)1 CoreContext (com.ilargia.games.entitas.core.CoreContext)1 CoreEntity (com.ilargia.games.entitas.core.CoreEntity)1 CoreMatcher (com.ilargia.games.entitas.core.CoreMatcher)1 ChangeStateCommand (com.ilargia.games.entitas.egdx.api.ChangeStateCommand)1 Group (com.ilargia.games.entitas.group.Group)1 Delay (com.ilargia.games.logicbrick.component.Delay)1