Skip to content
This repository has been archived by the owner on Oct 5, 2021. It is now read-only.

Commit

Permalink
Final commit for v0.2-e
Browse files Browse the repository at this point in the history
  • Loading branch information
MagnusStrom committed Jun 18, 2021
1 parent 586ea21 commit 73299c4
Show file tree
Hide file tree
Showing 13 changed files with 124 additions and 44 deletions.
2 changes: 1 addition & 1 deletion Project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<project>
<!-- _________________________ Application Settings _________________________ -->

<app title="Friday Night Funkin' ProjectFNF" file="ProjectFNF" packageName="com.ninjamuffin99.funkin" package="com.ninjamuffin99.funkin" main="Main" version="0.2-d" company="aflac" />
<app title="Friday Night Funkin' ProjectFNF" file="ProjectFNF" packageName="com.aflac.projectfnf" package="com.aflac.projectfnf" main="Main" version="0.2-e" company="aflac" />
<!-- DO NOT TOUCH THE VERSION -->
<!--Switch Export with Unique ApplicationID and Icon-->
<set name="APP_ID" value="0x0100f6c013bbc000" />
Expand Down
Binary file added art/screenshots/dadnotes1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added art/screenshots/mother.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added art/screenshots/options.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added art/screenshots/pixel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added art/screenshots/storymenu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions assets/preload/data/options.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
setGhost Tapping|| Hitting a key (if not giving you a hit) will give you a miss || True
setDownscroll || The notes scroll down || False
setMiss Shake || Screen shakes on miss || False
setGhost Tapping || Hitting a key will not give you a miss || false
setDownscroll || The notes scroll down || false
setMiss Shake || Screen shakes on miss(FOR MOD DEVS: CONFIGURE THIS SHAKE INTENSITY IN SETTINGS!!!) || false
setDad Notes Visible || Dad(Enemies) notes are visible || true
20 changes: 0 additions & 20 deletions source/Config.hx
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@ class Config extends MusicBeatState
*/
public static var CONFIGGfCar:Bool = true;

/**
* Downscroll. Thanks kade :uwu:
*
* Default = **false**
*/
public static var DOWNSCROLL:Bool = true;

/**
* Use the ProjectFNF logo or the Friday Night Funkin logo??
*
Expand Down Expand Up @@ -58,13 +51,6 @@ class Config extends MusicBeatState
*/
public static var DEBUGMODE:Bool = false;

/**
* Shakes the camera when you miss a note. Shakes on the Axis you missed the note of. (Up/Down will shake the camera Up and Down)
*
* Default = **true**
*/
public static var MISSFX:Bool = true;

/**
* Only Works if **MISSFX** is set to **true**
*
Expand All @@ -75,10 +61,4 @@ class Config extends MusicBeatState
* Default = **0.002**
*/
public static var MISSINTENSITY = 0.002;

/**
* Use funny inputs like in Kade Engine
* (Spam is allow)
**/
public static var INPUT:Bool = true;
}
2 changes: 1 addition & 1 deletion source/MainMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class MainMenuState extends MusicBeatState
var menuItems:FlxTypedGroup<FlxSprite>;

#if !switch
var optionShit:Array<String> = ['story mode', 'freeplay', 'donate', 'options'];
var optionShit:Array<String> = ['story mode', 'freeplay', 'options'];
#else
var optionShit:Array<String> = ['story mode', 'freeplay'];
#end
Expand Down
3 changes: 2 additions & 1 deletion source/Note.hx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package;

import flixel.FlxG;
import flixel.addons.effects.FlxSkewedSprite;
import flixel.FlxSprite;
import flixel.graphics.frames.FlxAtlasFrames;
Expand Down Expand Up @@ -119,7 +120,7 @@ class Note extends FlxSkewedSprite
}

