Skip to content

Commit 1e47a4e

Browse files
committed
Prepped demo build
1 parent 8f0250c commit 1e47a4e

9 files changed

Lines changed: 47 additions & 122 deletions

File tree

config/linux_build.sh

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
#!/bin/bash
22

3-
ID="tdsm"
3+
ID="tdsm-demo"
44
NAME="Top Down Sprite Maker"
55
DEV="Jordan Bunke"
66

77
echo "Building $NAME for Linux..."
88

99
ARTIFACT_DIR="../out/artifacts/release"
10-
OUTPUT_DIR="../out/artifacts/dist/linux"
10+
OUTPUT_DIR="../out/artifacts/demo/linux"
1111

1212
rm -rf "$OUTPUT_DIR/build"
1313
rm -rf "$OUTPUT_DIR/runtime"
1414
mkdir -p "$OUTPUT_DIR"
1515

1616
# Analyze Java module dependencies
1717
jdeps --multi-release 17 --print-module-deps "$ARTIFACT_DIR/tdsm.jar" > "$OUTPUT_DIR/modules.txt"
18-
echo "1/4: Analyzed dependencies"
18+
echo "1/3: Analyzed dependencies"
1919

2020
MODULES=$(cat "$OUTPUT_DIR/modules.txt")
2121
echo "Modules: $MODULES"
2222

2323
# Create custom runtime image with jlink
2424
jlink --module-path "$JAVA_HOME/jmods" --add-modules "$MODULES" --output "$OUTPUT_DIR/runtime"
25-
echo "2/4: Generated runtime image"
25+
echo "2/3: Generated runtime image"
2626

2727
# Package application with jpackage for Linux
2828
ICON_PATH="./icons/sources/icon-256px.png"
@@ -31,28 +31,6 @@ VERSION_FILE="../res/version"
3131
VERSION=$(cat "$VERSION_FILE")
3232
echo "Version: $VERSION"
3333

34-
jpackage \
35-
--type deb \
36-
--input "$ARTIFACT_DIR" \
37-
--dest "$OUTPUT_DIR/installer" \
38-
--name "$NAME" \
39-
--app-version "$VERSION" \
40-
--main-jar tdsm.jar \
41-
--runtime-image "$OUTPUT_DIR/runtime" \
42-
--icon "$ICON_PATH" \
43-
--linux-package-name "$ID" \
44-
--linux-deb-maintainer "$DEV <jordanbunkework@gmail.com>" \
45-
--linux-shortcut \
46-
--description "$NAME"
47-
mv "$OUTPUT_DIR/installer/${ID}_${VERSION}-1_amd64.deb" \
48-
"$OUTPUT_DIR/installer/${ID}-${VERSION}-installer.deb"
49-
50-
if [[ $? -eq 0 ]]; then
51-
echo "3/4: Built Linux installer with jpackage"
52-
else
53-
echo "Failed to build Linux installer"
54-
fi
55-
5634
jpackage \
5735
--type app-image \
5836
--input "$ARTIFACT_DIR" \
@@ -63,10 +41,10 @@ jpackage \
6341
--runtime-image "$OUTPUT_DIR/runtime" \
6442
--icon "$ICON_PATH" \
6543
--vendor "$DEV" \
66-
--description "$NAME"
44+
--description "$NAME (demo)"
6745

6846
if [[ $? -eq 0 ]]; then
69-
echo "4/4: Built Linux executable with jpackage"
47+
echo "3/3: Built Linux executable with jpackage"
7048
else
7149
echo "Failed to build Linux executable"
7250
fi

config/mac_build.sh

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
11
#!/bin/bash
22

3-
ID="tdsm"
3+
ID="tdsm-demo"
44
NAME="Top Down Sprite Maker"
55
DEV="Jordan Bunke"
6-
MAC_BUNDLE_ID="com.jordanbunke.tdsm"
76

87
echo "Building $NAME for macOS..."
98

109
ARTIFACT_DIR="../out/artifacts/release"
11-
OUTPUT_DIR="../out/artifacts/dist/mac"
10+
OUTPUT_DIR="../out/artifacts/demo/mac"
1211

