diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..2f5488a9 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,3 @@ +# These are supported funding model platforms + +ko_fi: codename_engine diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 1efcfcfa..2d2dc145 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -7,7 +7,7 @@ jobs: build: name: Linux Build permissions: write-all - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Pulling the source uses: actions/checkout@v2 @@ -35,13 +35,13 @@ jobs: - name: Building the game run: | haxelib run lime build linux - - name: Tar files - run: tar -zcvf CodenameEngine.tar.gz -C export/release/linux/bin . + # - name: Tar files + # run: tar -zcvf CodenameEngine.tar.gz -C export/release/linux/bin . - name: Uploading artifact (entire build) uses: actions/upload-artifact@v4 with: name: Codename Engine - path: CodenameEngine.tar.gz + path: export/release/linux/bin/ # - name: Uploading artifact (executable) # uses: actions/upload-artifact@v4 # with: diff --git a/README.md b/README.md index 4ba32a47..fb3918bb 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,6 @@ If you don't have a github account please go onto https://fnf-cne-devs.github.io

Credits

-- Credits to [Ne_Eo](https://twitter.com/Ne_Eo_Twitch) and the [3D-HaxeFlixel](https://github.com/lunarcleint/3D-HaxeFlixel) repository for Away3D Flixel support - Credits to the [FlxAnimate](https://github.com/Dot-Stuff/flxanimate) team for the Animate Atlas support - Credits to Smokey555 for the backup Animate Atlas to spritesheet code - Credits to MAJigsaw77 for [hxvlc](https://github.com/MAJigsaw77/hxvlc) (video cutscene/mp4 support) and [hxdiscord_rpc](https://github.com/MAJigsaw77/hxdiscord_rpc) (discord rpc integration) diff --git a/assets/data/config/discord.json b/assets/data/config/discord.json index 582e510b..f6ad9636 100644 --- a/assets/data/config/discord.json +++ b/assets/data/config/discord.json @@ -1,4 +1,4 @@ { - "clientID": "1027994136193810442", + "clientID": "1383853614589673472", "logoKey": "icon" } \ No newline at end of file diff --git a/assets/data/global.hx b/assets/data/global.hx deleted file mode 100644 index 4c49ef69..00000000 --- a/assets/data/global.hx +++ /dev/null @@ -1,3 +0,0 @@ -// -function update(elapsed:Float) - if (FlxG.keys.justPressed.F5) FlxG.resetState(); \ No newline at end of file diff --git a/assets/data/scripts/pixel.hx b/assets/data/scripts/pixel.hx index b3d134c5..aaa7a6c8 100644 --- a/assets/data/scripts/pixel.hx +++ b/assets/data/scripts/pixel.hx @@ -18,9 +18,7 @@ public var daPixelZoom = PlayState.daPixelZoom; * UI */ function onNoteCreation(event) { - if (event.note.strumLine == playerStrums && !pixelNotesForBF) return; - if (event.note.strumLine == cpuStrums && !pixelNotesForDad) return; - + if ((event.note.strumLine == playerStrums && !pixelNotesForBF) || (event.note.strumLine == cpuStrums && !pixelNotesForDad)) return; event.cancel(); var note = event.note; @@ -34,18 +32,14 @@ function onNoteCreation(event) { } note.scale.set(daPixelZoom, daPixelZoom); note.updateHitbox(); + note.antialiasing = false; } -function onPostNoteCreation(event) { - var splashes = event.note; - if (pixelSplashes) - splashes.splash = "pixel-default"; -} +function onPostNoteCreation(event) if (pixelSplashes) + event.note.splash = "pixel-default"; function onStrumCreation(event) { - if (event.player == 1 && !pixelNotesForBF) return; - if (event.player == 0 && !pixelNotesForDad) return; - + if ((event.player == 1 && !pixelNotesForBF) || (event.player == 0 && !pixelNotesForDad)) return; event.cancel(); var strum = event.strum; @@ -56,6 +50,7 @@ function onStrumCreation(event) { strum.scale.set(daPixelZoom, daPixelZoom); strum.updateHitbox(); + strum.antialiasing = false; } function onCountdown(event) { @@ -86,9 +81,9 @@ function onPlayerHit(event:NoteHitEvent) { * CAMERA HACKS!! */ function postCreate() { - if (enablePauseMenu) { + if (enablePauseMenu) PauseSubState.script = 'data/scripts/week6-pause'; - } + if (enableCameraHacks) { camGame.pixelPerfectRender = true; camGame.antialiasing = false; @@ -104,8 +99,8 @@ function postCreate() { } } -function onStartCountdown() { - /*var newNoteCamera = new HudCamera(); +/*function onStartCountdown() { + var newNoteCamera = new HudCamera(); newNoteCamera.bgColor = 0; // transparent FlxG.cameras.add(newNoteCamera, false); @@ -119,8 +114,8 @@ function onStartCountdown() { i++; } } - makeCameraPixely(newNoteCamera);*/ -} + makeCameraPixely(newNoteCamera); +}*/ /** * Use this to make any camera pixelly (you wont be able to zoom with it anymore!) @@ -145,33 +140,29 @@ function destroy() { FlxG.game.stage.quality = oldStageQuality; } -function pixelCam(cam) { +function pixelCam(cam) makeCameraPixely(cam); -} var pixellyCameras = []; var pixellyShaders = []; -function postUpdate(elapsed) { - for(e in pixellyCameras) { - if (Std.isOfType(e, HudCamera)) - e.downscroll = camHUD.downscroll; - } - if (enableCameraHacks) { - for(p in strumLines) - p.notes.forEach(function(n) { - if(n.isSustainNote) return; // hacky fix for hold - n.y -= n.y % daPixelZoom; - n.x -= n.x % daPixelZoom; - }); +function postUpdate() { + for (e in pixellyCameras) if (Std.isOfType(e, HudCamera)) + e.downscroll = camHUD.downscroll; + + if (enableCameraHacks) for (p in strumLines) { + p.notes.forEach(function(n) { + if(n.isSustainNote) return; // hacky fix for hold + n.y -= n.y % daPixelZoom; + n.x -= n.x % daPixelZoom; + }); } var zoom = 1 / daPixelZoom / Math.min(FlxG.scaleMode.scale.x, FlxG.scaleMode.scale.y); - for(e in pixellyCameras) { + for (e in pixellyCameras) { if (!e.exists) continue; e.zoom = zoom; } - for(e in pixellyShaders) { + for (e in pixellyShaders) e.pixelZoom = zoom; - } -} \ No newline at end of file +} diff --git a/assets/data/scripts/week6-pause.hx b/assets/data/scripts/week6-pause.hx index 4eb71349..1538cff7 100644 --- a/assets/data/scripts/week6-pause.hx +++ b/assets/data/scripts/week6-pause.hx @@ -3,7 +3,7 @@ import flixel.text.FlxText; import flixel.text.FlxTextBorderStyle; import flixel.util.FlxAxes; -var pixelScript:Script; +var pixelScript:Script = game.scripts.getByName("pixel.hx"); var pauseCam = new FlxCamera(); var bg:FlxSprite; @@ -19,47 +19,40 @@ function create(event) { event.music = isThorns ? "pixel/LunchboxScary" : "pixel/breakfast"; - cameras = []; - - pixelScript = game.scripts.getByName("pixel.hx"); - pixelScript.call("pixelCam", [pauseCam]); + // allowing this pause script even if the pixel script is not loaded - Nex + pixelScript?.call("pixelCam", [pauseCam]); FlxG.cameras.add(pauseCam, false); + cameras = [pauseCam]; pauseCam.bgColor = isThorns ? 0x88000000 : 0x88FF99CC; pauseCam.alpha = 0; - bg = new FlxSprite(44 * 6, 14 * 6); - bg.loadGraphic(Paths.image('stages/school/pause/bg')); - if (isThorns) - bg.color = 0xFF000000; + bg = new FlxSprite(44 * 6, 14 * 6, Paths.image('stages/school/pause/bg')); + bg.antialiasing = false; + if (isThorns) bg.color = 0xFF000000; bg.scale.set(6, 6); bg.updateHitbox(); bg.scale.y = 4; - bg.cameras = [pauseCam]; add(bg); songText = new FlxText(0, 22 * 6, 0, "Pause", 8, false); confText(songText); add(songText); - var i = 2; - for(e in menuItems) { - text = new FlxText(0, (22 * 6) + (i * 9 * 6), 0, e, 8, false); + for (i=>e in menuItems) { + text = new FlxText(0, (22 * 6) + ((i+2) * 9 * 6), 0, e, 8, false); confText(text); - add(text); - texts.push(text); - i++; } hand = new FlxSprite().loadGraphic(Paths.image('stages/school/ui/hand_textbox')); + hand.antialiasing = false; hand.scale.set(6, 6); hand.updateHitbox(); add(hand); - FlxTween.tween(bg, {"scale.y": 6}, 0.75, {ease: FlxEase.elasticOut}); + FlxTween.tween(bg.scale, {y: 6}, 0.75, {ease: FlxEase.elasticOut}); - cameras = [pauseCam]; FlxG.sound.play(Paths.sound(isThorns ? 'pixel/ANGRY' : 'pixel/clickText')); } @@ -70,55 +63,50 @@ function confText(text) { text.screenCenter(FlxAxes.X); text.borderStyle = FlxTextBorderStyle.OUTLINE; if (!isThorns) text.borderColor = 0xFF953E3E; + + text.antialiasing = false; + texts.push(text); + add(text); } -function destroy() { - if(FlxG.cameras.list.contains(pauseCam)) - FlxG.cameras.remove(pauseCam); -} +function destroy() if (FlxG.cameras.list.contains(pauseCam)) + FlxG.cameras.remove(pauseCam); var canDoShit = true; var time:Float = 0; function update(elapsed) { - pixelScript.call("postUpdate", [elapsed]); + pixelScript?.call("postUpdate", [elapsed]); pauseCam.alpha = lerp(pauseCam.alpha, 1, 0.25); time += elapsed; - var curText = texts[curSelected]; + var curText = texts[curSelected + 1]; hand.setPosition(curText.x - hand.width - 18 + (Math.sin(time * Math.PI * 2) * 12), curText.y + (text.height - hand.height) - 6); hand.x -= hand.x % 6; hand.y -= hand.y % 6; - if (!canDoShit) return; - var oldSec = curSelected; - changeSelection((controls.UP_P ? -1 : 0) + (controls.DOWN_P ? 1 : 0) - FlxG.mouse.wheel); - if (oldSec != curSelected) - FlxG.sound.play(Paths.sound(isThorns ? 'pixel/type' : 'pixel/pixelText')); + if (controls.ACCEPT) enterOption(); +} - if (controls.ACCEPT) { - FlxG.sound.play(Paths.sound(isThorns ? 'pixel/ANGRY' : 'pixel/clickText')); - var option = menuItems[curSelected]; - if (option == "Resume" || option == "Exit to menu") { +var scrollSFX = FlxG.sound.load(Paths.sound(isThorns ? 'pixel/type' : 'pixel/pixelText')); +function changeSelection(change) if (canDoShit) { // this overrides the function inside of the normal pause btw, so no event gets called - Nex + curSelected = FlxMath.wrap(curSelected + change, 0, menuItems.length - 1); + if (change != 0) scrollSFX.play(); +} + +var enterSFX = FlxG.sound.load(Paths.sound(isThorns ? 'pixel/ANGRY' : 'pixel/clickText')); +function enterOption() if (canDoShit) { + var option = menuItems[curSelected]; + enterSFX.play(); + + switch(option) { + case "Resume", "Exit to menu": canDoShit = false; for(t in texts) t.visible = false; hand.visible = songText.visible = false; - FlxTween.tween(bg, {"scale.y": 0}, 0.125, {ease: FlxEase.cubeOut, onComplete: function() { - selectOption(); - }}); - } else { - selectOption(); - } + FlxTween.tween(bg.scale, {y: 0}, 0.125, {ease: FlxEase.cubeOut, onComplete: selectOption}); + default: selectOption(); } } - -function changeSelection(change) { // this overrides the function inside of the normal pause btw, so no event gets called - Nex - curSelected += change; - - if (curSelected < 0) - curSelected = menuItems.length - 1; - if (curSelected >= menuItems.length) - curSelected = 0; -} \ No newline at end of file diff --git a/assets/data/scripts/week7-balledLines.hx b/assets/data/scripts/week7-balledLines.hx index 677d3791..d6049a48 100644 --- a/assets/data/scripts/week7-balledLines.hx +++ b/assets/data/scripts/week7-balledLines.hx @@ -3,13 +3,7 @@ var sound:Sound; function create() sound = Paths.sound('jeffGameover/jeffGameover-' + FlxG.random.int(1, 25, !Options.naughtyness ? [1, 3, 8, 13, 17, 21] : null)); -function beatHit(cur:Int) { - if(cur != 0) return; - +function beatHit(cur:Int) if (cur == 0) { + FlxG.sound.play(sound, 1, false, null, true, () -> if (!isEnding) FlxG.sound.music.fadeIn(4, 0.2, 1)); FlxG.sound.music.volume = 0.2; - FlxG.sound.play(sound, 1, false, null, true, function() - { - if (!isEnding) - FlxG.sound.music.fadeIn(4, 0.2, 1); - }); } \ No newline at end of file diff --git a/assets/data/stages/tank.hx b/assets/data/stages/tank.hx index 03e213c6..e74b04d9 100644 --- a/assets/data/stages/tank.hx +++ b/assets/data/stages/tank.hx @@ -1,7 +1,7 @@ var tankAngle:Float = FlxG.random.int(-90, 45); var tankSpeed:Float = FlxG.random.float(5, 7); -function postCreate() if(PlayState.isStoryMode) +function postCreate() if (PlayState.isStoryMode) GameOverSubstate.script = 'data/scripts/week7-balledLines'; function update(elapsed:Float) { @@ -12,7 +12,7 @@ function update(elapsed:Float) { } function onPostCountdown(event) { - if(!playCutscenes || event.sprite == null) return; + if (!playCutscenes || event.sprite == null) return; var lastIndex:Int = members.indexOf(event.sprite); remove(event.sprite); insert(lastIndex + 4, event.sprite); diff --git a/commandline/commands/Compiler.hx b/commandline/commands/Compiler.hx index 5f573328..25ff5f06 100644 --- a/commandline/commands/Compiler.hx +++ b/commandline/commands/Compiler.hx @@ -15,10 +15,8 @@ class Compiler { } private static function __build(args:Array, arg:Array) { - arg.insert(0, "lime"); - arg.insert(0, "run"); - for(a in args) - arg.push(a); + for (a in args) arg.push(a); + arg = ['run', 'lime'].concat(arg); Sys.command("haxelib", arg); } diff --git a/project.xml b/project.xml index b5b639d9..68c34f54 100644 --- a/project.xml +++ b/project.xml @@ -5,7 +5,7 @@ title="Friday Night Funkin' - Codename Engine" main="funkin.backend.system.Main" file="CodenameEngine" packageName="com.yoshman29.codenameengine" package="com.yoshman29.codenameengine" - version="0.1.0" company="Yoshman29" /> + version="0.1.0-legacy" company="Yoshman29" />