Skip to content

Commit 3e27d62

Browse files
Merge pull request #2 from radovanmoncek/development
Development
2 parents 06989d8 + 5076c88 commit 3e27d62

File tree

16 files changed

+1309
-64
lines changed

16 files changed

+1309
-64
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,7 @@ replay_pid*
5959

6060
build/
6161
gradle/
62+
63+
*.env
64+
65+
assets/

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
## TODO: title
2+
3+
is an example game for my example nettgame server.
4+
5+
### Synopsis
6+
7+
TODO: title is a top-down shooter inspired by the game "Bulánci".
8+
The game is built using the popular libGDX game engine.
9+
10+
### Controls
11+
12+
- You can move with the W A S D keys
13+
- Shooting is controlled by pressing the SPACEBAR key.
14+
15+
#### How to build & run
16+
17+
18+
19+
*!!!! none of the assets used in this project are my own work,
20+
below is a list of their respective authors;
21+
all assets allow free noncommercial use; I highly encourage everyone to
22+
visit the website of each author !!!!*
23+
24+
## Attributions:
25+
- character assets: TODO
26+
- UI: <https://andelrodis.itch.io/1-bit-game-ui-pack>

assets/badlogic.jpg

-66.9 KB
Binary file not shown.

build.gradle

Lines changed: 65 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
buildscript {
2-
32

43
repositories {
54
mavenLocal()
65
mavenCentral()
76
gradlePluginPortal()
87
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
98
google()
9+
flatDir {
10+
11+
dirs('../libs')
12+
}
1013
}
1114
dependencies {
12-
1315

1416
}
1517
}
1618

1719
allprojects {
18-
apply plugin: "eclipse"
20+
apply plugin: "idea"
1921

2022
version = '1.0'
2123
ext {
22-
appName = "My GDX Game"
24+
appName = "example nettgame client"
2325
gdxVersion = '1.12.1'
2426
roboVMVersion = '2.3.20'
2527
box2DLightsVersion = '1.5'
@@ -42,21 +44,78 @@ allprojects {
4244
project(":desktop") {
4345
apply plugin: "java-library"
4446

47+
repositories {
48+
49+
flatDir {
50+
51+
dirs('../libs')
52+
}
53+
}
4554

4655
dependencies {
4756
implementation project(":core")
4857
api "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion"
4958
api "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
50-
59+
api "com.badlogicgames.gdx:gdx:$gdxVersion"
60+
61+
implementation "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
62+
63+
// https://mvnrepository.com/artifact/com.google.flatbuffers/flatbuffers-java
64+
implementation "com.google.flatbuffers:flatbuffers-java:25.2.10"
65+
66+
//https://stackoverflow.com/questions/20700053/how-to-add-local-jar-file-dependency-to-build-gradle-file
67+
//https://www.baeldung.com/gradle-dependencies-local-jar
68+
//https://stackoverflow.com/questions/45792184/how-to-add-a-jar-file-to-an-existing-gradle-project
69+
//https://www.matheusmello.io/posts/java-how-to-add-local-jar-file-dependency-to-build-gradle-file
70+
//https://stackoverflow.com/questions/31471750/how-to-add-external-jar-files-in-gradle-project-inside-the-netbeans/40262145
71+
implementation group: 'cz.radovanmoncek', name: 'nettgame-tables-1.0', version: '1.0'
5172
}
5273
}
5374

5475
project(":core") {
5576
apply plugin: "java-library"
5677

78+
repositories {
79+
80+
flatDir {
81+
82+
dirs('../libs')
83+
}
84+
}
5785

5886
dependencies {
5987
api "com.badlogicgames.gdx:gdx:$gdxVersion"
60-
88+
api "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
89+
90+
// https://mvnrepository.com/artifact/com.google.flatbuffers/flatbuffers-java
91+
implementation "com.google.flatbuffers:flatbuffers-java:25.2.10"
92+
93+
implementation group: 'cz.radovanmoncek', name: 'nettgame-tables-1.0', version: '1.0'
94+
}
95+
}
96+
97+
project(":test"){
98+
apply plugin: "java-library"
99+
100+
repositories {
101+
102+
flatDir {
103+
104+
dirs('../libs')
105+
}
106+
}
107+
108+
dependencies {
109+
implementation project(":desktop")
110+
111+
// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter
112+
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: '5.13.0-M2'
113+
//Massive thanks: https://github.com/junit-team/junit5/issues/4341
114+
testImplementation("org.junit.platform:junit-platform-launcher")
115+
116+
// https://mvnrepository.com/artifact/com.google.flatbuffers/flatbuffers-java
117+
implementation "com.google.flatbuffers:flatbuffers-java:25.2.10"
118+
119+
implementation group: 'cz.radovanmoncek', name: 'nettgame-tables-1.0', version: '1.0'
61120
}
62121
}

core/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
sourceCompatibility = 1.8
1+
sourceCompatibility = 21
22
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
33

44
sourceSets.main.java.srcDirs = [ "src/" ]
55

6-
eclipse.project.name = appName + "-core"
6+
//TODO: idea.project.name = appName + "-core"

core/src/com/mygdx/game/MyGdxGame.java

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package cz.radovanmoncek.nettgame.client;
2+
3+
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
4+
import com.badlogic.gdx.utils.Disposable;
5+
import com.badlogic.gdx.utils.viewport.Viewport;
6+
import cz.radovanmoncek.nettgame.tables.GameState;
7+
8+
import java.util.LinkedList;
9+
10+
/**
11+
* State machine pattern for reacting and representing different states of the currently running game session.
12+
* @author Radovan Monček
13+
*/
14+
public interface ClientState {
15+
16+
void initialize(LinkedList<Disposable> disposables);
17+
18+
void noViewportRender(Viewport viewport, SpriteBatch batch, float deltaTime);
19+
20+
void render(Viewport viewport, SpriteBatch batch, float deltaTime);
21+
22+
void processGameState(GameState gameState);
23+
24+
void pingUpdate(long ping);
25+
26+
void registered();
27+
}

0 commit comments

Comments
 (0)