1312
rm -rf "$OUTPUT_DIR/build"
1413
rm -rf "$OUTPUT_DIR/runtime"
1514
mkdir -p "$OUTPUT_DIR"
1615

1716
# Analyze Java module dependencies
1817
jdeps --multi-release 17 --print-module-deps "$ARTIFACT_DIR/tdsm.jar" > "$OUTPUT_DIR/modules.txt"
19-
echo "1/4: Analyzed dependencies"
18+
echo "1/3: Analyzed dependencies"
2019

2120
MODULES=$(cat "$OUTPUT_DIR/modules.txt")
2221
echo "Modules: $MODULES"
2322

2423
# Create custom runtime image with jlink
2524
jlink --module-path "$JAVA_HOME/jmods" --add-modules "$MODULES" --output "$OUTPUT_DIR/runtime"
26-
echo "2/4: Generated runtime image"
25+
echo "2/3: Generated runtime image"
2726

2827
# Package application with jpackage for macOS
2928
ICON_PATH="./icons/mac-icon.icns"
@@ -32,27 +31,6 @@ VERSION_FILE="../res/version"
3231
VERSION=$(cat "$VERSION_FILE")
3332
echo "Version: $VERSION"
3433

35-
jpackage \
36-
--type dmg \
37-
--input "$ARTIFACT_DIR" \
38-
--dest "$OUTPUT_DIR/installer" \
39-
--name "$NAME" \
40-
--app-version "$VERSION" \
41-
--main-jar tdsm.jar \
42-
--runtime-image "$OUTPUT_DIR/runtime" \
43-
--icon "$ICON_PATH" \
44-
--vendor "$DEV" \
45-
--mac-package-identifier "$MAC_BUNDLE_ID" \
46-
--description "$NAME"
47-
mv "$OUTPUT_DIR/installer/${NAME}-${VERSION}.dmg" \
48-
"$OUTPUT_DIR/installer/${ID}-${VERSION}-installer.dmg"
49-
50-
if [[ $? -eq 0 ]]; then
51-
echo "3/4: Built macOS installer with jpackage"
52-
else
53-
echo "Failed to build macOS installer"
54-
fi
55-
5634
jpackage \
5735
--type app-image \
5836
--input "$ARTIFACT_DIR" \
@@ -63,10 +41,10 @@ jpackage \
6341
--runtime-image "$OUTPUT_DIR/runtime" \
6442
--icon "$ICON_PATH" \
6543
--vendor "$DEV" \
66-
--description "$NAME"
44+
--description "$NAME (demo)"
6745

6846
if [[ $? -eq 0 ]]; then
69-
echo "4/4: Built macOS executable with jpackage"
47+
echo "3/3: Built macOS executable with jpackage"
7048
else
7149
echo "Failed to build macOS executable"
7250
fi

config/win_build.bat

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22

33
setlocal
44

5-
set "ID=tdsm"
5+
set "ID=tdsm-demo"
66
set "NAME=Top Down Sprite Maker"
77
set "DEV=Jordan Bunke"
88

99
echo Building %NAME% for Windows...
1010

1111
set "ARTIFACT_DIR=..\out\artifacts\release"
12-
set "OUTPUT_DIR=..\out\artifacts\dist\win"
12+
set "OUTPUT_DIR=..\out\artifacts\demo\win"
1313

1414
rd /s /q "%OUTPUT_DIR%\build"
1515
rd /s /q "%OUTPUT_DIR%\runtime"
1616
if not exist "%OUTPUT_DIR%" mkdir "%OUTPUT_DIR%"
1717

1818
:: Analyze Java module dependencies
1919
jdeps --multi-release 17 --print-module-deps "%ARTIFACT_DIR%\tdsm.jar" > "%OUTPUT_DIR%\modules.txt"
20-
echo 1/4: Analyzed dependencies
20+
echo 1/3: Analyzed dependencies
2121

2222
:: Read modules from file
2323
set /p MODULES=<"%OUTPUT_DIR%\modules.txt"
@@ -27,7 +27,7 @@ echo Modules: %MODULES%
2727
set JAVA_MOD_PATH="C:\Program Files\Java\jdk-17\jmods"
2828

