Skip to content

Commit b1622b7

Browse files
mobile port
just mayslastplays' mobile port cuz lily did bad stuff also i wanted to do this cuz some of my vs br devs only use mobile mmmmm
1 parent 233de0e commit b1622b7

Some content is hidden

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

52 files changed

+1892
-70
lines changed

.github/workflows/android.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Android Build
2+
on: workflow_dispatch
3+
jobs:
4+
build:
5+
name: Android Build
6+
permissions: write-all
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Pulling the new commit
10+
uses: actions/checkout@v2
11+
- name: Setting up Haxe
12+
uses: krdlab/setup-haxe@v1
13+
with:
14+
haxe-version: 4.2.5
15+
- name: Setup Android NDK
16+
id: setup-ndk
17+
uses: nttld/setup-ndk@main
18+
with:
19+
ndk-version: r25c
20+
- name: Restore Previous Cache
21+
id: cache-debug-build-android-restore
22+
uses: actions/cache/restore@main
23+
with:
24+
path: |
25+
.haxelib/
26+
export/release/android/haxe/
27+
export/release/android/obj/
28+
key: cache-android-build
29+
- name: Installing/Updating libraries
30+
run: |
31+
haxe -cp commandline -D analyzer-optimize --run Main setup -s
32+
haxelib run lime rebuild hxcpp
33+
34+
- name: Configure Android
35+
run: |
36+
haxelib run lime setup -alias -y
37+
haxelib run lime config ANDROID_SDK $ANDROID_HOME
38+
haxelib run lime config ANDROID_NDK_ROOT $ANDROID_NDK_HOME
39+
haxelib run lime config JAVA_HOME $JAVA_HOME_17_X64
40+
haxelib run lime config ANDROID_SETUP true
41+
- name: Building the game
42+
run: |
43+
haxelib run lime build android -final
44+
- name: Clear Previous Cache
45+
uses: actions/github-script@main
46+
with:
47+
script: |
48+
try {
49+
const caches = await github.rest.actions.getActionsCacheList({
50+
owner: context.repo.owner,
51+
repo: context.repo.repo,
52+
})
53+
if (typeof caches.data.actions_caches != null && caches.data.actions_caches.length > 0) {
54+
for (const cache of caches.data.actions_caches) {
55+
if (cache.key == "cache-android-build") {
56+
console.log('Clearing ' + cache.key + '...')
57+
await github.rest.actions.deleteActionsCacheById({
58+
owner: context.repo.owner,
59+
repo: context.repo.repo,
60+
cache_id: cache.id,
61+
})
62+
console.log("Previous Cache Cleared!")
63+
}
64+
}
65+
}
66+
} catch (error) {
67+
console.log(error.message);
68+
}
69+
- name: Save Current Cache
70+
id: cache-release-build-android-save
71+
uses: actions/cache/save@main
72+
with:
73+
path: |
74+
.haxelib/
75+
export/release/android/haxe/
76+
export/release/android/obj/
77+
key: cache-android-build
78+
- name: Uploading artifact (entire build)
79+
uses: actions/upload-artifact@v4
80+
with:
81+
name: Codename Engine Android
82+
path: export/release/android/bin/app/build/outputs/apk/debug

