mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2024-12-27 07:27:12 +00:00
scores and dope shit
This commit is contained in:
parent
32001dad2e
commit
75a02413de
|
@ -27,7 +27,9 @@
|
|||
|
||||
<!-- _____________________________ Path Settings ____________________________ -->
|
||||
|
||||
<set name="BUILD_DIR" value="export" />
|
||||
<set name="BUILD_DIR" value="export/debug" if="debug" />
|
||||
<set name="BUILD_DIR" value="export/release" unless="debug" />
|
||||
|
||||
<classpath name="source" />
|
||||
<assets path="assets" />
|
||||
|
||||
|
@ -36,7 +38,7 @@
|
|||
<haxelib name="flixel" />
|
||||
|
||||
<!--In case you want to use the addons package-->
|
||||
<!--<haxelib name="flixel-addons" />-->
|
||||
<haxelib name="flixel-addons" />
|
||||
|
||||
<!--In case you want to use the ui package-->
|
||||
<!--<haxelib name="flixel-ui" />-->
|
||||
|
|
11
art/build-Itch-HTML.bat
Normal file
11
art/build-Itch-HTML.bat
Normal file
|
@ -0,0 +1,11 @@
|
|||
@echo off
|
||||
color 0a
|
||||
cd ..
|
||||
@echo on
|
||||
echo BUILDING GAME
|
||||
lime build html5 -debug
|
||||
echo UPLOADING TO ITCH
|
||||
butler push ./export/debug/html5/bin ninja-muffin24/ld47:html5
|
||||
butler status ninja-muffin24/ld47:html5
|
||||
echo ITCH SHIT UPDATED LMAOOOOO
|
||||
pause
|
|
@ -14,6 +14,8 @@ class Note extends FlxSprite
|
|||
public var wasGoodHit:Bool = false;
|
||||
public var prevNote:Note;
|
||||
|
||||
public var noteScore:Float = 1;
|
||||
|
||||
public function new(strumTime:Float, noteData:Int)
|
||||
{
|
||||
super();
|
||||
|
@ -43,7 +45,10 @@ class Note extends FlxSprite
|
|||
}
|
||||
|
||||
if (noteData < 0)
|
||||
{
|
||||
noteScore * 0.2;
|
||||
alpha = 0.6;
|
||||
}
|
||||
}
|
||||
|
||||
override function update(elapsed:Float)
|
||||
|
|
|
@ -6,6 +6,8 @@ import flixel.FlxState;
|
|||
import flixel.group.FlxGroup.FlxTypedGroup;
|
||||
import flixel.system.FlxSound;
|
||||
import flixel.text.FlxText;
|
||||
import flixel.tweens.FlxTween;
|
||||
import flixel.util.FlxTimer;
|
||||
import haxe.Json;
|
||||
import lime.utils.Assets;
|
||||
|
||||
|
@ -26,6 +28,9 @@ class PlayState extends FlxState
|
|||
private var notes:FlxTypedGroup<Note>;
|
||||
|
||||
private var strumLine:FlxSprite;
|
||||
private var curSection:Int = 0;
|
||||
|
||||
private var sectionScores:Array<Dynamic> = [[], []];
|
||||
|
||||
override public function create()
|
||||
{
|
||||
|
@ -42,6 +47,8 @@ class PlayState extends FlxState
|
|||
strumLine = new FlxSprite(0, 50).makeGraphic(FlxG.width, 10);
|
||||
add(strumLine);
|
||||
|
||||
FlxG.worldBounds.set(0, 0, FlxG.width, FlxG.height);
|
||||
|
||||
super.create();
|
||||
}
|
||||
|
||||
|
@ -70,6 +77,9 @@ class PlayState extends FlxState
|
|||
|
||||
for (songNotes in dumbassSection)
|
||||
{
|
||||
sectionScores[0].push(0);
|
||||
sectionScores[1].push(0);
|
||||
|
||||
if (songNotes != 0)
|
||||
{
|
||||
var daStrumTime:Float = (((daStep * Conductor.stepCrochet) + (Conductor.crochet * 8 * daBeats))
|
||||
|
@ -83,14 +93,16 @@ class PlayState extends FlxState
|
|||
{
|
||||
swagNote.mustPress = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
sectionScores[0][daBeats] += swagNote.noteScore;
|
||||
}
|
||||
|
||||
if (notes.members.length > 0)
|
||||
swagNote.prevNote = notes.members[notes.members.length - 1];
|
||||
else
|
||||
swagNote.prevNote = swagNote;
|
||||
|
||||
trace(notes.members.length - 1);
|
||||
|
||||
notes.add(swagNote);
|
||||
}
|
||||
|
||||
|
@ -106,6 +118,8 @@ class PlayState extends FlxState
|
|||
|
||||
var bouncingSprite:FlxSprite;
|
||||
|
||||
var sectionScored:Bool = false;
|
||||
|
||||
override public function update(elapsed:Float)
|
||||
{
|
||||
super.update(elapsed);
|
||||
|
@ -113,8 +127,17 @@ class PlayState extends FlxState
|
|||
Conductor.songPosition = FlxG.sound.music.time;
|
||||
var playerTurn:Int = totalBeats % 8;
|
||||
|
||||
if (playerTurn == 7 && !sectionScored)
|
||||
{
|
||||
popUpScore();
|
||||
sectionScored = true;
|
||||
}
|
||||
|
||||
if (playerTurn < 4)
|
||||
{
|
||||
bouncingSprite = dad;
|
||||
sectionScored = false;
|
||||
}
|
||||
else
|
||||
bouncingSprite = boyfriend;
|
||||
|
||||
|
@ -139,6 +162,25 @@ class PlayState extends FlxState
|
|||
keyShit();
|
||||
}
|
||||
|
||||
private function popUpScore():Void
|
||||
{
|
||||
var placement:String = sectionScores[1][curSection] + '/' + sectionScores[0][curSection];
|
||||
var coolText:FlxText = new FlxText(0, 0, 0, placement, 32);
|
||||
coolText.screenCenter();
|
||||
coolText.x = FlxG.width * 0.75;
|
||||
add(coolText);
|
||||
|
||||
FlxTween.tween(coolText, {alpha: 0}, 0.2, {
|
||||
onComplete: function(tween:FlxTween)
|
||||
{
|
||||
coolText.kill();
|
||||
},
|
||||
startDelay: Conductor.crochet * 0.001
|
||||
});
|
||||
|
||||
curSection += 1;
|
||||
}
|
||||
|
||||
function keyShit():Void
|
||||
{
|
||||
// HOLDING
|
||||
|
@ -162,19 +204,15 @@ class PlayState extends FlxState
|
|||
{
|
||||
// NOTES YOU ARE HOLDING
|
||||
case -1:
|
||||
trace(daNote.prevNote.wasGoodHit);
|
||||
if (up && daNote.prevNote.wasGoodHit)
|
||||
goodNoteHit(daNote);
|
||||
case -2:
|
||||
trace(daNote.prevNote.wasGoodHit);
|
||||
if (right && daNote.prevNote.wasGoodHit)
|
||||
goodNoteHit(daNote);
|
||||
case -3:
|
||||
trace(daNote.prevNote.wasGoodHit);
|
||||
if (down && daNote.prevNote.wasGoodHit)
|
||||
goodNoteHit(daNote);
|
||||
case -4:
|
||||
trace(daNote.prevNote.wasGoodHit);
|
||||
if (left && daNote.prevNote.wasGoodHit)
|
||||
goodNoteHit(daNote);
|
||||
case 1: // NOTES YOU JUST PRESSED
|
||||
|
@ -202,7 +240,11 @@ class PlayState extends FlxState
|
|||
|
||||
function goodNoteHit(note:Note):Void
|
||||
{
|
||||
note.wasGoodHit = true;
|
||||
if (!note.wasGoodHit)
|
||||
{
|
||||
sectionScores[1][curSection] += note.noteScore;
|
||||
note.wasGoodHit = true;
|
||||
}
|
||||
}
|
||||
|
||||
function everyBeat():Void
|
||||
|
|
Loading…
Reference in a new issue