|
1 | | -# Console Java Engine |
| 1 | +# Console Java Engine - Version 0.1.10-Talos |
2 | 2 |
|
3 | 3 | The Console Java Engine is based off of JavidX9's PixelGameEngine. |
4 | 4 |
|
5 | | -Uses Lanterna to emulate a terminal. |
| 5 | +Uses Lanterna to emulate a terminal, also comes with a Pair class that is a basic copy of C++s pair class. |
6 | 6 |
|
7 | | -Currently has a flickering bug that can probably be fixed |
8 | | -Check the ConsoleFPS class for an example of how to use the program. It is a port of JavidX9's raycaster from his video Code-It-Yourself. First Person Shooter (Quick and Simple C++) |
9 | 7 |
|
10 | | -Also comes with a Pair class that is a basic copy of C++s pair class. |
| 8 | +## How to use |
| 9 | + |
| 10 | +To use CJE, include it in your project, then create a class and extend the `ConsoleJavaEngine`. It provides a Skeleton for your project and also provides protected methods to write to the screen. |
| 11 | + |
| 12 | +```Java |
| 13 | + |
| 14 | +import com.googlecode.lanterna.input.KeyStroke; |
| 15 | +import com.spireprod.cje.ConsoleJavaEngine; |
| 16 | + |
| 17 | +public class Adventure extends ConsoleJavaEngine { |
| 18 | + |
| 19 | + public Adventure() { |
| 20 | + super("Adventure", 80, 24); |
| 21 | + } |
| 22 | + |
| 23 | + @Override |
| 24 | + protected void onGameCreate() { |
| 25 | + |
| 26 | + } |
| 27 | + |
| 28 | + @Override |
| 29 | + protected void onGameUpdate(float deltaTime) { |
| 30 | + |
| 31 | + } |
| 32 | + |
| 33 | + @Override |
| 34 | + protected void onGameInput(float deltaTime, KeyStroke keyStroke) { |
| 35 | + |
| 36 | + } |
| 37 | + |
| 38 | + @Override |
| 39 | + protected void onGameRender(float alpha) { |
| 40 | + |
| 41 | + } |
| 42 | + |
| 43 | + public static void main(String[] args) { |
| 44 | + Adventure venture = new Adventure(); |
| 45 | + venture.run(); |
| 46 | + } |
| 47 | + |
| 48 | +} |
| 49 | + |
| 50 | +``` |
| 51 | + |
| 52 | + |
| 53 | +### Jitpack |
| 54 | +[](https://jitpack.io/#CaptainSly/ConsoleJavaEngine) |
| 55 | + |
| 56 | +ConsoleJavaEngine is available through [Jitpack](https://jitpack.io). Here's what you want to use: |
| 57 | + |
| 58 | +```gradle |
| 59 | +
|
| 60 | + dependencyResolutionManagement { |
| 61 | + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) |
| 62 | + repositories { |
| 63 | + mavenCentral() |
| 64 | + maven { url = uri("https://jitpack.io") } |
| 65 | + } |
| 66 | + } |
| 67 | + |
| 68 | + dependencies { |
| 69 | + implementation("com.github.CaptainSly:ConsoleJavaEngine:{VERSION}") |
| 70 | + } |
| 71 | +``` |
| 72 | + |
| 73 | +## Known Bugs |
| 74 | + |
| 75 | +Currently has a flickering bug. |
0 commit comments