2929
jlink --module-path %JAVA_MOD_PATH% --add-modules "%MODULES%" --output "%OUTPUT_DIR%\runtime"
30-
echo 2/4: Generated runtime image
30+
echo 2/3: Generated runtime image
3131

3232
:: Build the EXE with Launch4J
3333
:: call l4j.bat
@@ -42,25 +42,6 @@ set /p VERSION=<"%VERSION_FILE%"
4242

4343
set ICON_PATH=".\icons\win-icon.ico"
4444

45-
jpackage ^
46-
--type exe ^
47-
--input "%ARTIFACT_DIR%" ^
48-
--dest "%OUTPUT_DIR%\installer" ^
49-
--name "%NAME%" ^
50-
--app-version "%VERSION%" ^
51-
--main-jar tdsm.jar ^
52-
--runtime-image "%OUTPUT_DIR%\runtime" ^
53-
--icon "%ICON_PATH%" ^
54-
--vendor "%DEV%" ^
55-
--win-dir-chooser ^
56-
--win-shortcut ^
57-
--win-menu ^
58-
--win-menu-group "%NAME%" ^
59-
--description "%NAME%"
60-
move "%OUTPUT_DIR%\installer\%NAME%-%VERSION%.exe" "%OUTPUT_DIR%\installer\%ID%-%VERSION%-installer.exe"
61-
62-
echo 3/4: Built Windows installer with jpackage
63-
6445
jpackage ^
6546
--type app-image ^
6647
--input "%ARTIFACT_DIR%" ^
@@ -71,8 +52,8 @@ jpackage ^
7152
--runtime-image "%OUTPUT_DIR%\runtime" ^
7253
--icon "%ICON_PATH%" ^
7354
--vendor "%DEV%" ^
74-
--description "%NAME%"
55+
--description "%NAME% (demo)"
7556

76-
echo 4/4: Built Windows executable with jpackage
57+
echo 3/3: Built Windows executable with jpackage
7758

7859
endlocal

res/text/no_export_in_demo.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
You cannot export sprite sheets in this demo.
2+
3+
Please buy the full version of the program if you
4+
wish to export your customized character sprite sheets.

res/text/splash.txt

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,3 @@
1-
Buy "Stipple Effect"!
2-
3-
You can rearrange the order in which directions and
4-
animations are sequenced in exported sprite sheets
5-
6-
You can constrain sprite randomization by locking
7-
customization layers that you don't want to modify
8-
9-
Animations are efficient with their frames. A walk
10-
cycle may be four frames long, but only represented
11-
as three frames in a pong loop because two frames
12-
in the cycle are the same.
13-
14-
Please respect the terms of the license.
15-
Credit is appreciated but not required.
16-
17-
Help me develop TDSM by reporting bugs and requesting
18-
features! Visit "jbunke/tdsm" on GitHub for more.
19-
20-
Make your own sprite styles and share them with the
21-
world! See the "About" section for more information.
1+
This is a demo version of "Top Down Sprite Maker".
2+
Please buy the full version of the program if you
3+
wish to export your customized character sprite sheets.

