Skip to content

Commit 03794c7

Browse files
authored
[v0.1.0] First release. (#54)
* Consolidate game title. * Read build version from text file. - Rename directory for user data from "spaced' to "userdata". * Add menu music, replace game music: light jazz theme. * Add tools/build_release.cmake. * Move assets to assets/assets, in prep for CLI zipping. * Fixup release package script. * Add package CI on "v*" tag push. * Customize log filename. * Add windows app icon. * Add Android icon. * Add Android package step. * Add Play Store BS. * Add screenshot to README. * Update README. [Android] minify release builds.
1 parent a138a64 commit 03794c7

File tree

99 files changed

+458
-111
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+458
-111
lines changed

.editorconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,8 @@ indent_size = 2
1717
[CMakeLists.txt]
1818
indent_style = space
1919
indent_size = 2
20+
21+
[build_version.txt]
22+
indent_style = space
23+
indent_size = 2
24+
insert_final_newline = false

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ jobs:
6262
run: |
6363
export JAVA_HOME=$(find /opt -name "jdk-17.*")
6464
cd src/android
65-
./gradlew assembleDebug
65+
./gradlew assembleRelease

.github/workflows/package.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: package
2+
on:
3+
push:
4+
tags:
5+
- 'v*'
6+
jobs:
7+
package-linux:
8+
runs-on: ubuntu-24.04
9+
env:
10+
PACKAGE_NAME: NovaSwarm-x64-linux-v0.1.0.zip
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: init
14+
run: sudo apt update -yqq && sudo apt install -yqq ninja-build xorg-dev libpulse-dev libkpipewire-dev
15+
- name: package release
16+
run: cmake -DPACKAGE_NAME=${{ env.PACKAGE_NAME }} -P tools/package_release.cmake
17+
- name: upload release
18+
uses: softprops/action-gh-release@v2
19+
with:
20+
files: ${{ env.PACKAGE_NAME }}
21+
draft: true
22+
fail_on_unmatched_files: true
23+
package-windows:
24+
runs-on: windows-latest
25+
env:
26+
PACKAGE_NAME: NovaSwarm-x64-windows-v0.1.0.zip
27+
steps:
28+
- uses: actions/checkout@v4
29+
- name: package release
30+
run: cmake -DPACKAGE_NAME="${{ env.PACKAGE_NAME }}" -P tools/package_release.cmake
31+
- name: upload release
32+
uses: softprops/action-gh-release@v2
33+
with:
34+
files: ${{ env.PACKAGE_NAME }}
35+
draft: true
36+
fail_on_unmatched_files: true
37+
package-android:
38+
env:
39+
PACKAGE_NAME: NovaSwarm-arm64-android-v0.1.0.apk
40+
runs-on: ubuntu-24.04
41+
steps:
42+
- uses: actions/checkout@v4
43+
- name: init
44+
run: |
45+
wget https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.tar.gz
46+
tar xvzf jdk-17_linux-x64_bin.tar.gz -C /opt
47+
- name: build APK
48+
run: |
49+
export JAVA_HOME=$(find /opt -name "jdk-17.*")
50+
cd src/android
51+
./gradlew assembleRelease
52+
mv app/build/outputs/apk/release/app-release-unsigned.apk ../../$PACKAGE_NAME
53+
- name: upload release
54+
uses: softprops/action-gh-release@v2
55+
with:
56+
files: ${{ env.PACKAGE_NAME }}
57+
draft: true
58+
fail_on_unmatched_files: true
59+
package-macos:
60+
runs-on: macos-latest
61+
env:
62+
CPU_ARCH: arm64
63+
OS_NAME: macos
64+
PACKAGE_NAME: NovaSwarm-arm64-macos-v0.1.0.zip
65+
steps:
66+
- uses: actions/checkout@v4
67+
- name: init
68+
run: brew install ninja
69+
- name: package release
70+
run: cmake -DPACKAGE_NAME=${{ env.PACKAGE_NAME }} -P tools/package_release.cmake
71+
- name: upload release
72+
uses: softprops/action-gh-release@v2
73+
with:
74+
files: ${{ env.PACKAGE_NAME }}
75+
draft: true
76+
fail_on_unmatched_files: true
77+

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ compile_commands.json
1313

1414
imgui.ini
1515
bave*.log
16-
/spaced
16+
NovaSwarm*.log
17+
/userdata
1718
/notes.txt
1819
/local_store
1920
/massif.*
21+
/assets/assets.zip

CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
cmake_minimum_required(VERSION 3.22)
22

3-
project(spaced)
3+
file(READ build_version.txt build_version)
4+
5+
message(STATUS "spaced build version: ${build_version}")
6+
7+
project(spaced VERSION ${build_version})
8+
9+
configure_file(src/package.yml.in "${CMAKE_CURRENT_SOURCE_DIR}/.github/workflows/package.yml" @ONLY)
410

511
set(CMAKE_CXX_STANDARD 20)
612
set(CMAKE_CXX_STANDARD_REQUIRED ON)

README.md

Lines changed: 57 additions & 1 deletion
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

assets/assets/images/icon_player.png

7.57 KB
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

assets/assets/music/game.mp3

2.16 MB
Binary file not shown.

assets/assets/music/menu.mp3

772 KB
Binary file not shown.

assets/particles/exhaust.json renamed to assets/assets/particles/exhaust.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"asset_type": "ParticleEmitter",
3-
"texture": "images/foam_bubble.png",
3+
"texture": "assets/images/foam_bubble.png",
44
"config": {
55
"initial": {
66
"position": {

assets/particles/explode.json renamed to assets/assets/particles/explode.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"asset_type": "ParticleEmitter",
3-
"texture": "images/explode.png",
3+
"texture": "assets/images/explode.png",
44
"config": {
55
"initial": {
66
"position": {

assets/particles/powerup.json renamed to assets/assets/particles/powerup.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"asset_type": "ParticleEmitter",
3-
"texture": "images/foam_bubble.png",
3+
"texture": "assets/images/foam_bubble.png",
44
"config": {
55
"initial": {
66
"position": {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

assets/images/icon_player.png

-6.69 KB
Binary file not shown.

assets/music/game.mp3

-1.75 MB
Binary file not shown.

attribution.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
SpaceShooterRedux: https://opengameart.org/content/space-shooter-redux, https://www.kenney.nl
22
sfx/beam_fire.wav: https://opengameart.org/content/laser-rifle
33
sfx/swish.wav: https://opengameart.org/content/battle-sound-effects
4+
music/menu.mp3: https://opengameart.org/content/trouble-makers-coolriff-jazz
5+
music/game.mp3: https://opengameart.org/content/shake-and-bake

build_version.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.1.0

src/android/app/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ android {
1111
applicationId = "com.karnage.spaced"
1212
minSdk = 28
1313
targetSdk = 34
14-
versionCode = 1
15-
versionName = "1.0"
14+
versionCode = 100
15+
versionName = "0.1.0"
1616

1717
ndk {
1818
abiFilters.add("arm64-v8a")
@@ -22,7 +22,7 @@ android {
2222

2323
buildTypes {
2424
release {
25-
isMinifyEnabled = false
25+
isMinifyEnabled = true
2626
proguardFiles(
2727
getDefaultProguardFile("proguard-android-optimize.txt"),
2828
"proguard-rules.pro"
81.9 KB

src/android/app/res/icon.png

70.2 KB
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Nova Swarm does not collect any user data. It stores user preferences, play progression, and app statistics locally.

src/android/app/src/main/cpp/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ target_sources(${PROJECT_NAME} PRIVATE
1919
add_custom_target(copy-assets ALL
2020
${CMAKE_COMMAND} -E remove_directory "${CMAKE_CURRENT_SOURCE_DIR}/../assets"
2121
COMMAND ${CMAKE_COMMAND} -E copy_directory "${spaced_path}/assets" "${CMAKE_CURRENT_SOURCE_DIR}/../assets"
22+
COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_CURRENT_SOURCE_DIR}/../assets/assets.zip"
2223
)
2324

2425
add_dependencies(${PROJECT_NAME} copy-assets)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3+
<background android:drawable="@color/ic_launcher_background"/>
4+
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
5+
</adaptive-icon>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3+
<background android:drawable="@color/ic_launcher_background"/>
4+
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
5+
</adaptive-icon>

src/android/app/src/main/res/mipmap-anydpi/ic_launcher.xml

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

src/android/app/src/main/res/mipmap-anydpi/ic_launcher_round.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<color name="ic_launcher_background">#A27EE5</color>
4+
</resources>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<resources>
2-
<string name="app_name">Spaced</string>
2+
<string name="app_name">Nova Swarm</string>
33
</resources>

src/desktop/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,15 @@ add_executable(${PROJECT_NAME})
33
target_link_libraries(${PROJECT_NAME} PRIVATE spaced::lib)
44

55
target_sources(${PROJECT_NAME} PRIVATE main.cpp)
6+
7+
set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME NovaSwarm)
8+
9+
if(WIN32)
10+
target_sources(${PROJECT_NAME} PRIVATE windows/app.rc)
11+
12+
set(subsystem $<IF:$<BOOL:$<CONFIG:Debug>>,CONSOLE,WINDOWS>)
13+
target_link_options(${PROJECT_NAME} PRIVATE
14+
/SUBSYSTEM:${subsystem}
15+
/ENTRY:mainCRTStartup
16+
)
17+
endif()

src/desktop/main.cpp

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,34 @@
11
#include <bave/clap/clap.hpp>
22
#include <bave/desktop_app.hpp>
33
#include <spaced/build_version.hpp>
4+
#include <spaced/game_title.hpp>
45
#include <spaced/spaced.hpp>
56
#include <iostream>
67

78
namespace {
9+
using bave::App;
10+
using bave::DataLoaderBuilder;
11+
using bave::DesktopApp;
12+
using bave::to_string;
13+
14+
namespace {
15+
auto get_log_filename() {
16+
auto ret = std::string{};
17+
ret.reserve(spaced::game_title_v.size() + 4);
18+
for (char const c : spaced::game_title_v) {
19+
if (std::isspace(static_cast<unsigned char>(c)) != 0) { continue; }
20+
ret += c;
21+
}
22+
ret += ".log";
23+
return ret;
24+
}
25+
} // namespace
26+
827
auto parse_args(int const argc, char const* const* argv) -> std::optional<int> {
928
namespace clap = bave::clap;
1029
auto name = clap::make_app_name(*argv);
1130
auto description = std::string{"2D platformer game using bave"};
12-
auto version = bave::to_string(spaced::build_version_v);
31+
auto version = to_string(spaced::build_version_v);
1332
auto options = clap::Options{std::move(name), std::move(description), std::move(version)};
1433

1534
auto show_bave_version = false;
@@ -19,7 +38,7 @@ auto parse_args(int const argc, char const* const* argv) -> std::optional<int> {
1938
if (clap::should_quit(result)) { return clap::return_code(result); }
2039

2140
if (show_bave_version) {
22-
std::cout << "bave version " << bave::to_string(bave::build_version_v) << "\n";
41+
std::cout << "bave version " << to_string(bave::build_version_v) << "\n";
2342
return EXIT_SUCCESS;
2443
}
2544

@@ -29,7 +48,7 @@ auto parse_args(int const argc, char const* const* argv) -> std::optional<int> {
2948
void set_log_max_levels() {
3049
using Level = bave::log::Level;
3150
static constexpr auto warn_v = std::array{
32-
"DesktopApp", "DesktopDataStore", "Vulkan", "RenderDevice", "ImageCache", "BufferCache", "ShaderCache", "PipelineCache",
51+
"DesktopApp", "DataStore", "Vulkan", "RenderDevice", "ImageCache", "BufferCache", "ShaderCache", "PipelineCache",
3352
};
3453

3554
auto const set = [](auto const& names, Level const level) {
@@ -40,18 +59,19 @@ void set_log_max_levels() {
4059
}
4160

4261
auto run(int const argc, char const* const* argv) -> int {
43-
auto data_loader = bave::DataLoaderBuilder{argc, argv}.add_zip("assets.zip").add_dir("assets").build();
44-
auto create_info = bave::DesktopApp::CreateInfo{
45-
.title = "Spaced",
62+
auto data_loader_builder = DataLoaderBuilder{argc, argv}.add_zip("assets.zip").add_dir("assets");
63+
auto create_info = DesktopApp::CreateInfo{
64+
.title = spaced::game_title_v.data(),
4665
.mode = bave::Windowed{.extent = {1920, 1080}},
4766
.msaa = vk::SampleCountFlagBits::e4,
48-
.data_loader = std::move(data_loader),
67+
.data_loader = data_loader_builder.build(),
68+
.log_filename = get_log_filename(),
4969
};
5070

5171
set_log_max_levels();
5272

53-
auto app = bave::DesktopApp{std::move(create_info)};
54-
app.set_bootloader([](bave::App& app) { return std::make_unique<spaced::Spaced>(app); });
73+
auto app = DesktopApp{std::move(create_info)};
74+
app.set_bootloader([](App& app) { return std::make_unique<spaced::Spaced>(app); });
5575
return static_cast<int>(app.run());
5676
}
5777
} // namespace

src/desktop/windows/app.rc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
IDI_APPLICATION ICON "icon.ico"

src/desktop/windows/icon.ico

3.19 KB
Binary file not shown.

0 commit comments

Comments
 (0)