Add support for key event handling in GUI

This commit is contained in:
2021-03-13 11:22:48 +01:00
parent 5cb9e9fb75
commit 68e0a793aa
17 changed files with 80 additions and 30 deletions

View File

@@ -4,6 +4,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.bartlomiejpluta.base.api.game.context.Context;
import com.bartlomiejpluta.base.api.game.input.Input;
import com.bartlomiejpluta.base.api.game.screen.Screen;
import com.bartlomiejpluta.base.api.game.runner.GameRunner;
@@ -12,6 +13,9 @@ public class ${className} implements GameRunner {
@Override
public void init(Context context) {
// Resume engine, because it is initially paused
context.resume();
log.info("The game runner is not implemented yet...");
throw new RuntimeException("Not implemented yet");
}

View File

@@ -1,6 +1,7 @@
package ${package};
import com.bartlomiejpluta.base.api.game.context.Context;
import com.bartlomiejpluta.base.api.game.input.Input;
import com.bartlomiejpluta.base.api.game.map.model.GameMap;
import com.bartlomiejpluta.base.api.game.map.handler.MapHandler;
import com.bartlomiejpluta.base.api.game.screen.Screen;
@@ -18,7 +19,7 @@ public class ${className} implements MapHandler {
}
@Override
public void input(Screen screen) {
public void input(Input input) {
}