src/com/jordanbunke/tdsm/TDSM.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void render(final GameImage canvas) {
5959
public void debugRender(final GameImage canvas, final GameDebugger debugger) {}
6060

6161
private GameWindow makeWindow() {
62-
return new GameWindow(PROGRAM_NAME + " " + formatVersion(),
62+
return new GameWindow(PROGRAM_NAME + " (demo) " + formatVersion(),
6363
Layout.width(), Layout.height(),
6464
Graphics.readIcon(ResourceCodes.ICON), true, false, false);
6565
}

src/com/jordanbunke/tdsm/menu/Blinker.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import com.jordanbunke.delta_time.text.Text;
55
import com.jordanbunke.delta_time.text.TextBuilder;
66
import com.jordanbunke.delta_time.utility.math.Coord2D;
7-
import com.jordanbunke.delta_time.utility.math.RNG;
87
import com.jordanbunke.tdsm.util.ParserUtils;
98
import com.jordanbunke.tdsm.util.ProgramFont;
109
import com.jordanbunke.tdsm.util.ResourceCodes;
@@ -24,11 +23,8 @@ private Blinker(
2423
public static Blinker make(
2524
final Coord2D position, final Anchor anchor
2625
) {
27-
final String[] splashTexts = ParserUtils
28-
.readResourceText(ResourceCodes.SPLASH)
29-
.split("\n\n");
30-
final String choice =
31-
splashTexts[RNG.randomInRange(0, splashTexts.length)];
26+
final String choice = ParserUtils
27+
.readResourceText(ResourceCodes.SPLASH);
3228
final TextBuilder tb = ProgramFont.MINI
3329
.getBuilder(Text.Orientation.CENTER);
3430
final String[] lines = choice.split("\n");

src/com/jordanbunke/tdsm/util/MenuAssembly.java

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -379,20 +379,23 @@ public static Menu configuration() {
379379
"Export... >", BOTTOM.at(1.0, 0.5)
380380
.displace(-BOTTOM_BAR_BUTTON_X, 0),
381381
Anchor.RIGHT_CENTRAL, style::exportsASprite,
382-
() -> {
383-
if (style.settings.hasPreExportStep())
384-
ProgramState.set(ProgramState.MENU, preExport());
385-
else {
386-
style.settings.resetPreExport();
387-
ProgramState.set(ProgramState.MENU, export());
388-
}
389-
});
382+
() -> ProgramState.set(ProgramState.MENU, noExportInDemo()));
390383

391384
mb.addAll(toCustomButton, toExportButton);
392385

393386
return mb.build();
394387
}
395388

389+
private static Menu noExportInDemo() {
390+
return openingMenu("Buy full program to export",
391+
ResourceCodes.NO_EXPORT_IN_DEMO, Text.Orientation.CENTER, null,
392+
new Pair<>("Buy on itch.io",
393+
() -> visitSite("https://flinkerflitzer.itch.io/tdsm")),
394+
new Pair<>("Main Menu",
395+
() -> ProgramState.to(mainMenu())));
396+
}
397+
398+
@SuppressWarnings("unused")
396399
private static Menu preExport() {
397400
final MenuBuilder mb = new MenuBuilder();
398401
final Style style = Sprite.get().getStyle();
@@ -455,6 +458,8 @@ public static Menu mainMenu() {
455458
addMenuButtons(mb,
456459
new Pair<>("Start editing",
457460
MenuAssembly::loadCustomization),
461+
new Pair<>("Buy on itch.io",
462+
() -> visitSite("https://flinkerflitzer.itch.io/tdsm")),
458463
new Pair<>("About", () -> ProgramState.to(about())),
459464
new Pair<>("Quit", TDSM::quitProgram));
460465

@@ -468,10 +473,10 @@ public static Menu mainMenu() {
468473

469474
// Version and credits
470475
final StaticLabel programLabel = new StaticLabel(
471-
canvasAt(0.5, 0.98),
472-
Anchor.CENTRAL_BOTTOM,
473-
Graphics.miniText(Colors.darkSystem())
474-
.addText(ProgramInfo.formatVersion()).addLineBreak()
476+
canvasAt(0.02, 0.98),
477+
Anchor.LEFT_BOTTOM,
478+
ProgramFont.MINI.getBuilder(Text.Orientation.LEFT)
479+
.addText(ProgramInfo.formatVersion() + " (demo build)").addLineBreak()
475480
.addText(ParserUtils.readResourceText(ResourceCodes.COPYRIGHT))
476481
.build().draw());
477482

src/com/jordanbunke/tdsm/util/ResourceCodes.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ public final class ResourceCodes {
5252
CHANGELOG = "changelog", ROADMAP = "roadmap",
5353
LICENSE = "LICENSE", SUMMARY = "license_summary",
5454
STIPPLE_EFFECT = "stipple_effect", TECHNICAL = "technical",
55-
MORE_STYLES = "more_styles", COPYRIGHT = "copyright";
55+
MORE_STYLES = "more_styles", COPYRIGHT = "copyright",
56+
NO_EXPORT_IN_DEMO = "no_export_in_demo";
5657

5758
// tutorials
5859
public static final String TUT_MAKE_STYLE = "tut_make_style",

0 commit comments

Comments
 (0)