Skip to content

Commit

Permalink
Merge remote-tracking branch 'dev/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
NexIsDumb committed Feb 27, 2024
2 parents 9b914c5 + 413ac9b commit fe786b3
Show file tree
Hide file tree
Showing 110 changed files with 1,940 additions and 23,008 deletions.
1 change: 1 addition & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name: Windows Build
on:
push:
workflow_dispatch:
jobs:
build:
name: Windows Build
Expand Down
55 changes: 35 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,22 @@
### Mods created with beta versions of Codename may not be compatible with the release version
Known issues in the beta:
- Some options are missing
- Week 6 still have no dialogue

Build instructions are below. Press TAB on the main menu to switch mods.

Also, `lime test windows` uses the source assets folder instead of the export one for easier development.
Also, the command `.\cne test` uses the source assets folder instead of the export one for easier development (Although you can still use `lime test windows` normally).

## Codename Engine

Codename Engine is a new Friday Night Funkin' Engine aimed at simplifying modding, along with extensiblity and ease of use.

### It includes many new features, as seen [here](FEATURES.md)

### Wanna see the new features added in the most recent update? Click [here](PATCHNOTES.md)
Codename Engine is a new Friday Night Funkin' Engine aimed at simplifying modding, along with extensiblity and ease of use.<br>
Make sure to read the wiki and join the Discord server linked there!<br>
#### It includes many new features, as seen [here](FEATURES.md)<br>
#### Wanna see the new features added in the most recent update? Click [here](PATCHNOTES.md)<br>

## How to download

