Skip to content

Commit e1fc893

Browse files
committed
Worked the readme
1 parent e66f86c commit e1fc893

File tree

4 files changed

+79
-48
lines changed

4 files changed

+79
-48
lines changed

build.gradle.kts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ plugins {
44
`java-library`
55
}
66

7+
group = "com.spireprod"
8+
version = "0.1.10-Talos"
9+
710
repositories {
811
// Use Maven Central for resolving dependencies.
912
mavenCentral()
@@ -13,13 +16,16 @@ repositories {
1316
}
1417

1518
dependencies {
16-
implementation("com.googlecode.lanterna:lanterna:3.1.2")
19+
api("com.googlecode.lanterna:lanterna:3.1.2")
1720
}
1821

1922
// Apply a specific Java toolchain to ease working on different environments.
2023
java {
2124
toolchain {
2225
languageVersion = JavaLanguageVersion.of(21)
2326
}
27+
28+
withJavadocJar()
29+
withSourcesJar()
2430
}
2531

readme.md

Lines changed: 70 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,75 @@
1-
# Console Java Engine
1+
# Console Java Engine - Version 0.1.10-Talos
22

33
The Console Java Engine is based off of JavidX9's PixelGameEngine.
44

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.
66

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++)
97

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/v/CaptainSly/ConsoleJavaEngine.svg)](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.

src/main/java/com/spireprod/cje/ConsoleJavaEngine.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
public abstract class ConsoleJavaEngine {
2222

2323
protected String PIXEL_BLOCK = "\u2588";
24+
protected String PIXEL_SHADE = "\u2591";
2425
protected String PIXEL_SHADE_FULL = "\u2593";
2526
protected String PIXEL_SHADE_HALF = "\u2592";
26-
protected String PIXEL_SHADE = "\u2591";
2727

2828
protected Terminal terminal;
2929
protected TextGraphics termGraphics;
@@ -37,7 +37,7 @@ public abstract class ConsoleJavaEngine {
3737
private final int targetFPS = 60;
3838
private final long optimalTime = (long) (1E9f / targetFPS);
3939

40-
public static final String CJE_VERSION = "0.1.5-Talos";
40+
public static final String CJE_VERSION = "0.1.10-Talos";
4141

4242
public ConsoleJavaEngine(String title, int width, int height) {
4343
DefaultTerminalFactory defaultTermFactory = new DefaultTerminalFactory();

src/main/java/com/spireprod/cje/Test.java

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)