From 415418eb89bf699d20c893a6f2d52b658418bc05 Mon Sep 17 00:00:00 2001 From: Lucas Martin-King Date: Sat, 18 May 2024 22:53:41 +1000 Subject: [PATCH 01/16] Add edition to menu state --- source/MenuState.hx | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/source/MenuState.hx b/source/MenuState.hx index 21de3dc..103e720 100644 --- a/source/MenuState.hx +++ b/source/MenuState.hx @@ -1,7 +1,11 @@ package; +import flixel.addons.effects.chainable.FlxRainbowEffect; +import flixel.addons.effects.chainable.FlxEffectSprite; import flixel.text.FlxText; import flixel.group.FlxSpriteGroup; +import flixel.tweens.FlxTween; +import flixel.tweens.FlxTween.FlxTweenType; import flixel.FlxG; import flixel.FlxState; @@ -83,7 +87,7 @@ class MenuState extends FlxState #end buttonGroup.screenCenter(); - buttonGroup.y += 30; + buttonGroup.y += 35; title.screenCenter(); title.y -= 60; @@ -100,10 +104,29 @@ class MenuState extends FlxState #end #end // demo + var edition = new FlxText(); + edition.borderStyle = FlxTextBorderStyle.SHADOW; + edition.borderSize = 1.0; + edition.text = "10th Anniversary Edition!"; + + edition.centerOrigin(); + edition.screenCenter(); + edition.y -= 35; + + var editionEffect = new FlxEffectSprite(edition); + var rainbow = new FlxRainbowEffect(0.5); + editionEffect.effects = [rainbow]; + editionEffect.active = rainbow.active = true; + editionEffect.x = edition.x; + editionEffect.y = edition.y; + FlxTween.tween(editionEffect, { "scale.x": 1.1, "scale.y": 1.1 }, 1.0, { type: FlxTweenType.PINGPONG }); + add(backdrop); add(title); add(buttonGroup); + add(editionEffect); + var buildNote = new FlxText(); buildNote.size = 8; buildNote.alignment = "right"; From 14782edb953828815fd2d731e84e10ea798a5f10 Mon Sep 17 00:00:00 2001 From: Lucas Martin-King Date: Sat, 18 May 2024 23:09:43 +1000 Subject: [PATCH 02/16] Simplify Main.hx per template code --- source/Main.hx | 31 +++---------------------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/source/Main.hx b/source/Main.hx index eac8c25..6cfe0ec 100644 --- a/source/Main.hx +++ b/source/Main.hx @@ -1,37 +1,12 @@ package; -import flash.display.Sprite; -import flash.events.Event; -import flash.Lib; +import openfl.display.Sprite; -class Main extends Sprite +class Main extends Sprite { - public static function main():Void - { - Lib.current.addChild(new Main()); - } - - public function new() + public function new() { super(); - - if (stage != null) - { - init(); - } - else - { - addEventListener(Event.ADDED_TO_STAGE, init); - } - } - - private function init(?E:Event):Void - { - if (hasEventListener(Event.ADDED_TO_STAGE)) - { - removeEventListener(Event.ADDED_TO_STAGE, init); - } - addChild(new Game()); } } From be30e17aebbfec5f0112ab1ca24aa75ef54c4c89 Mon Sep 17 00:00:00 2001 From: Lucas Martin-King Date: Sat, 18 May 2024 23:21:45 +1000 Subject: [PATCH 03/16] Add support for directly running a level via a dev parameter --- source/Game.hx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source/Game.hx b/source/Game.hx index ce20e35..067fa7d 100644 --- a/source/Game.hx +++ b/source/Game.hx @@ -36,6 +36,7 @@ class Game extends FlxGame { var framerate:Int = 60; // How many frames per second the game should run at. var skipSplash:Bool = true; // Whether to skip the flixel splash screen that appears in release mode. var startFullscreen:Bool = false; // Whether to start the game in fullscreen on desktop targets + var devLevelIndex:Int = -1; // For Development purposes: Index of level to jump straight into var stageWidth:Int = Lib.current.stage.stageWidth; var stageHeight:Int = Lib.current.stage.stageHeight; @@ -57,7 +58,14 @@ class Game extends FlxGame { seenInstructions = false; attachAutoSave(); - if (Reg.autoSave.data.active != null && Reg.autoSave.data.active == true) + if (devLevelIndex >= 0) + { + Reg.level = devLevelIndex; + Reg.resumed = true; // Pause + initialState = PlayState; + trace('DEV starting at level: ${Reg.level}'); + } + else if (Reg.autoSave.data.active != null && Reg.autoSave.data.active == true) { Reg.score = Reg.autoSave.data.score; Reg.level = Reg.autoSave.data.level; From 63e58e1727b7e33f5b14f0a90633323fe80ad34c Mon Sep 17 00:00:00 2001 From: Lucas Martin-King Date: Thu, 27 Mar 2025 18:14:48 +1100 Subject: [PATCH 04/16] Reorder imports; Tweaks --- source/Game.hx | 12 +++--- source/PlayState.hx | 66 +++++++++++++++------------------ source/Reg.hx | 3 +- source/misc/GlobalHighscores.hx | 14 +++---- 4 files changed, 42 insertions(+), 53 deletions(-) diff --git a/source/Game.hx b/source/Game.hx index 067fa7d..bf1cd69 100644 --- a/source/Game.hx +++ b/source/Game.hx @@ -1,15 +1,13 @@ package ; -import flixel.FlxGame; -import flixel.FlxG; -import flixel.FlxState; -import flixel.util.FlxSave; -import flixel.sound.FlxSound; - import flash.Lib; - import Reg.HighScore; import Reg.LevelStats; +import flixel.FlxG; +import flixel.FlxGame; +import flixel.FlxState; +import flixel.sound.FlxSound; +import flixel.util.FlxSave; import misc.GlobalHighscores; class Game extends FlxGame { diff --git a/source/PlayState.hx b/source/PlayState.hx index ca00655..423914a 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -1,46 +1,38 @@ package; -import flixel.util.FlxDirectionFlags; -import flixel.math.FlxPoint; -import flixel.FlxG; +import Input; +import LevelLoader; +import PlayStateHUD; import flixel.FlxBasic; -import flixel.FlxSprite; -import flixel.FlxState; import flixel.FlxCamera; +import flixel.FlxG; import flixel.FlxObject; +import flixel.FlxSprite; +import flixel.FlxState; import flixel.FlxSubState; - -import flixel.sound.FlxSound; -import flixel.system.FlxQuadTree; - -import flixel.group.FlxGroup; -//import flixel.group.FlxTypedGroup; - -import flixel.text.FlxText; -import flixel.util.FlxColor; -import flixel.path.FlxPath; -import flixel.util.FlxDestroyUtil; - -import flixel.math.FlxPoint; - -import flixel.tweens.FlxTween; -import flixel.effects.FlxFlicker; -import flixel.addons.effects.FlxTrail; import flixel.addons.display.FlxBackdrop; -import flixel.addons.effects.chainable.IFlxEffect; +import flixel.addons.editors.tiled.TiledObject; +import flixel.addons.editors.tiled.TiledPropertySet; +import flixel.addons.effects.FlxTrail; import flixel.addons.effects.chainable.FlxEffectSprite; import flixel.addons.effects.chainable.FlxGlitchEffect; +import flixel.addons.effects.chainable.IFlxEffect; +import flixel.addons.tile.FlxTilemapExt; +import flixel.effects.FlxFlicker; import flixel.effects.particles.FlxEmitter; - -import flixel.tile.FlxTilemap; +import flixel.group.FlxGroup; +import flixel.math.FlxPoint; +import flixel.math.FlxPoint; +import flixel.path.FlxPath; +import flixel.sound.FlxSound; +import flixel.system.FlxQuadTree; +import flixel.text.FlxText; import flixel.tile.FlxBaseTilemap; -import flixel.addons.tile.FlxTilemapExt; -import flixel.addons.editors.tiled.TiledObject; -import flixel.addons.editors.tiled.TiledPropertySet; - -import Input; -import PlayStateHUD; -import LevelLoader; +import flixel.tile.FlxTilemap; +import flixel.tweens.FlxTween; +import flixel.util.FlxColor; +import flixel.util.FlxDestroyUtil; +import flixel.util.FlxDirectionFlags; /** * A FlxState which can be used for the actual gameplay. @@ -50,7 +42,7 @@ class PlayState extends FlxState private var wallMap:FlxTilemap; private var bounceMap:FlxTilemap; private var decorationMap:FlxTilemap; - private var overlayMap:FlxTilemapExt; + private var overlayMap:FlxTilemap; private var spikeGroup:FlxTypedGroup; private var objectGroup:FlxTypedGroup; private var powerupGroup:FlxTypedGroup; @@ -208,8 +200,10 @@ class PlayState extends FlxState add(playerTrail); add(player); - if (overlayMap != null) + if (overlayMap != null) { + trace('added overlayMap'); add(overlayMap); + } add(scanlines); @@ -458,7 +452,7 @@ class PlayState extends FlxState return overlayMap.overlapsWithCallback(player); }); - overlayMap.alpha = (under ? OVERLAY_ALPHA : 1.0); + overlayMap.visible = !under; } FlxG.collide(endArea, player, onEndAreaHit); @@ -607,7 +601,7 @@ class PlayState extends FlxState case "overlay": // Convert to a FlxTilemapExt since we need alpha support - overlayMap = new FlxTilemapExt(); + overlayMap = new FlxTilemap(); var tileWidth = Math.floor(obj.width / obj.widthInTiles); var tileHeight = Math.floor(obj.height / obj.heightInTiles); overlayMap.loadMapFromArray(obj.getData(), diff --git a/source/Reg.hx b/source/Reg.hx index 4e40415..96811d7 100644 --- a/source/Reg.hx +++ b/source/Reg.hx @@ -1,8 +1,7 @@ package; -import flixel.util.FlxSave; - import PlayState.SavePointState; +import flixel.util.FlxSave; /** * Handy, pre-built Registry class that can be used to store diff --git a/source/misc/GlobalHighscores.hx b/source/misc/GlobalHighscores.hx index a5366b0..037c3eb 100644 --- a/source/misc/GlobalHighscores.hx +++ b/source/misc/GlobalHighscores.hx @@ -1,20 +1,18 @@ package misc; import StringTools; +import flash.events.Event; +import flash.events.HTTPStatusEvent; import haxe.crypto.Base64; -import haxe.io.Bytes; import haxe.crypto.Hmac; - +import haxe.io.Bytes; +import Reg.HighScore; import openfl.events.IOErrorEvent; import openfl.events.SecurityErrorEvent; -import flash.events.HTTPStatusEvent; -import flash.events.Event; -import openfl.net.URLLoaderDataFormat; -import openfl.net.URLRequestMethod; import openfl.net.URLLoader; +import openfl.net.URLLoaderDataFormat; import openfl.net.URLRequest; - -import Reg.HighScore; +import openfl.net.URLRequestMethod; import misc.MacroStuff; class GlobalHighscores { From 7061fa9d13aa9cde27290592da6b54b2f0ad0f75 Mon Sep 17 00:00:00 2001 From: Lucas Martin-King Date: Thu, 27 Mar 2025 18:30:20 +1100 Subject: [PATCH 05/16] Gamepad support! --- Project.xml | 3 +-- source/Input.hx | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/Project.xml b/Project.xml index 66b2229..73d5e04 100644 --- a/Project.xml +++ b/Project.xml @@ -83,8 +83,7 @@ - - + diff --git a/source/Input.hx b/source/Input.hx index a9d3365..da312ec 100644 --- a/source/Input.hx +++ b/source/Input.hx @@ -77,35 +77,35 @@ class Input { public static function skipPressed():Bool { #if (desktop || flash || html5) - return FlxG.keys.justPressed.SPACE || FlxG.mouse.pressed; + return FlxG.keys.justPressed.SPACE || FlxG.mouse.pressed || FlxG.gamepads.anyJustPressed(ANY); #end #if mobile - return isTouched(); + return isTouched() || FlxG.gamepads.anyJustPressed(ANY); #end } public static function flipPressed():Bool { #if (desktop || flash || html5) - return FlxG.keys.justPressed.SPACE; + return FlxG.keys.justPressed.SPACE || FlxG.gamepads.anyJustPressed(A) || FlxG.gamepads.anyJustPressed(B); #end #if mobile - return isTouched(); + return isTouched() || FlxG.gamepads.anyJustPressed(A) || FlxG.gamepads.anyJustPressed(B); #end } public static function bouncePressed():Bool { #if (desktop || flash || html5) - return FlxG.keys.justPressed.CONTROL; + return FlxG.keys.justPressed.CONTROL || FlxG.gamepads.anyJustPressed(X); #end #if mobile if (bounceFlag) { - return true; + return true || FlxG.gamepads.anyJustPressed(X); } #end @@ -115,20 +115,20 @@ class Input { public static function stopHeld():Bool { #if (desktop || flash || html5) - return FlxG.keys.pressed.SHIFT; + return FlxG.keys.pressed.SHIFT || FlxG.gamepads.anyPressed(Y); #end - return stopFlag; + return stopFlag || FlxG.gamepads.anyPressed(Y); } public static function escapePressed():Bool { #if (desktop || flash || html5) - return FlxG.keys.justPressed.ESCAPE; + return FlxG.keys.justPressed.ESCAPE || FlxG.gamepads.anyPressed(START); #end #if android - return FlxG.android.justPressed("BACK"); + return FlxG.android.justPressed("BACK") || FlxG.gamepads.anyPressed(START); #end return false; From 40e548cc8a87d8d518b3ae12a33238a305b2232f Mon Sep 17 00:00:00 2001 From: Lucas Martin-King Date: Sun, 6 Apr 2025 20:17:25 +1000 Subject: [PATCH 06/16] update android architecture --- Project.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.xml b/Project.xml index 73d5e04..b97f0a5 100644 --- a/Project.xml +++ b/Project.xml @@ -34,8 +34,8 @@ - + From 4b1f064558c3f414f91294050e389a9afb462a17 Mon Sep 17 00:00:00 2001 From: Lucas Martin-King Date: Sun, 6 Apr 2025 20:18:14 +1000 Subject: [PATCH 07/16] update to flixel 6.0.0; fix some deprecations --- Project.xml | 6 +++--- source/PlayState.hx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Project.xml b/Project.xml index b97f0a5..b70dce3 100644 --- a/Project.xml +++ b/Project.xml @@ -60,13 +60,13 @@ - + - + - + diff --git a/source/PlayState.hx b/source/PlayState.hx index 423914a..4c449ef 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -285,7 +285,7 @@ class PlayState extends FlxState savePoint.velocity.set(player.velocity.x, player.velocity.y); savePoint.accelleration.set(player.acceleration.x, player.acceleration.y); savePoint.flipY = player.flipY; - savePoint.facing = player.facing; + savePoint.facing = player.facing.toInt(); savePoint.timeElapsed = stats.elapsedTime; } @@ -294,7 +294,7 @@ class PlayState extends FlxState if (savePoint == null) return false; - player.facing = savePoint.facing; + player.facing = FlxDirectionFlags.fromInt(savePoint.facing); player.flipY = savePoint.flipY; player.acceleration.set(savePoint.accelleration.x, savePoint.accelleration.y); player.velocity.set(savePoint.velocity.x, savePoint.velocity.y); From 6fc19ca1a035d4745832ea69cd19c7f37ad36b93 Mon Sep 17 00:00:00 2001 From: Lucas Martin-King Date: Sun, 6 Apr 2025 20:52:59 +1000 Subject: [PATCH 08/16] Update README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2aa8624..26bcabf 100644 --- a/README.md +++ b/README.md @@ -31,12 +31,12 @@ You will need Haxe, OpenFL/Lime and HaxeFlixel set up. ### Known Working Versions of Dependencies - * Haxe 4.3.4 - * HxCPP 4.3.2 - * Flixel 5.8.0 - * Flixel UI 2.6.1 - * Lime 8.1.2 - * OpenFL 9.3.3 + * Haxe 4.3.6 + * HxCPP 4.3.78 (Note this is a not published to Haxelib as yet) + * Flixel 6.0.0 + * Flixel UI 2.6.4 + * Lime 8.2.2 + * OpenFL 9.4.1 ### Then From d5495d65afdd6ff00b989d24b96f98983514e34c Mon Sep 17 00:00:00 2001 From: Lucas Martin-King Date: Sun, 6 Apr 2025 20:54:28 +1000 Subject: [PATCH 09/16] Bump version to 1.1.0 --- Project.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.xml b/Project.xml index b70dce3..a513d85 100644 --- a/Project.xml +++ b/Project.xml @@ -2,7 +2,7 @@ - + From 605269bee0187102485fac1170fd784ac4d6319d Mon Sep 17 00:00:00 2001 From: Lucas Martin-King Date: Sun, 6 Apr 2025 21:04:52 +1000 Subject: [PATCH 10/16] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 26bcabf..701575e 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Quik The source and assets for [Quik: Gravity Flip Platformer](https://irrationalidiom.com/quik). -**This is the develop branch, updated to use Flixel 4.** +**This is the develop branch, updated to use Flixel 6.** It is inspired by two games I love: _Cannabalt_ and _VVVVVV_. From 03e0bd4a38875cd13e912f5eccf17a9b5aa14c50 Mon Sep 17 00:00:00 2001 From: Lucas Martin-King Date: Sun, 6 Apr 2025 21:05:10 +1000 Subject: [PATCH 11/16] Fixes for android --- source/Game.hx | 2 +- source/Input.hx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/Game.hx b/source/Game.hx index bf1cd69..1d62caf 100644 --- a/source/Game.hx +++ b/source/Game.hx @@ -152,7 +152,7 @@ class Game extends FlxGame { #if android // Default behavior is to end the current activity, instead // we can use this for our pause screen - FlxG.android.preventDefaultBackAction = true; + FlxG.android.preventDefaultKeys = [BACK]; #end loadGlobalSettings(); diff --git a/source/Input.hx b/source/Input.hx index da312ec..c40e494 100644 --- a/source/Input.hx +++ b/source/Input.hx @@ -128,7 +128,7 @@ class Input { #end #if android - return FlxG.android.justPressed("BACK") || FlxG.gamepads.anyPressed(START); + return FlxG.android.justPressed.BACK || FlxG.gamepads.anyPressed(START); #end return false; From d9072428bc3e78d8fc724b79a3bf53b8e221efb8 Mon Sep 17 00:00:00 2001 From: Lucas Martin-King Date: Mon, 7 Apr 2025 00:57:49 +1000 Subject: [PATCH 12/16] More fixes for android --- .github/workflows/build-android.yaml | 50 ++++++++++++++++++++++++++++ Project.xml | 10 +++--- README.md | 12 ++++++- 3 files changed, 67 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/build-android.yaml diff --git a/.github/workflows/build-android.yaml b/.github/workflows/build-android.yaml new file mode 100644 index 0000000..e28b000 --- /dev/null +++ b/.github/workflows/build-android.yaml @@ -0,0 +1,50 @@ +name: OpenFL android + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-java@v4 + with: + java-version: "17" + distribution: "temurin" + + - name: Setup Android SDK + uses: android-actions/setup-android@v3 + + - uses: nttld/setup-ndk@v1 + id: setup-ndk + with: + ndk-version: '27.0.12077973' + + - uses: krdlab/setup-haxe@v1 + with: + haxe-version: 4.2.5 + + - name: Set up Haxelib dependencies + run: | + haxelib install lime --quiet + haxelib install openfl --quiet + haxelib install hxcpp 4.2.1 --quiet + + - name: lime setup android + run: | + haxelib run lime config ANDROID_SDK $ANDROID_SDK_ROOT + haxelib run lime config ANDROID_NDK_ROOT ${{ steps.setup-ndk.outputs.ndk-path }} + haxelib run lime config JAVA_HOME ${{ env.JAVA_HOME }} + haxelib run lime config ANDROID_SETUP true + haxelib run lime config + + - name: Build + run: | + haxelib run lime build android -Drelease + + - name: List Outputs + run: | + ls -l ./export/android/bin/app/ diff --git a/Project.xml b/Project.xml index a513d85..ae88d79 100644 --- a/Project.xml +++ b/Project.xml @@ -4,7 +4,6 @@ -
@@ -31,11 +30,14 @@ + - - - + + + + + diff --git a/README.md b/README.md index 701575e..4e45f96 100644 --- a/README.md +++ b/README.md @@ -32,12 +32,22 @@ You will need Haxe, OpenFL/Lime and HaxeFlixel set up. ### Known Working Versions of Dependencies * Haxe 4.3.6 - * HxCPP 4.3.78 (Note this is a not published to Haxelib as yet) + * HxCPP 4.3.78 (Note this is a not published to Haxelib as yet, find it [here](https://github.com/HaxeFoundation/hxcpp/releases/tag/v4.3.79)) * Flixel 6.0.0 * Flixel UI 2.6.4 * Lime 8.2.2 * OpenFL 9.4.1 +#### Android Dependencies + +The first two are highly specific, and line up with HXCPP and OpenFL/Lime. + + * NDK 27.0.12077973 + * Android 15 SDK (API level 35) + + * SDK Build Tools 36.0.0 + * SDK Command Line Tools 19.0 + ### Then ``` From 5b11c89516bfc062262bafff923ef754b1e1aa60 Mon Sep 17 00:00:00 2001 From: Lucas Martin-King Date: Mon, 7 Apr 2025 20:27:12 +1000 Subject: [PATCH 13/16] Android CI build (#3) --- .github/workflows/build-android.yaml | 67 ++++++++++++++++++++++------ Project.xml | 16 ++++--- README.md | 2 +- source/MenuState.hx | 5 +++ 4 files changed, 69 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build-android.yaml b/.github/workflows/build-android.yaml index e28b000..585a0b8 100644 --- a/.github/workflows/build-android.yaml +++ b/.github/workflows/build-android.yaml @@ -1,4 +1,4 @@ -name: OpenFL android +name: Android Build on: [push, pull_request] @@ -15,23 +15,38 @@ jobs: java-version: "17" distribution: "temurin" - - name: Setup Android SDK - uses: android-actions/setup-android@v3 - - uses: nttld/setup-ndk@v1 id: setup-ndk with: - ndk-version: '27.0.12077973' + ndk-version: r27 # 27.0.12077973, see: https://github.com/android/ndk/releases/tag/r27 - uses: krdlab/setup-haxe@v1 with: - haxe-version: 4.2.5 + haxe-version: 4.3.6 - name: Set up Haxelib dependencies run: | - haxelib install lime --quiet - haxelib install openfl --quiet - haxelib install hxcpp 4.2.1 --quiet + haxelib install openfl 9.4.1 + haxelib install lime 8.2.2 + haxelib install flixel 6.0.0 + haxelib install flixel-addons 3.3.2 + haxelib install flixel-ui 2.6.4 + haxelib install hxcpp + + - name: Set up hxcpp 4.3.78 + run: | + echo ">>> Existing hxcpp <<<" + ls -l $(haxelib config)/hxcpp/ + + echo ">>> Updated hxcpp <<<" + set -ex + pushd $(mktemp -d) + wget -O hxcpp.zip https://github.com/HaxeFoundation/hxcpp/releases/download/v4.3.78/hxcpp-4.3.78.zip + unzip hxcpp.zip + mv hxcpp-4.3.78 '4,3,78' + mkdir -p $(haxelib config)/hxcpp/ || true + mv '4,3,78' $(haxelib config)/hxcpp/ + haxelib set hxcpp 4.3.78 - name: lime setup android run: | @@ -41,10 +56,36 @@ jobs: haxelib run lime config ANDROID_SETUP true haxelib run lime config - - name: Build + - name: Set up keystore + run: | + set -ex + KS_FILE="$(mktemp --suffix='.keystore')" + chmod 600 $KS_FILE + echo -En '${{ secrets.QUIK_DEV_KEYSTORE }}' | base64 -d > $KS_FILE + chmod 400 $KS_FILE + echo "KEYSTORE_FILE=$KS_FILE" >> $GITHUB_ENV + + - name: Build APK run: | - haxelib run lime build android -Drelease + haxelib run lime build android -final -Drelease \ + --certificate-path=$KEYSTORE_FILE --certificate-alias=dev --certificate-password=changeme - - name: List Outputs + - name: Build Bundle run: | - ls -l ./export/android/bin/app/ + export ANDROID_GRADLE_TASK=":app:bundleRelease" + haxelib run lime build android -final -Drelease \ + --certificate-path=$KEYSTORE_FILE --certificate-alias=dev --certificate-password=changeme + + - name: Upload APK (Release) + uses: actions/upload-artifact@main + with: + name: quik-release.apk + path: ./export/android/bin/app/build/outputs/apk/release/quik-release.apk + if-no-files-found: warn + + - name: Upload Bundle (Release) + uses: actions/upload-artifact@main + with: + name: quik-release.aab + path: ./export/android/bin/app/build/outputs/bundle/release/app-release.aab + if-no-files-found: warn diff --git a/Project.xml b/Project.xml index ae88d79..33bf5dc 100644 --- a/Project.xml +++ b/Project.xml @@ -31,13 +31,15 @@ - - - - - - - +
+ + + + + + + +
diff --git a/README.md b/README.md index 4e45f96..a734193 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ You will need Haxe, OpenFL/Lime and HaxeFlixel set up. ### Known Working Versions of Dependencies * Haxe 4.3.6 - * HxCPP 4.3.78 (Note this is a not published to Haxelib as yet, find it [here](https://github.com/HaxeFoundation/hxcpp/releases/tag/v4.3.79)) + * HxCPP 4.3.78 (Note this is a not published to Haxelib as yet, find it [here](https://github.com/HaxeFoundation/hxcpp/releases/tag/v4.3.78)) * Flixel 6.0.0 * Flixel UI 2.6.4 * Lime 8.2.2 diff --git a/source/MenuState.hx b/source/MenuState.hx index 103e720..b9c3c39 100644 --- a/source/MenuState.hx +++ b/source/MenuState.hx @@ -111,7 +111,12 @@ class MenuState extends FlxState edition.centerOrigin(); edition.screenCenter(); + #if !mobile edition.y -= 35; + #end + #if mobile + edition.y -= 15; + #end var editionEffect = new FlxEffectSprite(edition); var rainbow = new FlxRainbowEffect(0.5); From 70da7605b4fa704b98ddcf89ed28b884616087ac Mon Sep 17 00:00:00 2001 From: Lucas Martin-King Date: Tue, 8 Apr 2025 00:33:19 +1000 Subject: [PATCH 14/16] Position fudge for horizontal platforms --- source/PlayState.hx | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/source/PlayState.hx b/source/PlayState.hx index 4c449ef..33db5b2 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -938,14 +938,32 @@ class Platform extends FlxSprite newPath.push(new FlxPoint(this.x + p.x, this.y + p.y)); } - if (points.length > 0) + if (newPath.length > 0) { - this.x = points[0].x; - this.y = points[0].y; + var horiz = newPath[0].y == newPath[newPath.length - 1].y; + var vert = newPath[0].x == newPath[newPath.length - 1].x; + + // FUDGE: There is a bug where horizontal platforms are not at the correct starting position. + // However, applying the fix breaks vertical platforms in existing levels. So just apply the fudge + // for horizontal platforms only. + + var positionFudge = horiz; + + if (positionFudge) + { + this.x = newPath[0].x; + this.y = newPath[0].y; + } + else + { + this.x = points[0].x; + this.y = points[0].y; + } } this.path = FlxDestroyUtil.destroy(this.path); this.path = new FlxPath(); + this.path.start(newPath, speed, FlxPathType.YOYO); this.path.setNode(0); From 39084b73c2cdf20ba38b6effc2a4cd84589cbd7d Mon Sep 17 00:00:00 2001 From: Lucas Martin-King Date: Tue, 8 Apr 2025 12:52:47 +1000 Subject: [PATCH 15/16] Properly fix platforms --- source/PlayState.hx | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/source/PlayState.hx b/source/PlayState.hx index 33db5b2..c0fbd88 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -940,29 +940,14 @@ class Platform extends FlxSprite if (newPath.length > 0) { - var horiz = newPath[0].y == newPath[newPath.length - 1].y; - var vert = newPath[0].x == newPath[newPath.length - 1].x; - - // FUDGE: There is a bug where horizontal platforms are not at the correct starting position. - // However, applying the fix breaks vertical platforms in existing levels. So just apply the fudge - // for horizontal platforms only. - - var positionFudge = horiz; - - if (positionFudge) - { - this.x = newPath[0].x; - this.y = newPath[0].y; - } - else - { - this.x = points[0].x; - this.y = points[0].y; - } + this.x = newPath[0].x; + this.y = newPath[0].y; } this.path = FlxDestroyUtil.destroy(this.path); this.path = new FlxPath(); + // IMPORTANT to ensure the platform is in the expected starting position + this.path.centerMode = FlxPathAnchorMode.TOP_LEFT; this.path.start(newPath, speed, FlxPathType.YOYO); this.path.setNode(0); @@ -986,7 +971,11 @@ class Platform extends FlxSprite super(xPos, yPos, assetPath); - centerOrigin(); + // Due to changes in newer versions of Flixel, we need to adjust the position + // to keep platforms working the same as when the game was first coded (Flixel 3). + // See also: setPath() + this.x -= this.width / 2; + this.y -= this.height / 2; } override public function destroy():Void From e0a365de22468fa9fd25f39647a97d72e8f9a6ed Mon Sep 17 00:00:00 2001 From: Lucas Martin-King Date: Tue, 8 Apr 2025 13:22:01 +1000 Subject: [PATCH 16/16] FPS 60 for mobile --- source/Game.hx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/source/Game.hx b/source/Game.hx index 1d62caf..cf6a723 100644 --- a/source/Game.hx +++ b/source/Game.hx @@ -49,10 +49,6 @@ class Game extends FlxGame { trace("zoom is now", zoom); } - #if mobile - framerate = 30; - #end - seenInstructions = false; attachAutoSave();