// trace(prevNote);
if (Config.DOWNSCROLL && sustainNote) {
if (FlxG.save.data.downscroll && sustainNote) {
flipY = true;
}

Expand Down
63 changes: 55 additions & 8 deletions source/OptionsMenu.hx
Original file line number Diff line number Diff line change
Expand Up @@ -28,31 +28,47 @@ class OptionsMenu extends MusicBeatState
{
var menuBG:FlxSprite = new FlxSprite().loadGraphic(Paths.image('menuDesat'));
controlsStrings = CoolUtil.coolTextFile(Paths.txt('options'));
menuBG.color = 0xFFea71fd;
menuBG.color = FlxColor.GRAY;
menuBG.setGraphicSize(Std.int(menuBG.width * 1.1));
menuBG.updateHitbox();
menuBG.screenCenter();
menuBG.antialiasing = true;
add(menuBG);
optionsText = new FlxText(FlxG.width * 0.7, 5, 0, "", 32);
optionsText.setFormat(Paths.font("vcr.ttf"), 32, FlxColor.WHITE, RIGHT);
optionsDesc = new FlxText(FlxG.width * 0.7, 5, 0, "", 32);
optionsDesc = new FlxText(830, 80, 450, "", 32);
optionsDesc.setFormat(Paths.font("vcr.ttf"), 32, FlxColor.WHITE, RIGHT);
var optionsBG:FlxSprite = new FlxSprite(optionsText.x - 6, 0).makeGraphic(Std.int(FlxG.width * 0.55), 80, 0xFF000000);
optionsBG.alpha = 0.6;
add(optionsBG);
add(optionsText);
add(optionsDesc);
optionsDesc.screenCenter(XY);


grpControls = new FlxTypedGroup<Alphabet>();
add(grpControls);
for (i in 0...controlsStrings.length)
{
switch(controlsStrings[i].substring(3).split(" || ")[0]) {
case "Ghost Tapping":
if (!FlxG.save.data.ghosttapping)
FlxG.save.data.ghosttapping = controlsStrings[curSelected].split(" || ")[2];
case "Downscroll":
if (!FlxG.save.data.downscroll)
FlxG.save.data.downscroll = controlsStrings[curSelected].split(" || ")[2];
case "Miss Shake":
if (!FlxG.save.data.missshake)
FlxG.save.data.missshake = controlsStrings[curSelected].split(" || ")[2];
case "Dad Notes Visible":
if (!FlxG.save.data.dadnotesvisible)
FlxG.save.data.dadnotesvisible = controlsStrings[curSelected].split(" || ")[2];
}
FlxG.save.flush();


if (controlsStrings[i].indexOf('set') != -1)
{
var controlLabel:Alphabet = new Alphabet(0, (70 * i) + 30, controlsStrings[i].substring(3).split("||")[0], true, false);
var controlLabel:Alphabet = new Alphabet(0, (70 * i) + 30, controlsStrings[i].substring(3).split(" || ")[0], true, false);
controlLabel.isMenuItem = true;
controlLabel.targetY = i;
grpControls.add(controlLabel);
Expand All @@ -73,7 +89,29 @@ class OptionsMenu extends MusicBeatState

if (controls.ACCEPT)
{
trace('thing');
// hey, atleast its not yanderedev
//trace(controlsStrings[curSelected].substring(3).split(" || ")[0]);
switch(controlsStrings[curSelected].substring(3).split(" || ")[0]) {
case "Downscroll":
//trace("Before: " + FlxG.save.data.downscroll);
FlxG.save.data.downscroll = !FlxG.save.data.downscroll;
optionsText.text = FlxG.save.data.downscroll;
//trace("After: " + FlxG.save.data.downscroll);
case "Ghost Tapping":
//trace("Before: " + FlxG.save.data.ghosttapping);
FlxG.save.data.ghosttapping = !FlxG.save.data.ghosttapping;
optionsText.text = FlxG.save.data.ghosttapping;
//trace("After: " + FlxG.save.data.ghosttapping);
case "Miss Shake":
FlxG.save.data.missshake = !FlxG.save.data.missshake;
optionsText.text = FlxG.save.data.missshake;//FlxG.save.data.dadnotesvisible
case "Dad Notes Visible":
FlxG.save.data.dadnotesvisible = !FlxG.save.data.dadnotesvisible;
optionsText.text = FlxG.save.data.dadnotesvisible;
}
FlxG.save.flush();
// this could be us but FlxG savedata sucks dick and im too lazy too see how kade engine did it
// FlxG.save.data[controlsStrings[curSelected].split(" || ")[1]] = !FlxG.save.data.options[controlsStrings[curSelected].split(" || ")[1]];
}
if (controls.BACK)
FlxG.switchState(new MainMenuState());
Expand Down Expand Up @@ -119,9 +157,18 @@ class OptionsMenu extends MusicBeatState
curSelected = 0;


// how did it take me this long to figure this out bruh
optionsText.text = controlsStrings[curSelected].split("||")[2];
optionsDesc.text = controlsStrings[curSelected].split("||")[1];
switch(controlsStrings[curSelected].substring(3).split(" || ")[0]) {
case "Ghost Tapping":
optionsText.text = FlxG.save.data.ghosttapping;
case "Downscroll":
optionsText.text = FlxG.save.data.downscroll;
case "Miss Shake":
optionsText.text = FlxG.save.data.missshake;
case "Dad Notes Visible":
optionsText.text = FlxG.save.data.dadnotesvisible;
}
// how did it take me this long to figure this out bruh (still applies here)
optionsDesc.text = controlsStrings[curSelected].split(" || ")[1];

// selector.y = (70 * curSelected) + 30;
var bullShit:Int = 0;
Expand Down
30 changes: 20 additions & 10 deletions source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class PlayState extends MusicBeatState
var stageFront:FlxSprite;
var bg:FlxSprite;
// ModCharts.autoStrum = true;
ModCharts.dadNotesVisible = true;
ModCharts.dadNotesVisible = FlxG.save.data.dadnotesvisible; // gamer
ModCharts.bfNotesVisible = true;
if (FlxG.sound.music != null)
FlxG.sound.music.stop();
Expand Down Expand Up @@ -804,7 +804,7 @@ class PlayState extends MusicBeatState
strumLine = new FlxSprite(0, 50).makeGraphic(FlxG.width, 10);
strumLine.scrollFactor.set();

if (Config.DOWNSCROLL) {
if (FlxG.save.data.downscroll) {
strumLine.y = FlxG.height - 165;
}

Expand Down Expand Up @@ -842,7 +842,7 @@ class PlayState extends MusicBeatState
FlxG.fixedTimestep = false;

healthBarBG = new FlxSprite(0, FlxG.height * 0.88).loadGraphic(Paths.image('healthBar'));
if (Config.DOWNSCROLL) {
if (FlxG.save.data.downscroll) {
healthBarBG.y = 50;
}
healthBarBG.screenCenter(X);
Expand Down Expand Up @@ -1997,7 +1997,7 @@ class PlayState extends MusicBeatState
}
}

if (Config.DOWNSCROLL)
if (FlxG.save.data.downscroll)
{
if (daNote.mustPress)
daNote.y = (playerStrums.members[Math.floor(Math.abs(daNote.noteData))].y + 0.45 * (Conductor.songPosition - daNote.strumTime) * FlxMath.roundDecimal(SONG.speed, 2));
Expand Down Expand Up @@ -2121,7 +2121,7 @@ class PlayState extends MusicBeatState

// WIP interpolation shit? Need to fix the pause issue
// daNote.y = (strumLine.y - (songTime - daNote.strumTime) * (0.45 * PlayState.SONG.speed));
if ((daNote.mustPress && daNote.tooLate && !Config.DOWNSCROLL || daNote.mustPress && daNote.tooLate && Config.DOWNSCROLL) && daNote.mustPress)
if ((daNote.mustPress && daNote.tooLate && !FlxG.save.data.downscroll || daNote.mustPress && daNote.tooLate && FlxG.save.data.downscroll) && daNote.mustPress)
{
if (daNote.isSustainNote && daNote.wasGoodHit)
{
Expand Down Expand Up @@ -2271,7 +2271,9 @@ class PlayState extends MusicBeatState

var daRating:String = "sick";

if (noteDiff > Conductor.safeZoneOffset * 0.9)
daRating = Ratings.CalculateRating(noteDiff);
score = 100; // till i stop being a lazy cunt
/*if (noteDiff > Conductor.safeZoneOffset * 0.9)
{
daRating = 'shit';
score = 50;
Expand All @@ -2285,7 +2287,7 @@ class PlayState extends MusicBeatState
{
daRating = 'good';
score = 200;
}
}*/

songScore += score;

Expand Down Expand Up @@ -2614,7 +2616,7 @@ class PlayState extends MusicBeatState

function noteMiss(direction:Int = 1):Void
{
if (Config.INPUT == false) {
if (!FlxG.save.data.ghosttapping) {
if (!boyfriend.stunned)
{
health -= 0.04;
Expand Down Expand Up @@ -2644,12 +2646,20 @@ class PlayState extends MusicBeatState
{
case 0:
boyfriend.playAnim('singLEFTmiss', true);
if (FlxG.save.data.missshake)
FlxG.camera.shake(Config.MISSINTENSITY, 0.1, null, true, X);
case 1:
boyfriend.playAnim('singDOWNmiss', true);
if (FlxG.save.data.missshake)
FlxG.camera.shake(Config.MISSINTENSITY, 0.1, null, true, X);
case 2:
boyfriend.playAnim('singUPmiss', true);
if (FlxG.save.data.missshake)
FlxG.camera.shake(Config.MISSINTENSITY, 0.1, null, true, X);
case 3:
boyfriend.playAnim('singRIGHTmiss', true);
if (FlxG.save.data.missshake)
FlxG.camera.shake(Config.MISSINTENSITY, 0.1, null, true, X);
}
}
}
Expand All @@ -2658,7 +2668,7 @@ class PlayState extends MusicBeatState

/* function noteMiss(direction:Int = 1):Void
{
if (Config.INPUT == false)
if (FlxG.save.data.ghosttapping == false)
{
songNotesMissed += 1;
Expand Down Expand Up @@ -2903,7 +2913,7 @@ class PlayState extends MusicBeatState

if (generatedMusic)
{
notes.sort(FlxSort.byY, (Config.DOWNSCROLL ? FlxSort.ASCENDING : FlxSort.DESCENDING));
notes.sort(FlxSort.byY, (FlxG.save.data.downscroll ? FlxSort.ASCENDING : FlxSort.DESCENDING));
}

if (SONG.notes[Math.floor(curStep / 16)] != null)
Expand Down
41 changes: 41 additions & 0 deletions source/Ratings.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import flixel.FlxG;

class Ratings
{
public static function CalculateRating(noteDiff:Float, ?customSafeZone:Float):String // Generate a judgement through some timing shit
{

var customTimeScale = 1;

// if (customSafeZone != null)
// customTimeScale = customSafeZone / 166;

// trace(customTimeScale + ' vs ' + Conductor.timeScale);

// I HATE THIS IF CONDITION
// IF LEMON SEES THIS I'M SORRY :(

// trace('Hit Info\nDifference: ' + noteDiff + '\nZone: ' + Conductor.safeZoneOffset * 1.5 + "\nTS: " + customTimeScale + "\nLate: " + 155 * customTimeScale);

if (FlxG.save.data.botplay)
return "good"; // FUNNY

if (noteDiff > 166 * customTimeScale) // so god damn early its a miss
return "miss";
if (noteDiff > 135 * customTimeScale) // way early
return "shit";
else if (noteDiff > 90 * customTimeScale) // early
return "bad";
else if (noteDiff > 45 * customTimeScale) // your kinda there
return "good";
else if (noteDiff < -45 * customTimeScale) // little late
return "good";
else if (noteDiff < -90 * customTimeScale) // late
return "bad";
else if (noteDiff < -135 * customTimeScale) // late as fuck
return "shit";
else if (noteDiff < -166 * customTimeScale) // so god damn late its a miss
return "miss";
return "sick";
}
}

0 comments on commit 73299c4

Please sign in to comment.