.github/workflows/ios.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: iOS Build
2+
on:
3+
workflow_dispatch:
4+
jobs:
5+
iOS:
6+
runs-on: macos-14
7+
steps:
8+
- name: Checkout
9+
uses: actions/checkout@main
10+
11+
- name: Setup Haxe
12+
uses: krdlab/setup-haxe@master
13+
with:
14+
haxe-version: 4.3.4
15+
16+
- name: Install Libraries
17+
run: |
18+
haxe -cp commandline -D analyzer-optimize --run Main setup -s
19+
haxelib run lime rebuild hxcpp
20+
21+
- name: Compile
22+
run: haxelib run lime build ios -nosign
23+
24+
- name: Create Ipa
25+
run: |
26+
cd export/release/ios/build/*-iphoneos
27+
mkdir Payload
28+
mv *.app Payload
29+
zip -r CodenameEngine.ipa Payload
30+
31+
- name: Upload Artifact
32+
uses: actions/upload-artifact@main
33+
with:
34+
name: CodenameEngine iOS
35+
path: export/release/ios/build/Release-iphoneos/*.ipa
36+
if-no-files-found: error

.vscode/settings.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"*.hx": "haxe",
66
"*.hscript": "haxe",
77
"*.hsc": "haxe",
8-
"*.hxs": "haxe"
9-
}
8+
"*.hxs": "haxe",
9+
"iostream": "cpp"
10+
}
1011
}

assets/data/scripts/week6-pause.hx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import funkin.ui.FunkinText;
22
import flixel.text.FlxText;
33
import flixel.text.FlxTextBorderStyle;
44
import flixel.util.FlxAxes;
5+
#if mobile
6+
import funkin.mobile.FlxDPadMode;
7+
import funkin.mobile.FlxActionMode;
8+
#end
59

610
var pixelScript:Script;
711
var pauseCam = new FlxCamera();
@@ -62,7 +66,10 @@ function create(event) {
6266
cameras = [pauseCam];
6367

6468
FlxG.sound.play(Paths.sound(isThorns ? 'pixel/ANGRY' : 'pixel/clickText'));
65-
}
69+
70+
#if mobile
71+
setVirtualPad(FlxDPadMode.UP_DOWN, FlxActionMode.A, true);
72+
#end
6673

6774
function confText(text) {
6875
text.scale.set(6, 6);

assets/mobile/arrows.png

5.21 KB
Loading

assets/mobile/arrows.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<TextureAtlas imagePath="arrows.png">
3+
<!-- Created using the Spritesheet and XML generator -->
4+
<!-- https://uncertainprod.github.io/FNF-Spritesheet-XML-generator-Web -->
5+
<SubTexture name="arrow left0000" x="0" y="0" width="52" height="89" frameX="2" frameY="2" frameWidth="48" frameHeight="85"/>
6+
<SubTexture name="arrow push left0000" x="103" y="0" width="46" height="79" frameX="2" frameY="2" frameWidth="42" frameHeight="75"/>
7+
<SubTexture name="arrow push right0000" x="149" y="0" width="45" height="78" frameX="2" frameY="2" frameWidth="41" frameHeight="74"/>
8+
<SubTexture name="arrow right0000" x="52" y="0" width="51" height="89" frameX="2" frameY="2" frameWidth="47" frameHeight="85"/>
9+
</TextureAtlas>

assets/mobile/virtual-input.png

2.36 MB
Loading

assets/mobile/virtual-input.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
base = 798 138 252 252
2+
thumb = 798 393 156 156
3+
a = 0 0 396 135
4+
b = 0 138 396 135
5+
c = 0 276 396 135
6+
down = 0 414 396 135
7+
left = 399 0 396 135
8+
right = 399 138 396 135
9+
up = 399 276 396 135
10+
x = 798 0 396 135
11+
y = 399 414 396 135

commandline/commands/Update.hx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,13 @@ class Update {
1414
if (!FileSystem.exists('.haxelib'))
1515
FileSystem.createDirectory('.haxelib');
1616

17-
var filename = "./libs.xml";
17+
var filename = #if desktop "./libs.xml" #else "./libs-mobile.xml" #end;
1818
var isSilent = false;
1919
for(arg in args) {
20-
if (arg.startsWith("--lib=")) {
20+
if (arg.startsWith("--lib="))
2121
filename = arg.substr("--lib=".length);
22-
}
23-
if (arg == "--silent" || arg == "-s") {
22+
if (arg == "--silent" || arg == "-s")
2423
isSilent = true;
25-
}
2624
}
2725

2826
if(!FileSystem.exists(filename)) {

libs-mobile.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<libraries>
3+
<!-- OpenFL & Lime (Required for Flixel) -->
4+
<lib name="openfl" version="9.2.2" />
5+
<git name="lime" url="https://github.com/MaysLastPlays-Stuff/lime-h"/>
6+
7+
<!-- Flixel -->
8+
<git name="flixel" url="https://github.com/CodenameCrew/cne-flixel" />
9+
<git name="flixel-addons" url="https://github.com/CodenameCrew/cne-flixel-addons" />
10+
<lib name="flixel-ui" version="2.6.1" />
11+
12+
<!-- Other Libraries -->
13+
<git name="hscript-improved" url="https://github.com/CodenameCrew/hscript-improved" ref="custom-classes" />
14+
<git name="flxanimate" url="https://github.com/CodenameCrew/cne-flxanimate" />
15+
<lib name="hxvlc" version="1.9.3" skipDeps="true" />
16+
17+
<!-- Documentation and other features -->
18+
<git name="away3d" url="https://github.com/CodenameCrew/away3d" />
19+
<!-- <lib name="dox" /> -->
20+
<lib name="format" />
21+
<lib name="markdown" />
22+
<lib name="nape-haxe4" />
23+
24+
<!-- Mobile Libraries -->
25+
<git name="hxcpp" url="https://github.com/MaysLastPlays-Stuff/hxcpp-h" />
26+
<git name="extension-androidtools" url="https://github.com/MAJigsaw77/extension-androidtools" skipDeps="true" unless="ios"/>
27+
28+
</libraries>

0 commit comments

Comments
 (0)