Compare commits
10 Commits
30ac6ddb72
...
c1cc753410
| Author | SHA1 | Date | |
|---|---|---|---|
| c1cc753410 | |||
| 649894dafc | |||
| e020b64c86 | |||
| 04bd2ee3e4 | |||
| 462f847cd1 | |||
| 50565267e9 | |||
| 9057e87478 | |||
| 959c25c8fa | |||
| b7efe6dce6 | |||
| d8c3cf0cad |
2
.gitattributes
vendored
@@ -3,8 +3,10 @@
|
|||||||
#
|
#
|
||||||
# Linux start script should use lf
|
# Linux start script should use lf
|
||||||
/gradlew text eol=lf
|
/gradlew text eol=lf
|
||||||
|
|
||||||
# These are Windows script files and should use crlf
|
# These are Windows script files and should use crlf
|
||||||
*.bat text eol=crlf
|
*.bat text eol=crlf
|
||||||
|
|
||||||
# Binary files should be left untouched
|
# Binary files should be left untouched
|
||||||
*.jar binary
|
*.jar binary
|
||||||
*.bin filter=lfs diff=lfs merge=lfs -text
|
*.bin filter=lfs diff=lfs merge=lfs -text
|
||||||
|
|||||||
49
.github/workflows/build.yml
vendored
@@ -13,6 +13,9 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
lfs: true
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Set up JDK 21
|
- name: Set up JDK 21
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v3
|
||||||
@@ -31,6 +34,40 @@ jobs:
|
|||||||
path: dist/portable/*-portable.jar
|
path: dist/portable/*-portable.jar
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
|
|
||||||
|
build-web:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
id-token: write
|
||||||
|
pages: write
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
lfs: true
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Set up JDK 21
|
||||||
|
uses: actions/setup-java@v3
|
||||||
|
with:
|
||||||
|
java-version: '21'
|
||||||
|
distribution: 'temurin'
|
||||||
|
cache: gradle
|
||||||
|
|
||||||
|
- name: Build Web Application
|
||||||
|
run: ./gradlew buildBundledWebApp
|
||||||
|
|
||||||
|
- name: Upload pages artifact
|
||||||
|
uses: actions/upload-pages-artifact@v3
|
||||||
|
with:
|
||||||
|
path: 'dist/web-bundle'
|
||||||
|
|
||||||
|
- name: Deploy to GitHub Pages
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
id: deployment
|
||||||
|
uses: actions/deploy-pages@v4
|
||||||
|
|
||||||
|
|
||||||
build-native:
|
build-native:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
@@ -47,6 +84,9 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
lfs: true
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Set up GraalVM
|
- name: Set up GraalVM
|
||||||
uses: graalvm/setup-graalvm@v1
|
uses: graalvm/setup-graalvm@v1
|
||||||
@@ -56,15 +96,6 @@ jobs:
|
|||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
native-image-job-reports: 'true'
|
native-image-job-reports: 'true'
|
||||||
|
|
||||||
- name: Build Installer for ${{ matrix.platform }}
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
if [[ "${{ matrix.platform }}" == "linux" ]]; then
|
|
||||||
sudo apt-get install -y rpm
|
|
||||||
fi
|
|
||||||
./gradlew buildInstaller
|
|
||||||
ls -R dist
|
|
||||||
|
|
||||||
- name: Build Native Executable for ${{ matrix.platform }}
|
- name: Build Native Executable for ${{ matrix.platform }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
12
.gitignore
vendored
@@ -1,9 +1,15 @@
|
|||||||
# Ignore Gradle project-specific cache directory
|
|
||||||
.gradle
|
.gradle
|
||||||
|
|
||||||
# Ignore Gradle build output directory
|
|
||||||
build
|
build
|
||||||
bin
|
bin
|
||||||
dist
|
dist
|
||||||
*.hprof
|
*.hprof
|
||||||
.idea
|
.idea
|
||||||
|
.DS_Store
|
||||||
|
gradle-local.properties
|
||||||
|
.idea/
|
||||||
|
node_modules/
|
||||||
|
*.map
|
||||||
|
.sourcemaps
|
||||||
|
.settings
|
||||||
|
platform-web/.env.nostr-deploy.local
|
||||||
|
local.properties
|
||||||
18
.vscode/launch.json
vendored
@@ -4,22 +4,22 @@
|
|||||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
|
|
||||||
{
|
{
|
||||||
"type": "java",
|
"type": "java",
|
||||||
"name": "Current File",
|
"name": "Debug Application",
|
||||||
"request": "launch",
|
|
||||||
"mainClass": "${file}"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "java",
|
|
||||||
"name": "DesktopLauncher",
|
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"mainClass": "org.ngengine.platform.DesktopLauncher",
|
"mainClass": "org.ngengine.platform.DesktopLauncher",
|
||||||
"projectName": "platform-desktop",
|
"projectName": "platform-desktop",
|
||||||
"osx": {
|
"osx": {
|
||||||
"vmArgs": "-XstartOnFirstThread"
|
"vmArgs": "-XstartOnFirstThread"
|
||||||
}
|
},
|
||||||
|
"linux": {
|
||||||
|
"env": {
|
||||||
|
"__GL_THREADED_OPTIMIZATIONS": "0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"vmArgs": "-ea -Dthreadwarden=true -Djava.util.logging.config.file=${workspaceFolder}/dev-logging.properties",
|
||||||
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
15
.vscode/settings.json
vendored
@@ -1,3 +1,16 @@
|
|||||||
{
|
{
|
||||||
"java.configuration.updateBuildConfiguration": "automatic"
|
"java.configuration.updateBuildConfiguration": "automatic",
|
||||||
|
"files.exclude": {
|
||||||
|
"**/.git": true,
|
||||||
|
"**/.svn": true,
|
||||||
|
"**/.hg": true,
|
||||||
|
"**/.DS_Store": true,
|
||||||
|
"**/Thumbs.db": true,
|
||||||
|
"**/gradle": true,
|
||||||
|
"**/.gradle": true,
|
||||||
|
"**/build": true,
|
||||||
|
"**/bin": true,
|
||||||
|
"platform-*": true
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# Ad City
|
||||||
|
|
||||||
|
This is a demo of the [Nostr Game Engine v0.1 release](https://github.com/NostrGameEngine/ngengine/releases/tag/0.1.1) that showcases in-game ads.
|
||||||
|
|
||||||
|
A futuristic city, full of retro-futuristic ads 🤷♂️
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ dependencies {
|
|||||||
|
|
||||||
|
|
||||||
java {
|
java {
|
||||||
sourceCompatibility = JavaVersion.VERSION_11
|
toolchain {
|
||||||
targetCompatibility = JavaVersion.VERSION_11
|
languageVersion = JavaLanguageVersion.of(21)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -12,34 +12,15 @@ import org.ngengine.demo.adc.PhysicsComponent;
|
|||||||
import org.ngengine.demo.adc.PostprocessingComponent;
|
import org.ngengine.demo.adc.PostprocessingComponent;
|
||||||
import org.ngengine.demo.adc.SoundComponent;
|
import org.ngengine.demo.adc.SoundComponent;
|
||||||
import org.ngengine.gui.win.NWindowManagerComponent;
|
import org.ngengine.gui.win.NWindowManagerComponent;
|
||||||
import org.ngengine.nostr4j.keypair.NostrPublicKey;
|
|
||||||
|
|
||||||
import com.jme3.system.AppSettings;
|
|
||||||
|
|
||||||
public class Main {
|
public class Main {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static NGEAppRunner main(String arg[]){
|
public static NGEAppRunner main(String arg[]){
|
||||||
AppSettings settings = new AppSettings(true);
|
|
||||||
settings.setRenderer(AppSettings.LWJGL_OPENGL32);
|
|
||||||
settings.setWidth(1280);
|
|
||||||
settings.setHeight(720);
|
|
||||||
settings.setGammaCorrection(true);
|
|
||||||
settings.setSamples(2);
|
|
||||||
settings.setStencilBits(8);
|
|
||||||
settings.setDepthBits(24);
|
|
||||||
settings.setVSync(true);
|
|
||||||
settings.setGraphicsDebug(false);
|
|
||||||
settings.setX11PlatformPreferred(true);
|
|
||||||
settings.setTitle("Nostr Game Engine Demo");
|
|
||||||
settings.setEmulateMouse(true);
|
|
||||||
settings.setEmulateKeyboard(true);
|
|
||||||
|
|
||||||
|
|
||||||
NostrPublicKey appId = NostrPublicKey.fromBech32("npub1tc32kq8hr992tzvt09rwuc5wk6aa08pquqawasv20acjp4umny5q6axr4t");
|
NGEAppRunner appRunner = NGEApplication.createApp( app -> {
|
||||||
|
|
||||||
NGEAppRunner appRunner = NGEApplication.createApp(appId, settings, app -> {
|
|
||||||
ImmersiveAdComponent dep = app.enableAds();
|
ImmersiveAdComponent dep = app.enableAds();
|
||||||
|
|
||||||
ComponentManager mng = app.getComponentManager();
|
ComponentManager mng = app.getComponentManager();
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import com.simsilica.lemur.HAlignment;
|
|||||||
import com.simsilica.lemur.VAlignment;
|
import com.simsilica.lemur.VAlignment;
|
||||||
|
|
||||||
public class HudComponent implements Component<Object>, InputHandlerFragment {
|
public class HudComponent implements Component<Object>, InputHandlerFragment {
|
||||||
private Runnable closeHud;
|
private NHud hud;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable(ComponentManager mng, Runner runner, DataStoreProvider dataStore, boolean firstTime,
|
public void onEnable(ComponentManager mng, Runner runner, DataStoreProvider dataStore, boolean firstTime,
|
||||||
@@ -26,22 +26,18 @@ public class HudComponent implements Component<Object>, InputHandlerFragment {
|
|||||||
|
|
||||||
windowManager.showCursor(false);
|
windowManager.showCursor(false);
|
||||||
|
|
||||||
this.closeHud= windowManager.showWindow(
|
this.hud = windowManager.showWindow( NHud.class );
|
||||||
NHud.class,
|
hud.setFitContent(false);
|
||||||
(win, err) -> {
|
hud.setFullscreen(true);
|
||||||
win.setFitContent(false);
|
NLabel crossair = new NLabel("+");
|
||||||
win.setFullscreen(true);
|
crossair.setTextVAlignment(VAlignment.Center);
|
||||||
NLabel crossair = new NLabel("+");
|
crossair.setTextHAlignment(HAlignment.Center);
|
||||||
crossair.setTextVAlignment(VAlignment.Center);
|
hud.getCenter().addChild(crossair);
|
||||||
crossair.setTextHAlignment(HAlignment.Center);
|
|
||||||
win.getCenter().addChild(crossair);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisable(ComponentManager mng, Runner runner, DataStoreProvider dataStore) {
|
public void onDisable(ComponentManager mng, Runner runner, DataStoreProvider dataStore) {
|
||||||
this.closeHud.run();
|
hud.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import com.simsilica.lemur.HAlignment;
|
|||||||
import com.simsilica.lemur.VAlignment;
|
import com.simsilica.lemur.VAlignment;
|
||||||
|
|
||||||
public class LoadingScreenComponent implements Component<Object>, LogicFragment {
|
public class LoadingScreenComponent implements Component<Object>, LogicFragment {
|
||||||
private Runnable closeHud;
|
private NHud hud;
|
||||||
private NLabel txt;
|
private NLabel txt;
|
||||||
@Override
|
@Override
|
||||||
public void onEnable(ComponentManager mng, Runner runner, DataStoreProvider dataStore, boolean firstTime,
|
public void onEnable(ComponentManager mng, Runner runner, DataStoreProvider dataStore, boolean firstTime,
|
||||||
@@ -29,22 +29,19 @@ public class LoadingScreenComponent implements Component<Object>, LogicFragment
|
|||||||
|
|
||||||
txt = new NLabel("Loading");
|
txt = new NLabel("Loading");
|
||||||
|
|
||||||
this.closeHud= windowManager.showWindow(
|
hud = windowManager.showWindow(NHud.class);
|
||||||
NHud.class,
|
hud.setFitContent(false);
|
||||||
(win, err) -> {
|
hud.setFullscreen(true);
|
||||||
win.setFitContent(false);
|
txt.setFontSize(32);
|
||||||
win.setFullscreen(true);
|
txt.setTextVAlignment(VAlignment.Center);
|
||||||
txt.setFontSize(32);
|
txt.setTextHAlignment(HAlignment.Center);
|
||||||
txt.setTextVAlignment(VAlignment.Center);
|
hud.getCenter().addChild(txt);
|
||||||
txt.setTextHAlignment(HAlignment.Center);
|
|
||||||
win.getCenter().addChild(txt);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisable(ComponentManager mng, Runner runner, DataStoreProvider dataStore) {
|
public void onDisable(ComponentManager mng, Runner runner, DataStoreProvider dataStore) {
|
||||||
this.closeHud.run();
|
hud.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
float time = 0;
|
float time = 0;
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public class MapComponent implements Component<Object>, AsyncAssetLoadingFragmen
|
|||||||
|
|
||||||
if(map==null){
|
if(map==null){
|
||||||
System.out.println("AdCity: Loading map from assets...");
|
System.out.println("AdCity: Loading map from assets...");
|
||||||
map = assetManager.loadModel("adc/city/city.gltf");
|
map = assetManager.loadModel("adc/city-opt/city.gltf");
|
||||||
// map = new Node();
|
// map = new Node();
|
||||||
PhysicsComponent physics = mng.getComponent(PhysicsComponent.class);
|
PhysicsComponent physics = mng.getComponent(PhysicsComponent.class);
|
||||||
map.depthFirstTraversal(sx->{
|
map.depthFirstTraversal(sx->{
|
||||||
@@ -83,7 +83,6 @@ public class MapComponent implements Component<Object>, AsyncAssetLoadingFragmen
|
|||||||
preload.accept(sky);
|
preload.accept(sky);
|
||||||
} catch(Exception e){
|
} catch(Exception e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
System.exit(1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 35 KiB |
BIN
app/src/main/resources/adc/city-opt/KB3D_NEC_AirCon_normal.jpg
Normal file
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 9.4 KiB |
BIN
app/src/main/resources/adc/city-opt/KB3D_NEC_BannerA_normal.jpg
Normal file
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 7.4 KiB |
|
After Width: | Height: | Size: 11 KiB |
BIN
app/src/main/resources/adc/city-opt/KB3D_NEC_Brass_basecolor.jpg
Normal file
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 28 KiB |
BIN
app/src/main/resources/adc/city-opt/KB3D_NEC_Brass_normal.jpg
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 7.3 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 37 KiB |
BIN
app/src/main/resources/adc/city-opt/KB3D_NEC_Concrete_normal.jpg
Normal file
|
After Width: | Height: | Size: 48 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 7.6 MiB After Width: | Height: | Size: 7.6 MiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 72 KiB |
|
After Width: | Height: | Size: 86 KiB |
|
After Width: | Height: | Size: 97 KiB |
|
After Width: | Height: | Size: 8.6 KiB |
|
After Width: | Height: | Size: 8.6 KiB |
BIN
app/src/main/resources/adc/city-opt/KB3D_NEC_Letters_normal.jpg
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
BIN
app/src/main/resources/adc/city-opt/KB3D_NEC_LightRed_normal.jpg
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 1.8 KiB |