Latest builds for the engine can be found in the [Actions](https://github.com/YoshiCrafter29/CodenameEngine/actions) tab.

<details>
<summary><h2>Credits</h2></summary>

- 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) for video cutscene/mp4 support.
- Credits to Aidan63 for [discord-rpc](https://github.com/Aidan63/linc_discord-rpc) for discord rpc integration.
</details>
Latest builds for the engine can be found in the [Actions](https://github.com/YoshiCrafter29/CodenameEngine/actions) tab.<br>
In the future (when the engine won't be a WIP anymore) we're gonna also publish the engine on platforms like Gamebanana; stay tuned!

<details>
<summary><h2>How to build</h2></summary>
Expand Down Expand Up @@ -80,8 +69,34 @@ Latest builds for the engine can be found in the [Actions](https://github.com/Yo
4. Open a terminal in the Codename Engine source folder, and run `update.sh`.
5. Once the libraries are installed, run `haxelib run lime test mac` to compile and launch the game (may take a long time)
- ℹ You can run `haxelib run lime setup` to make the lime command global, allowing you to execute `lime test mac` directly.
</details>
</details>


<details>
<summary><h2>What can you do or not do</h2></summary>

### You can:
- Download and play the engine with its mods and modpacks
- Mod and fork the engine (without using it for illicit purposes)
- Contribute to the engine (for example through *Pull Requests*, *Issues*, etc)
- Create a sub engine with Codename Engine as **TEMPLATE** with **CREDITS** (for example leaving the *credits menu submenu with the GitHub contributors* and putting the *[main devs](https://github.com/FNF-CNE-Devs)* in a *README* specifying that it's a *sub engine from Codename Engine*)
- Release excutable mods that use Codename Engine as source (Specifing that uses Codename Engine by for example the same way written above this)
- Release modpacks

### You can't:
- Create a *side/new/etc* engine (or mod that doesn't use Codename Engine) using Codename Engine's code
- Steal code from Codename Engine for another different project that is not Codename Engine related (Codename Engine mods excluded) without properly crediting
- Release the entire Codename Engine on platforms (Mods that use Codename Engine as source are fine, if it's specified even better)

#### *If you need more info or feel like asking to do something which is not listed here, ask us directly on our discord (linked in the wiki)!*
</details>

<details>
<summary><h2>Credits</h2></summary>

- 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) for video cutscene/mp4 support
- Credits to Aidan63 for [discord-rpc](https://github.com/Aidan63/linc_discord-rpc) for discord rpc integration
</details>
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
- [ ] New Switch Mod menu
- [x] Port shader camera stuff over to new flixel fork
- [ ] Add note offset
- [ ] Dialogue
- [x] Dialogue
- [ ] Finish Base Game port
- [x] Add credits
- [ ] Verbose mode (`--verbose`)
Expand Down
23 changes: 9 additions & 14 deletions assets/data/characters/tankman.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
<!DOCTYPE codename-engine-character>

<!-- tankman actually have player offsets !-->
<character isPlayer="true" flipX="true" x="0" y="180" camx="0">
<anim name="idle" anim="Tankman Idle Dance instance 100" fps="24" loop="false" x="0" y="0" />
<anim name="singRIGHT" anim="Tankman Right Note instance 1000" fps="24" loop="false" x="-1" y="-7" />
<anim name="singDOWN" anim="Tankman DOWN note instance 1000" fps="24" loop="false" x="98" y="-90" />
<anim name="singUP" anim="Tankman UP note instance 1000" fps="24" loop="false" x="24" y="56" />
<anim name="singLEFT" anim="Tankman Note Left instance 1000" fps="24" loop="false" x="100" y="-14" />

<!-- Heh! Pretty Good! -->
<anim name="singDOWN-alt" anim="PRETTY GOOD tankman instance 100" fps="24" loop="false" x="98" y="-90" />
<!-- Ugh! -->
<anim name="singUP-alt" anim="TANKMAN UGH instance 100" fps="30" loop="false" x="24" y="56" />
</character>
<character x="0" icon="tankman" y="180" isGF="false" flipX="true" isPlayer="true" sprite="tankman">
<anim x="0" loop="false" y="0" fps="24" anim="Tankman Idle Dance instance 100" name="idle"/>
<anim x="-1" loop="false" y="-7" fps="24" anim="Tankman Right Note instance 1000" name="singRIGHT"/>
<anim x="98" loop="false" y="-90" fps="24" anim="Tankman DOWN note instance 1000" name="singDOWN"/>
<anim x="24" loop="false" y="56" fps="24" anim="Tankman UP note instance 1000" name="singUP"/>
<anim x="100" loop="false" y="-14" fps="24" anim="Tankman Note Left instance 1000" name="singLEFT"/>
<anim x="98" loop="false" y="17" fps="24" anim="PRETTY GOOD tankman instance 100" name="good!"/>
<anim x="-16" loop="false" y="-9" fps="30" anim="TANKMAN UGH instance 100" name="singUP-alt"/>
</character>
10 changes: 5 additions & 5 deletions assets/data/dialogue/boxes/default.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<!DOCTYPE codename-engine-dialogue-box>
<dialoguebox scale="0.9" y="75">
<dialoguebox y="75">
<!--
Node containing all text settings
-->
-->
<text font="vcr.ttf" x="107" y="206" width="1053" color="#000000" size="40"/>

<!--
All positions for characters
-->
<charpos name="left" x="-500" y="184" />
<charpos name="left" x="-500" y="184" flipBubble="true" />
<charpos name="middle" x="0" y="184" />
<charpos name="right" x="500" y="184" flipBubble="true" />
<charpos name="right" x="500" y="184" />

<!--
All animations for the dialogue box
For example, if you wanna add an "angry" animation, add an animation named "angry" (box idle), and "angry-open" (not needed, for box apparition)
-->
-->
<anim name="normal" anim="speech bubble normal" fps="24" loop="true" x="-30"/>
<anim name="normal-open" anim="Speech Bubble Normal Open" fps="24" />

Expand Down
61 changes: 61 additions & 0 deletions assets/data/dialogue/boxes/hating-simulator.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
var loopedTimah:FlxTimer; // Hey! a man has fallen into the river in lego city! and if youre asking why this is here, you shall disappear! - Nex
var bgFade:FlxSprite;
var hand:FlxSprite;

function postCreate() {
bgFade = new FlxSprite().makeSolid(FlxG.width + 100, FlxG.height + 100, 0xFFB3DFd8);
bgFade.screenCenter();
bgFade.scrollFactor.set();
bgFade.alpha = 0;
cutscene.insert(0, bgFade);

loopedTimah = new FlxTimer().start(0.83, function(tmr:FlxTimer)
{
bgFade.alpha += (1 / 5) * 0.7;
if (bgFade.alpha > 0.7)
bgFade.alpha = 0.7;
}, 5);

hand = new FlxSprite(0, 600).loadGraphic(Paths.image('stages/school/ui/hand_textbox'));
hand.scale.set(4, 4);
hand.updateHitbox();
}

var finished:Bool = false;
function close(event) {
if(finished) return;
else event.cancelled = true;
cutscene.canProceed = false;

cutscene.curMusic?.fadeOut(1, 0);
for(c in cutscene.charMap) c.visible = false;

loopedTimah.cancel();
loopedTimah = new FlxTimer().start(0.2, function(tmr:FlxTimer)
{
if (tmr.elapsedLoops <= 5) {
cutscene.dialogueBox.alpha -= 1 / 5;
cutscene.dialogueBox.text.alpha -= 1 / 5;
bgFade.alpha -= (1 / 5) * 0.7;
hand.alpha -= 1 / 5;
} else {
finished = true;
cutscene.close();
}
}, 6);
}

var time:Float = 0;
function update(elapsed:Float) {
if(hand.visible = dialogueEnded) {
hand.x = 1060 + Math.sin((time += elapsed) * Math.PI * 2) * 12;
hand.x -= hand.x % hand.scale.x;
hand.y -= hand.y % hand.scale.y;
}
}

function postPlayBubbleAnim() {
cutscene.remove(hand);
if(active && visible)
cutscene.add(hand);
}
21 changes: 21 additions & 0 deletions assets/data/dialogue/boxes/hating-simulator.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE codename-engine-dialogue-box>
<dialoguebox sprite="pixel/dialogueBox" antialiasing="false" graphicSizex="1227" x="-67" y="-325" textSound="pixel/pixelText" nextSound="pixel/clickText" updateHitbox="true">
<!--
Node containing all text settings
-->
<text font="pixel.otf" x="239" y="218" width="768" color="#3f2021" size="32" antialiasing="false" borderSize="1" borderStyle="shadow" borderColor="#D89494" shadowOffsetX="2" shadowOffsetY="2"/>

<!--
All positions for characters
-->
<charpos name="left" x="-500" y="184" />
<charpos name="middle" x="0" y="184" />
<charpos name="right" x="490" y="184" />

<!--
All animations for the dialogue box
For example, if you wanna add an "angry" animation, add an animation named "angry" (box idle), and "angry-open" (not needed, for box apparition)
-->
<anim name="normal-firstOpen" anim="Text Box Appear instance 10" fps="24" />
<anim name="angry-firstOpen" anim="Text Box Bump Appear instance 10" x="-16" y="-59" fps="24" />
</dialoguebox>
43 changes: 43 additions & 0 deletions assets/data/dialogue/boxes/spirit-creepy-box.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import flixel.tweens.FlxTweenType;

var aberration:CustomShader = null;
var spirit:FlxSprite;
function postCreate() {
spirit = new FlxSprite(320, 170).loadGraphic(Paths.image('game/cutscenes/weeb/spiritFaceForward'));
spirit.setGraphicSize(Std.int(spirit.width * 6));
if(Options.gameplayShaders) {
spirit.shader = aberration = new CustomShader('chromaticAberration');
FlxTween.num(-0.003, 0.003, 3, {ease: FlxEase.sineInOut, type: FlxTweenType.PINGPONG}, function(num) { if(aberration == null) return; aberration.redOff = [0, -num]; aberration.blueOff = [0, num]; });
}
cutscene.add(spirit);

FlxG.camera._fxFadeAlpha = 0;
cutscene.dialogueCamera.bgColor = FlxColor.fromRGBFloat(1, 1, 1, 0.3);
}

var finished:Bool = false;
function close(event) {
if(finished) return;
else event.cancelled = true;
cutscene.canProceed = false;

cutscene.curMusic?.fadeOut(1, 0);
for(c in cutscene.charMap) c.visible = false;

spirit.destroy();
spirit.shader = aberration = null;
new FlxTimer().start(0.4, function(swagTimer:FlxTimer) {
cutscene.dialogueCamera.alpha -= 0.15;

if(cutscene.dialogueCamera.alpha > 0) swagTimer.reset();
else {
finished = true;
cutscene.close();
}
});
}

function popupChar(event) {
if(!active || event.char.positionName != "left") return;
event.char.color = FlxColor.BLACK;
}
20 changes: 20 additions & 0 deletions assets/data/dialogue/boxes/spirit-creepy-box.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE codename-engine-dialogue-box>
<dialoguebox sprite="pixel/dialogueBox-evil" antialiasing="false" graphicSizex="1344" y="107" textSound="pixel/pixelText" nextSound="pixel/clickText" updateHitbox="true">
<!--
Node containing all text settings
-->
<text font="pixel.otf" x="265" y="220" width="768" color="#FFFFFF" size="32" antialiasing="false" borderSize="2" borderStyle="shadow" borderColor="#000000" />

<!--
All positions for characters
-->
<charpos name="left" x="-510" y="183" />
<charpos name="middle" x="0" y="183" />
<charpos name="right" x="510" y="183" />

<!--
All animations for the dialogue box
For example, if you wanna add an "angry" animation, add an animation named "angry" (box idle), and "angry-open" (not needed, for box apparition)
-->
<anim name="normal-firstOpen" anim="Spirit Textbox spawn instance 10" fps="24" />
</dialoguebox>
3 changes: 3 additions & 0 deletions assets/data/dialogue/characters/pixelBf.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
function postHide() {
if(curTween != null) curTween.percent = 1;
}
4 changes: 4 additions & 0 deletions assets/data/dialogue/characters/pixelBf.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<!DOCTYPE codename-engine-dialogue-character>
<character sprite="pixel/boyfriend" x="570" y="-599" graphicSizex="1334" antialiasing="false" textSound="pixel/pixelText">
<anim name="normal-show" anim="Boyfriend portrait enter instance 10" fps="24" />
</character>
6 changes: 6 additions & 0 deletions assets/data/dialogue/characters/senpai.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
function postHide() {
if(curTween != null) {
if(animation.curAnim?.name == 'angry-show') curTween.cancel();
else curTween.percent = 1;
}
}
5 changes: 5 additions & 0 deletions assets/data/dialogue/characters/senpai.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!DOCTYPE codename-engine-dialogue-character>
<character sprite="pixel/senpai" x="-392" y="-599" graphicSizex="1334" antialiasing="false" textSound="pixel/pixelText">
<anim name="normal-show" anim="Senpai Portrait Enter instance 10" fps="24" x="4.4" />
<anim name="angry-show" anim="Senpai Portrait Angry instance 10" x="-56" y="-9" fps="24" />
</character>
1 change: 0 additions & 1 deletion assets/data/notes/Alt Anim Note.hx
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
//
function onNoteHit(event) if (event.noteType == "Alt Anim Note") event.animSuffix = "-alt";
1 change: 1 addition & 0 deletions assets/data/notes/No Anim Note.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
function onNoteHit(event) if (event.noteType == "No Anim Note") event.animCancelled = true;
2 changes: 1 addition & 1 deletion assets/data/stages/limo.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE codename-engine-stage>
<stage zoom="0.9" name="limo" folder="stages/limo/">
<stage zoom="0.9" name="limo" folder="stages/limo/" startCamPosY="400">
<!-- BG LIMOS !-->
<sprite name="skyBG" x="-120" y="-50" sprite="limoSunset" scroll="0.1" zoomfactor="0"/>
<sprite name="bgLimo" x="-200" y="480" sprite="bgLimo" scroll="0.4" zoomfactor="0.55" />
Expand Down
2 changes: 1 addition & 1 deletion assets/data/stages/mall-evil.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE codename-engine-stage>
<stage zoom="1.05" name="mall-evil" folder="stages/mall/">
<stage zoom="1.05" name="mall-evil" folder="stages/mall/" startCamPosY="400" startCamPosX="1300">
<sprite name="bg" x="-400" y="-500" sprite="evilBG" scroll="0.2"/>
<sprite name="evilTree" x="300" y="-300" sprite="evilTree" scroll="0.2"/>
<sprite name="evilSnow" x="-200" y="700" sprite="evilSnow" />
Expand Down
2 changes: 1 addition & 1 deletion assets/data/stages/mall.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE codename-engine-stage>
<stage zoom="0.8" name="mall" folder="stages/mall/">
<stage zoom="0.8" name="mall" folder="stages/mall/" startCamPosY="450" startCamPosX="500">
<sprite name="bg" x="-1000" y="-500" sprite="bgWalls" scroll="0.2"/>

<high-memory>
Expand Down
2 changes: 1 addition & 1 deletion assets/data/stages/philly.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE codename-engine-stage>
<stage zoom="1.05" name="philly" folder="stages/philly/">
<stage zoom="1.05" name="philly" folder="stages/philly/" startCamPosY="510" startCamPosX="950">
<sprite name="bg" x="-100" y="0" sprite="sky" scroll="0.1" zoomfactor="0"/>
<sprite name="city" x="-10" y="0" sprite="city" scroll="0.3" scale="0.85" updateHitbox="true" zoomfactor="0.3"/>
<sprite name="light" x="-10" y="0" sprite="win" scroll="0.3" scale="0.85" updateHitbox="true" zoomfactor="0.3"/>
Expand Down
2 changes: 1 addition & 1 deletion assets/data/stages/school-evil.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE codename-engine-stage>
<stage zoom="1" name="school-evil" folder="stages/school/" >
<stage zoom="1" name="school-evil" folder="stages/school/" startCamPosY="550" startCamPosX="600">
<sprite name="bg" x="400" y="200" sprite="animatedEvilSchool"
antialiasing="false" scale="6" scrollx="0.8" scrolly="0.9" type="loop"/>
</stage>
13 changes: 4 additions & 9 deletions assets/data/stages/school.hx
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
function create() {
importScript("data/scripts/pixel");
if (PlayState.SONG.meta.name.toLowerCase() == "roses") {
flabbergastGirls();
bgGirls.animation.remove("danceLeft");
bgGirls.animation.remove("danceRight");
bgGirls.animation.addByIndices('danceLeft', 'BG fangirls dissuaded', CoolUtil.numberArray(14), "", 24, false);
bgGirls.animation.addByIndices('danceRight', 'BG fangirls dissuaded', CoolUtil.numberArray(30, 15), "", 24, false);
}
bgGirls.animation.play("danceLeft", true); // horrible fix, please fix later
}

public function flabbergastGirls() {
bgGirls.animation.remove("danceLeft");
bgGirls.animation.remove("danceRight");
bgGirls.animation.addByIndices('danceLeft', 'BG fangirls dissuaded', CoolUtil.numberArray(14), "", 24, false);
bgGirls.animation.addByIndices('danceRight', 'BG fangirls dissuaded', CoolUtil.numberArray(30, 15), "", 24, false);
bgGirls.animation.play("danceLeft", true);
}
Loading

0 comments on commit fe786b3

Please sign in to comment.