Merge branch 'KadeDev:master' into master
This commit is contained in:
commit
4f4d14b45c
@ -9,7 +9,7 @@ install:
|
||||
- cd /home/appveyor
|
||||
- sudo add-apt-repository ppa:haxe/releases -y
|
||||
- sudo apt update
|
||||
- sudo apt install neko tar -y
|
||||
- sudo apt install neko tar gcc-7 g++-7 gcc-7-multilib g++-7-multilib -y
|
||||
- wget https://github.com/HaxeFoundation/haxe/releases/download/4.1.5/haxe-4.1.5-linux64.tar.gz
|
||||
- mkdir $HAXE_INSTALLDIR
|
||||
- tar -xf haxe-4.1.5-linux64.tar.gz -C $HAXE_INSTALLDIR
|
||||
@ -32,7 +32,6 @@ install:
|
||||
- haxelib run lime rebuild extension-webm linux
|
||||
- haxelib install linc_luajit
|
||||
- haxelib install actuate
|
||||
- haxelib git extension-webm https://github.com/KadeDev/extension-webm
|
||||
- haxelib list
|
||||
- cd /home/appveyor/projects/kade-engine-linux
|
||||
|
||||
|
@ -37,8 +37,9 @@ install:
|
||||
- haxelib run lime rebuild extension-webm windows
|
||||
- haxelib install linc_luajit
|
||||
- haxelib install actuate
|
||||
- haxelib git extension-webm https://github.com/KadeDev/extension-webm
|
||||
- lime rebuild extension-webm windows
|
||||
#- haxelib git extension-webm https://github.com/KadeDev/extension-webm
|
||||
#- haxelib run lime rebuild extension-webm windows
|
||||
#why here's dublicate lmao
|
||||
- haxelib list
|
||||
|
||||
# No tests idk lol
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 700 KiB After Width: | Height: | Size: 127 KiB |
@ -1,53 +1,92 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextureAtlas imagePath="NOTE_assets.png">
|
||||
<!-- Created with Adobe Animate version 20.0.0.17400 -->
|
||||
<!-- Created with Adobe Animate version 21.0.0.35450 -->
|
||||
<!-- http://www.adobe.com/products/animate.html -->
|
||||
<SubTexture name="arrowDOWN0000" x="0" y="235" width="157" height="153"/>
|
||||
<SubTexture name="arrowLEFT0000" x="310" y="235" width="153" height="157"/>
|
||||
<SubTexture name="arrowRIGHT0000" x="157" y="235" width="153" height="157"/>
|
||||
<SubTexture name="arrowUP0000" x="784" y="232" width="157" height="153"/>
|
||||
<SubTexture name="blue0000" x="1850" y="154" width="157" height="154"/>
|
||||
<SubTexture name="blue hold end0000" x="1170" y="447" width="50" height="64"/>
|
||||
<SubTexture name="blue hold piece0000" x="1370" y="449" width="50" height="44"/>
|
||||
<SubTexture name="down confirm0000" x="0" y="0" width="238" height="235"/>
|
||||
<SubTexture name="down confirm0001" x="238" y="0" width="238" height="235"/>
|
||||
<SubTexture name="down confirm0002" x="1176" y="230" width="219" height="208" frameX="-6" frameY="-12" frameWidth="238" frameHeight="235"/>
|
||||
<SubTexture name="down confirm0003" x="1176" y="230" width="219" height="208" frameX="-6" frameY="-12" frameWidth="238" frameHeight="235"/>
|
||||
<SubTexture name="down press0000" x="149" y="392" width="142" height="140" frameX="-4" frameY="-2" frameWidth="149" frameHeight="146"/>
|
||||
<SubTexture name="down press0001" x="149" y="392" width="142" height="140" frameX="-4" frameY="-2" frameWidth="149" frameHeight="146"/>
|
||||
<SubTexture name="down press0002" x="0" y="388" width="149" height="146"/>
|
||||
<SubTexture name="down press0003" x="0" y="388" width="149" height="146"/>
|
||||
<SubTexture name="green0000" x="1850" y="0" width="157" height="154"/>
|
||||
<SubTexture name="green hold end0000" x="1120" y="442" width="50" height="64"/>
|
||||
<SubTexture name="green hold piece0000" x="1320" y="447" width="50" height="44"/>
|
||||
<SubTexture name="left confirm0000" x="948" y="0" width="228" height="231"/>
|
||||
<SubTexture name="left confirm0001" x="1402" y="228" width="218" height="221" frameX="-5" frameY="-5" frameWidth="228" frameHeight="231"/>
|
||||
<SubTexture name="left confirm0002" x="1402" y="0" width="225" height="221" frameX="-2" frameY="-1" frameWidth="228" frameHeight="231"/>
|
||||
<SubTexture name="left confirm0003" x="1402" y="0" width="225" height="221" frameX="-2" frameY="-1" frameWidth="228" frameHeight="231"/>
|
||||
<SubTexture name="left press0000" x="291" y="392" width="140" height="142" frameX="-3" frameY="-3" frameWidth="146" frameHeight="149"/>
|
||||
<SubTexture name="left press0001" x="291" y="392" width="140" height="142" frameX="-3" frameY="-3" frameWidth="146" frameHeight="149"/>
|
||||
<SubTexture name="left press0002" x="463" y="389" width="146" height="149"/>
|
||||
<SubTexture name="left press0003" x="463" y="389" width="146" height="149"/>
|
||||
<SubTexture name="pruple end hold0000" x="1220" y="447" width="50" height="64"/>
|
||||
<SubTexture name="purple0000" x="630" y="232" width="154" height="157"/>
|
||||
<SubTexture name="purple hold piece0000" x="1420" y="449" width="50" height="44"/>
|
||||
<SubTexture name="red0000" x="476" y="232" width="154" height="157"/>
|
||||
<SubTexture name="red hold end0000" x="1070" y="442" width="50" height="64"/>
|
||||
<SubTexture name="red hold piece0000" x="1270" y="447" width="50" height="44"/>
|
||||
<SubTexture name="right confirm0000" x="1627" y="0" width="223" height="226" frameX="-1" frameY="-3" frameWidth="226" frameHeight="230"/>
|
||||
<SubTexture name="right confirm0001" x="1627" y="226" width="223" height="226" frameX="-1" frameY="-3" frameWidth="226" frameHeight="230"/>
|
||||
<SubTexture name="right confirm0002" x="1176" y="0" width="226" height="230"/>
|
||||
<SubTexture name="right confirm0003" x="1176" y="0" width="226" height="230"/>
|
||||
<SubTexture name="right press0000" x="932" y="442" width="138" height="141" frameX="-3" frameY="-7" frameWidth="148" frameHeight="151"/>
|
||||
<SubTexture name="right press0001" x="932" y="442" width="138" height="141" frameX="-3" frameY="-7" frameWidth="148" frameHeight="151"/>
|
||||
<SubTexture name="right press0002" x="784" y="385" width="148" height="151"/>
|
||||
<SubTexture name="right press0003" x="784" y="385" width="148" height="151"/>
|
||||
<SubTexture name="up confirm0000" x="476" y="0" width="236" height="232"/>
|
||||
<SubTexture name="up confirm0001" x="712" y="0" width="236" height="232"/>
|
||||
<SubTexture name="up confirm0002" x="948" y="231" width="214" height="206" frameX="-11" frameY="-10" frameWidth="236" frameHeight="232"/>
|
||||
<SubTexture name="up confirm0003" x="948" y="231" width="214" height="206" frameX="-11" frameY="-10" frameWidth="236" frameHeight="232"/>
|
||||
<SubTexture name="up press0000" x="609" y="389" width="144" height="141" frameX="-5" frameY="-4" frameWidth="153" frameHeight="150"/>
|
||||
<SubTexture name="up press0001" x="609" y="389" width="144" height="141" frameX="-5" frameY="-4" frameWidth="153" frameHeight="150"/>
|
||||
<SubTexture name="up press0002" x="1850" y="308" width="153" height="150"/>
|
||||
<SubTexture name="up press0003" x="1850" y="308" width="153" height="150"/>
|
||||
<SubTexture name="arrow static instance 10000" x="488" y="238" width="155" height="158"/>
|
||||
<SubTexture name="arrow static instance 20000" x="647" y="238" width="157" height="155"/>
|
||||
<SubTexture name="arrow static instance 30000" x="808" y="238" width="155" height="157"/>
|
||||
<SubTexture name="arrow static instance 40000" x="323" y="240" width="157" height="154"/>
|
||||
<SubTexture name="blue hold end instance 10000" x="1062" y="452" width="51" height="64"/>
|
||||
<SubTexture name="blue hold piece instance 10000" x="1282" y="457" width="51" height="44"/>
|
||||
<SubTexture name="blue instance 10000" x="0" y="240" width="158" height="154"/>
|
||||
<SubTexture name="down confirm instance 10000" x="0" y="0" width="240" height="236"/>
|
||||
<SubTexture name="down confirm instance 10001" x="244" y="0" width="240" height="236"/>
|
||||
<SubTexture name="down confirm instance 10002" x="1206" y="235" width="221" height="218" frameX="-6" frameY="-12" frameWidth="240" frameHeight="236"/>
|
||||
<SubTexture name="down confirm instance 10003" x="1206" y="235" width="221" height="218" frameX="-6" frameY="-12" frameWidth="240" frameHeight="236"/>
|
||||
<SubTexture name="down press instance 10000" x="805" y="399" width="143" height="139" frameX="-4" frameY="-3" frameWidth="150" frameHeight="146"/>
|
||||
<SubTexture name="down press instance 10001" x="805" y="399" width="143" height="139" frameX="-4" frameY="-3" frameWidth="150" frameHeight="146"/>
|
||||
<SubTexture name="down press instance 10002" x="1898" y="0" width="150" height="146"/>
|
||||
<SubTexture name="down press instance 10003" x="1898" y="0" width="150" height="146"/>
|
||||
<SubTexture name="green hold end instance 10000" x="1007" y="452" width="51" height="64"/>
|
||||
<SubTexture name="green hold piece instance 10000" x="1227" y="457" width="51" height="44"/>
|
||||
<SubTexture name="green instance 10000" x="162" y="240" width="157" height="154"/>
|
||||
<SubTexture name="left confirm instance 10000" x="972" y="0" width="230" height="232"/>
|
||||
<SubTexture name="left confirm instance 10001" x="1438" y="233" width="220" height="222" frameX="-5" frameY="-5" frameWidth="230" frameHeight="232"/>
|
||||
<SubTexture name="left confirm instance 10002" x="1438" y="0" width="227" height="229" frameX="-2" frameY="-1" frameWidth="230" frameHeight="232"/>
|
||||
<SubTexture name="left confirm instance 10003" x="1438" y="0" width="227" height="229" frameX="-2" frameY="-1" frameWidth="230" frameHeight="232"/>
|
||||
<SubTexture name="left press instance 10000" x="1898" y="449" width="139" height="142" frameX="-4" frameY="-3" frameWidth="146" frameHeight="149"/>
|
||||
<SubTexture name="left press instance 10001" x="1898" y="449" width="139" height="142" frameX="-4" frameY="-3" frameWidth="146" frameHeight="149"/>
|
||||
<SubTexture name="left press instance 10002" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10003" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10004" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10005" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10006" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10007" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10008" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10009" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10010" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10011" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10012" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10013" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10014" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10015" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10016" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10017" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10018" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10019" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="pruple end hold instance 10000" x="1117" y="452" width="51" height="64"/>
|
||||
<SubTexture name="purple hold piece instance 10000" x="1337" y="457" width="51" height="44"/>
|
||||
<SubTexture name="purple instance 10000" x="0" y="398" width="154" height="157"/>
|
||||
<SubTexture name="red hold end instance 10000" x="952" y="452" width="51" height="64"/>
|
||||
<SubTexture name="red hold piece instance 10000" x="1172" y="457" width="51" height="44"/>
|
||||
<SubTexture name="red instance 10000" x="647" y="397" width="154" height="157"/>
|
||||
<SubTexture name="right confirm instance 10000" x="1669" y="0" width="225" height="228" frameX="-1" frameY="-2" frameWidth="228" frameHeight="231"/>
|
||||
<SubTexture name="right confirm instance 10001" x="1669" y="232" width="225" height="228" frameX="-1" frameY="-2" frameWidth="228" frameHeight="231"/>
|
||||
<SubTexture name="right confirm instance 10002" x="1206" y="0" width="228" height="231"/>
|
||||
<SubTexture name="right confirm instance 10003" x="1206" y="0" width="228" height="231"/>
|
||||
<SubTexture name="right press instance 10000" x="469" y="400" width="139" height="142" frameX="-3" frameY="-7" frameWidth="149" frameHeight="152"/>
|
||||
<SubTexture name="right press instance 10001" x="469" y="400" width="139" height="142" frameX="-3" frameY="-7" frameWidth="149" frameHeight="152"/>
|
||||
<SubTexture name="right press instance 10002" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10003" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10004" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10005" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10006" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10007" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10008" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10009" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10010" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10011" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10012" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10013" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10014" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10015" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10016" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10017" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10018" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10019" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10020" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10021" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10022" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10023" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10024" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10025" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10026" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="up confirm instance 10000" x="488" y="0" width="238" height="234"/>
|
||||
<SubTexture name="up confirm instance 10001" x="730" y="0" width="238" height="234"/>
|
||||
<SubTexture name="up confirm instance 10002" x="972" y="236" width="216" height="212" frameX="-11" frameY="-11" frameWidth="238" frameHeight="234"/>
|
||||
<SubTexture name="up confirm instance 10003" x="972" y="236" width="216" height="212" frameX="-11" frameY="-11" frameWidth="238" frameHeight="234"/>
|
||||
<SubTexture name="up press instance 10000" x="1898" y="303" width="144" height="142" frameX="-6" frameY="-4" frameWidth="154" frameHeight="151"/>
|
||||
<SubTexture name="up press instance 10001" x="1898" y="303" width="144" height="142" frameX="-6" frameY="-4" frameWidth="154" frameHeight="151"/>
|
||||
<SubTexture name="up press instance 10002" x="158" y="398" width="154" height="151"/>
|
||||
<SubTexture name="up press instance 10003" x="158" y="398" width="154" height="151"/>
|
||||
</TextureAtlas>
|
||||
|
@ -83,6 +83,7 @@ class Caching extends MusicBeatState
|
||||
|
||||
var images = [];
|
||||
var music = [];
|
||||
var charts = [];
|
||||
|
||||
trace("caching images...");
|
||||
|
||||
@ -100,6 +101,7 @@ class Caching extends MusicBeatState
|
||||
music.push(i);
|
||||
}
|
||||
|
||||
|
||||
toBeDone = Lambda.count(images) + Lambda.count(music);
|
||||
|
||||
trace("LOADING: " + toBeDone + " OBJECTS.");
|
||||
@ -120,6 +122,7 @@ class Caching extends MusicBeatState
|
||||
done++;
|
||||
}
|
||||
|
||||
|
||||
trace("Finished caching...");
|
||||
|
||||
FlxG.switchState(new TitleState());
|
||||
|
92
source/DiffCalc.hx
Normal file
92
source/DiffCalc.hx
Normal file
@ -0,0 +1,92 @@
|
||||
import Song.SwagSong;
|
||||
|
||||
class SmallNote // basically Note.hx but small as fuck
|
||||
{
|
||||
public var strumTime:Float;
|
||||
public var noteData:Int;
|
||||
|
||||
public function new(strum,data)
|
||||
{
|
||||
strumTime = strum;
|
||||
noteData = data;
|
||||
}
|
||||
}
|
||||
|
||||
class DiffCalc
|
||||
{
|
||||
public static function CalculateDiff(song:SwagSong)
|
||||
{
|
||||
// cleaned notes
|
||||
var cleanedNotes:Array<SmallNote> = [];
|
||||
|
||||
// find all of the notes
|
||||
for(i in song.notes) // sections
|
||||
{
|
||||
for (ii in i.sectionNotes) // notes
|
||||
{
|
||||
if (ii[2] != 0) // skip helds
|
||||
continue;
|
||||
var gottaHitNote:Bool = i.mustHitSection;
|
||||
|
||||
if (ii[1] > 3)
|
||||
gottaHitNote = !i.mustHitSection;
|
||||
|
||||
if (gottaHitNote)
|
||||
cleanedNotes.push(new SmallNote(ii[0],ii[1]));
|
||||
}
|
||||
}
|
||||
|
||||
cleanedNotes.sort((a, b) -> Std.int(a.strumTime - b.strumTime));
|
||||
|
||||
var firstNoteTime = cleanedNotes[0].strumTime;
|
||||
|
||||
// normalize the notes
|
||||
for(i in cleanedNotes)
|
||||
{
|
||||
i.strumTime = (i.strumTime - firstNoteTime) * 2;
|
||||
}
|
||||
|
||||
// length in segments of the song
|
||||
var length = ((cleanedNotes[cleanedNotes.length - 1].strumTime / 1000) / 0.5);
|
||||
|
||||
// hackey way of creating a array with a length
|
||||
var segments:Array<Int> = new_Array(1,Std.int(length));
|
||||
|
||||
// algo loop
|
||||
for(i in cleanedNotes)
|
||||
{
|
||||
var index = Std.int(((i.strumTime / 1000)));
|
||||
if (index + 1 > segments.length)
|
||||
continue;
|
||||
segments[index] = segments[index] + 1;
|
||||
}
|
||||
|
||||
// get the average of all of the segments
|
||||
var sum:Float = 0;
|
||||
|
||||
var newLength = segments.length;
|
||||
|
||||
for (i in segments)
|
||||
{
|
||||
if (i == 0) // remove empty/breaks
|
||||
{
|
||||
newLength--;
|
||||
continue;
|
||||
}
|
||||
//trace(i);
|
||||
sum += i / .5; // half it because otherwise instead of nps its just fucking notes per half second which is dumb and stupid
|
||||
}
|
||||
return HelperFunctions.truncateFloat(sum / newLength,2);
|
||||
}
|
||||
|
||||
static public function new_Array<T>( ArrayType:T, Length:Int ):Array<T> {
|
||||
var empty:Null<T> = null;
|
||||
var newArray:Array<T> = new Array<T>();
|
||||
|
||||
for ( i in 0...Length ) {
|
||||
newArray.push( empty );
|
||||
}
|
||||
|
||||
return newArray;
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package;
|
||||
|
||||
import Song.SwagSong;
|
||||
import flixel.input.gamepad.FlxGamepad;
|
||||
import flash.text.TextField;
|
||||
import flixel.FlxG;
|
||||
@ -29,6 +30,7 @@ class FreeplayState extends MusicBeatState
|
||||
var scoreText:FlxText;
|
||||
var comboText:FlxText;
|
||||
var diffText:FlxText;
|
||||
var diffCalcText:FlxText;
|
||||
var lerpScore:Int = 0;
|
||||
var intendedScore:Int = 0;
|
||||
var combo:String = '';
|
||||
@ -38,16 +40,48 @@ class FreeplayState extends MusicBeatState
|
||||
|
||||
private var iconArray:Array<HealthIcon> = [];
|
||||
|
||||
public static var songData:Map<String,Array<SwagSong>> = [];
|
||||
|
||||
public static function loadDiff(diff:Int, format:String, name:String, array:Array<SwagSong>)
|
||||
{
|
||||
try
|
||||
{
|
||||
array.push(Song.loadFromJson(Highscore.formatSong(format, diff), name));
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
// do nada
|
||||
}
|
||||
}
|
||||
|
||||
override function create()
|
||||
{
|
||||
var initSonglist = CoolUtil.coolTextFile(Paths.txt('freeplaySonglist'));
|
||||
|
||||
//var diffList = "";
|
||||
|
||||
for (i in 0...initSonglist.length)
|
||||
{
|
||||
var data:Array<String> = initSonglist[i].split(':');
|
||||
songs.push(new SongMetadata(data[0], Std.parseInt(data[2]), data[1]));
|
||||
var meta = new SongMetadata(data[0], Std.parseInt(data[2]), data[1]);
|
||||
songs.push(meta);
|
||||
var format = StringTools.replace(meta.songName, " ", "-");
|
||||
switch (format) {
|
||||
case 'Dad-Battle': format = 'Dadbattle';
|
||||
case 'Philly-Nice': format = 'Philly';
|
||||
}
|
||||
|
||||
var diffs = [];
|
||||
FreeplayState.loadDiff(0,format,meta.songName,diffs);
|
||||
FreeplayState.loadDiff(1,format,meta.songName,diffs);
|
||||
FreeplayState.loadDiff(2,format,meta.songName,diffs);
|
||||
FreeplayState.songData.set(meta.songName,diffs);
|
||||
trace('loaded diffs for ' + meta.songName);
|
||||
//diffList += meta.songName + "\nEasy: " + DiffCalc.CalculateDiff(songData.get(meta.songName)[0]) + "\nNormal: " + DiffCalc.CalculateDiff(songData.get(meta.songName)[1]) + "\nHard: " + DiffCalc.CalculateDiff(songData.get(meta.songName)[2]) + "\n\n";
|
||||
}
|
||||
|
||||
//trace("\n" + diffList);
|
||||
|
||||
/*
|
||||
if (FlxG.sound.music != null)
|
||||
{
|
||||
@ -101,7 +135,7 @@ class FreeplayState extends MusicBeatState
|
||||
scoreText.setFormat(Paths.font("vcr.ttf"), 32, FlxColor.WHITE, RIGHT);
|
||||
// scoreText.alignment = RIGHT;
|
||||
|
||||
var scoreBG:FlxSprite = new FlxSprite(scoreText.x - 6, 0).makeGraphic(Std.int(FlxG.width * 0.35), 66, 0xFF000000);
|
||||
var scoreBG:FlxSprite = new FlxSprite(scoreText.x - 6, 0).makeGraphic(Std.int(FlxG.width * 0.35), 105, 0xFF000000);
|
||||
scoreBG.alpha = 0.6;
|
||||
add(scoreBG);
|
||||
|
||||
@ -109,6 +143,10 @@ class FreeplayState extends MusicBeatState
|
||||
diffText.font = scoreText.font;
|
||||
add(diffText);
|
||||
|
||||
diffCalcText = new FlxText(scoreText.x, scoreText.y + 66, 0, "", 24);
|
||||
diffCalcText.font = scoreText.font;
|
||||
add(diffCalcText);
|
||||
|
||||
comboText = new FlxText(diffText.x + 100, diffText.y, 0, "", 24);
|
||||
comboText.font = diffText.font;
|
||||
add(comboText);
|
||||
@ -238,14 +276,20 @@ class FreeplayState extends MusicBeatState
|
||||
case 'Dad-Battle': songFormat = 'Dadbattle';
|
||||
case 'Philly-Nice': songFormat = 'Philly';
|
||||
}
|
||||
var hmm;
|
||||
try
|
||||
{
|
||||
hmm = songData.get(songs[curSelected].songName)[curDifficulty];
|
||||
if (hmm == null)
|
||||
return;
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
trace(songs[curSelected].songName);
|
||||
|
||||
var poop:String = Highscore.formatSong(songFormat, curDifficulty);
|
||||
|
||||
trace(poop);
|
||||
|
||||
PlayState.SONG = Song.loadFromJson(poop, songs[curSelected].songName);
|
||||
PlayState.SONG = hmm;
|
||||
PlayState.isStoryMode = false;
|
||||
PlayState.storyDifficulty = curDifficulty;
|
||||
PlayState.storyWeek = songs[curSelected].week;
|
||||
@ -274,7 +318,7 @@ class FreeplayState extends MusicBeatState
|
||||
intendedScore = Highscore.getScore(songHighscore, curDifficulty);
|
||||
combo = Highscore.getCombo(songHighscore, curDifficulty);
|
||||
#end
|
||||
|
||||
diffCalcText.text = 'RATING: ${DiffCalc.CalculateDiff(songData.get(songs[curSelected].songName)[curDifficulty])}';
|
||||
diffText.text = CoolUtil.difficultyFromInt(curDifficulty).toUpperCase();
|
||||
}
|
||||
|
||||
@ -310,6 +354,8 @@ class FreeplayState extends MusicBeatState
|
||||
// lerpScore = 0;
|
||||
#end
|
||||
|
||||
diffCalcText.text = 'RATING: ${DiffCalc.CalculateDiff(songData.get(songs[curSelected].songName)[curDifficulty])}';
|
||||
|
||||
#if PRELOAD_ALL
|
||||
FlxG.sound.playMusic(Paths.inst(songs[curSelected].songName), 0);
|
||||
#end
|
||||
|
@ -72,6 +72,10 @@ class KeyBinds
|
||||
FlxG.save.data.gprightBind = "DPAD_RIGHT";
|
||||
trace("No GRIGHT");
|
||||
}
|
||||
if(FlxG.save.data.killBind == null){
|
||||
FlxG.save.data.killBind = "R";
|
||||
trace("No KILL");
|
||||
}
|
||||
|
||||
trace('${FlxG.save.data.leftBind}-${FlxG.save.data.downBind}-${FlxG.save.data.upBind}-${FlxG.save.data.rightBind}');
|
||||
}
|
||||
|
@ -99,20 +99,20 @@ class Note extends FlxSprite
|
||||
default:
|
||||
frames = Paths.getSparrowAtlas('NOTE_assets');
|
||||
|
||||
animation.addByPrefix('greenScroll', 'green0');
|
||||
animation.addByPrefix('redScroll', 'red0');
|
||||
animation.addByPrefix('blueScroll', 'blue0');
|
||||
animation.addByPrefix('purpleScroll', 'purple0');
|
||||
animation.addByPrefix('greenScroll', 'green instance 1');
|
||||
animation.addByPrefix('redScroll', 'red instance 1');
|
||||
animation.addByPrefix('blueScroll', 'blue instance 1');
|
||||
animation.addByPrefix('purpleScroll', 'purple instance 1');
|
||||
|
||||
animation.addByPrefix('purpleholdend', 'pruple end hold');
|
||||
animation.addByPrefix('greenholdend', 'green hold end');
|
||||
animation.addByPrefix('redholdend', 'red hold end');
|
||||
animation.addByPrefix('blueholdend', 'blue hold end');
|
||||
animation.addByPrefix('purpleholdend', 'pruple end hold instance 1');
|
||||
animation.addByPrefix('greenholdend', 'green hold end instance 1');
|
||||
animation.addByPrefix('redholdend', 'red hold end instance 1');
|
||||
animation.addByPrefix('blueholdend', 'blue hold end instance 1');
|
||||
|
||||
animation.addByPrefix('purplehold', 'purple hold piece');
|
||||
animation.addByPrefix('greenhold', 'green hold piece');
|
||||
animation.addByPrefix('redhold', 'red hold piece');
|
||||
animation.addByPrefix('bluehold', 'blue hold piece');
|
||||
animation.addByPrefix('purplehold', 'purple hold piece instance 1');
|
||||
animation.addByPrefix('greenhold', 'green hold piece instance 1');
|
||||
animation.addByPrefix('redhold', 'red hold piece instance 1');
|
||||
animation.addByPrefix('bluehold', 'blue hold piece instance 1');
|
||||
|
||||
setGraphicSize(Std.int(width * 0.7));
|
||||
updateHitbox();
|
||||
|
@ -111,19 +111,18 @@ class PauseSubState extends MusicBeatSubstate
|
||||
|
||||
var gamepad:FlxGamepad = FlxG.gamepads.lastActive;
|
||||
|
||||
var upP = controls.UP_P;
|
||||
var downP = controls.DOWN_P;
|
||||
var leftP = controls.LEFT_P;
|
||||
var rightP = controls.RIGHT_P;
|
||||
var accepted = controls.ACCEPT;
|
||||
var upPcontroller:Bool = false;
|
||||
var downPcontroller:Bool = false;
|
||||
var leftPcontroller:Bool = false;
|
||||
var rightPcontroller:Bool = false;
|
||||
var oldOffset:Float = 0;
|
||||
|
||||
if (gamepad != null && KeyBinds.gamepad)
|
||||
{
|
||||
upP = gamepad.justPressed.DPAD_UP;
|
||||
downP = gamepad.justPressed.DPAD_DOWN;
|
||||
leftP = gamepad.justPressed.DPAD_LEFT;
|
||||
rightP = gamepad.justPressed.DPAD_RIGHT;
|
||||
upPcontroller = gamepad.justPressed.DPAD_UP;
|
||||
downPcontroller = gamepad.justPressed.DPAD_DOWN;
|
||||
leftPcontroller = gamepad.justPressed.DPAD_LEFT;
|
||||
rightPcontroller = gamepad.justPressed.DPAD_RIGHT;
|
||||
}
|
||||
|
||||
// pre lowercasing the song name (update)
|
||||
@ -134,17 +133,18 @@ class PauseSubState extends MusicBeatSubstate
|
||||
}
|
||||
var songPath = 'assets/data/' + songLowercase + '/';
|
||||
|
||||
if (upP)
|
||||
if (controls.UP_P || upPcontroller)
|
||||
{
|
||||
changeSelection(-1);
|
||||
|
||||
}else if (downP)
|
||||
}
|
||||
else if (controls.DOWN_P || downPcontroller)
|
||||
{
|
||||
changeSelection(1);
|
||||
}
|
||||
|
||||
#if cpp
|
||||
else if (leftP)
|
||||
else if (controls.LEFT_P || leftPcontroller)
|
||||
{
|
||||
oldOffset = PlayState.songOffset;
|
||||
PlayState.songOffset -= 1;
|
||||
@ -171,7 +171,8 @@ class PauseSubState extends MusicBeatSubstate
|
||||
cameras = [FlxG.cameras.list[FlxG.cameras.list.length - 1]];
|
||||
offsetChanged = true;
|
||||
}
|
||||
}else if (rightP)
|
||||
}
|
||||
else if (controls.RIGHT_P || rightPcontroller)
|
||||
{
|
||||
oldOffset = PlayState.songOffset;
|
||||
PlayState.songOffset += 1;
|
||||
@ -199,7 +200,7 @@ class PauseSubState extends MusicBeatSubstate
|
||||
}
|
||||
#end
|
||||
|
||||
if (accepted)
|
||||
if (controls.ACCEPT)
|
||||
{
|
||||
var daSelected:String = menuItems[curSelected];
|
||||
|
||||
|
@ -1129,6 +1129,7 @@ class PlayState extends MusicBeatState
|
||||
rep = new Replay("na");
|
||||
|
||||
FlxG.stage.addEventListener(KeyboardEvent.KEY_DOWN,handleInput);
|
||||
FlxG.stage.addEventListener(KeyboardEvent.KEY_UP,releaseInput);
|
||||
|
||||
super.create();
|
||||
}
|
||||
@ -1368,6 +1369,41 @@ class PlayState extends MusicBeatState
|
||||
return null;
|
||||
}
|
||||
|
||||
var keys = [false,false,false,false];
|
||||
|
||||
private function releaseInput(evt:KeyboardEvent):Void // handles releases
|
||||
{
|
||||
@:privateAccess
|
||||
var key = FlxKey.toStringMap.get(Keyboard.__convertKeyCode(evt.keyCode));
|
||||
|
||||
var binds:Array<String> = [FlxG.save.data.leftBind,FlxG.save.data.downBind, FlxG.save.data.upBind, FlxG.save.data.rightBind];
|
||||
|
||||
var data = -1;
|
||||
|
||||
switch(evt.keyCode) // arrow keys
|
||||
{
|
||||
case 37:
|
||||
data = 0;
|
||||
case 40:
|
||||
data = 1;
|
||||
case 38:
|
||||
data = 2;
|
||||
case 39:
|
||||
data = 3;
|
||||
}
|
||||
|
||||
for (i in 0...binds.length) // binds
|
||||
{
|
||||
if (binds[i].toLowerCase() == key.toLowerCase())
|
||||
data = i;
|
||||
}
|
||||
|
||||
if (data == -1)
|
||||
return;
|
||||
|
||||
keys[data] = false;
|
||||
}
|
||||
|
||||
private function handleInput(evt:KeyboardEvent):Void { // this actually handles press inputs
|
||||
|
||||
if (PlayStateChangeables.botPlay || loadRep || paused)
|
||||
@ -1401,15 +1437,16 @@ class PlayState extends MusicBeatState
|
||||
if (binds[i].toLowerCase() == key.toLowerCase())
|
||||
data = i;
|
||||
}
|
||||
|
||||
if (evt.keyLocation == KeyLocation.NUM_PAD)
|
||||
{
|
||||
trace(String.fromCharCode(evt.charCode) + " " + key);
|
||||
}
|
||||
|
||||
if (data == -1)
|
||||
return;
|
||||
|
||||
if (keys[data])
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
keys[data] = true;
|
||||
|
||||
var ana = new Ana(Conductor.songPosition, null, false, "miss", data);
|
||||
|
||||
var dataNotes = [];
|
||||
@ -1594,6 +1631,7 @@ class PlayState extends MusicBeatState
|
||||
swagNote.sustainLength = songNotes[2];
|
||||
swagNote.scrollFactor.set(0, 0);
|
||||
|
||||
|
||||
var susLength:Float = swagNote.sustainLength;
|
||||
|
||||
susLength = susLength / Conductor.stepCrochet;
|
||||
@ -1697,10 +1735,10 @@ class PlayState extends MusicBeatState
|
||||
|
||||
case 'normal':
|
||||
babyArrow.frames = Paths.getSparrowAtlas('NOTE_assets');
|
||||
babyArrow.animation.addByPrefix('green', 'arrowUP');
|
||||
babyArrow.animation.addByPrefix('blue', 'arrowDOWN');
|
||||
babyArrow.animation.addByPrefix('purple', 'arrowLEFT');
|
||||
babyArrow.animation.addByPrefix('red', 'arrowRIGHT');
|
||||
babyArrow.animation.addByPrefix('green', 'arrow static instance 1');
|
||||
babyArrow.animation.addByPrefix('blue', 'arrow static instance 2');
|
||||
babyArrow.animation.addByPrefix('purple', 'arrow static instance 3');
|
||||
babyArrow.animation.addByPrefix('red', 'arrow static instance 4');
|
||||
|
||||
babyArrow.antialiasing = true;
|
||||
babyArrow.setGraphicSize(Std.int(babyArrow.width * 0.7));
|
||||
@ -1709,32 +1747,32 @@ class PlayState extends MusicBeatState
|
||||
{
|
||||
case 0:
|
||||
babyArrow.x += Note.swagWidth * 0;
|
||||
babyArrow.animation.addByPrefix('static', 'arrowLEFT');
|
||||
babyArrow.animation.addByPrefix('pressed', 'left press', 24, false);
|
||||
babyArrow.animation.addByPrefix('confirm', 'left confirm', 24, false);
|
||||
babyArrow.animation.addByPrefix('static', 'arrow static instance 1');
|
||||
babyArrow.animation.addByPrefix('pressed', 'left press instance 1', 24, false);
|
||||
babyArrow.animation.addByPrefix('confirm', 'left confirm instance 1', 24, false);
|
||||
case 1:
|
||||
babyArrow.x += Note.swagWidth * 1;
|
||||
babyArrow.animation.addByPrefix('static', 'arrowDOWN');
|
||||
babyArrow.animation.addByPrefix('pressed', 'down press', 24, false);
|
||||
babyArrow.animation.addByPrefix('confirm', 'down confirm', 24, false);
|
||||
babyArrow.animation.addByPrefix('static', 'arrow static instance 2');
|
||||
babyArrow.animation.addByPrefix('pressed', 'down press instance 1', 24, false);
|
||||
babyArrow.animation.addByPrefix('confirm', 'down confirm instance 1', 24, false);
|
||||
case 2:
|
||||
babyArrow.x += Note.swagWidth * 2;
|
||||
babyArrow.animation.addByPrefix('static', 'arrowUP');
|
||||
babyArrow.animation.addByPrefix('pressed', 'up press', 24, false);
|
||||
babyArrow.animation.addByPrefix('confirm', 'up confirm', 24, false);
|
||||
babyArrow.animation.addByPrefix('static', 'arrow static instance 4');
|
||||
babyArrow.animation.addByPrefix('pressed', 'up press instance 1', 24, false);
|
||||
babyArrow.animation.addByPrefix('confirm', 'up confirm instance 1', 24, false);
|
||||
case 3:
|
||||
babyArrow.x += Note.swagWidth * 3;
|
||||
babyArrow.animation.addByPrefix('static', 'arrowRIGHT');
|
||||
babyArrow.animation.addByPrefix('pressed', 'right press', 24, false);
|
||||
babyArrow.animation.addByPrefix('confirm', 'right confirm', 24, false);
|
||||
babyArrow.animation.addByPrefix('static', 'arrow static instance 3');
|
||||
babyArrow.animation.addByPrefix('pressed', 'right press instance 1', 24, false);
|
||||
babyArrow.animation.addByPrefix('confirm', 'right confirm instance 1', 24, false);
|
||||
}
|
||||
|
||||
default:
|
||||
babyArrow.frames = Paths.getSparrowAtlas('NOTE_assets');
|
||||
babyArrow.animation.addByPrefix('green', 'arrowUP');
|
||||
babyArrow.animation.addByPrefix('blue', 'arrowDOWN');
|
||||
babyArrow.animation.addByPrefix('purple', 'arrowLEFT');
|
||||
babyArrow.animation.addByPrefix('red', 'arrowRIGHT');
|
||||
babyArrow.animation.addByPrefix('green', 'arrow static instance 1');
|
||||
babyArrow.animation.addByPrefix('blue', 'arrow static instance 2');
|
||||
babyArrow.animation.addByPrefix('purple', 'arrow static instance 3');
|
||||
babyArrow.animation.addByPrefix('red', 'arrow static instance 4');
|
||||
|
||||
babyArrow.antialiasing = true;
|
||||
babyArrow.setGraphicSize(Std.int(babyArrow.width * 0.7));
|
||||
@ -1743,24 +1781,24 @@ class PlayState extends MusicBeatState
|
||||
{
|
||||
case 0:
|
||||
babyArrow.x += Note.swagWidth * 0;
|
||||
babyArrow.animation.addByPrefix('static', 'arrowLEFT');
|
||||
babyArrow.animation.addByPrefix('pressed', 'left press', 24, false);
|
||||
babyArrow.animation.addByPrefix('confirm', 'left confirm', 24, false);
|
||||
babyArrow.animation.addByPrefix('static', 'arrow static instance 1');
|
||||
babyArrow.animation.addByPrefix('pressed', 'left press instance 1', 24, false);
|
||||
babyArrow.animation.addByPrefix('confirm', 'left confirm instance 1', 24, false);
|
||||
case 1:
|
||||
babyArrow.x += Note.swagWidth * 1;
|
||||
babyArrow.animation.addByPrefix('static', 'arrowDOWN');
|
||||
babyArrow.animation.addByPrefix('pressed', 'down press', 24, false);
|
||||
babyArrow.animation.addByPrefix('confirm', 'down confirm', 24, false);
|
||||
babyArrow.animation.addByPrefix('static', 'arrow static instance 2');
|
||||
babyArrow.animation.addByPrefix('pressed', 'down press instance 1', 24, false);
|
||||
babyArrow.animation.addByPrefix('confirm', 'down confirm instance 1', 24, false);
|
||||
case 2:
|
||||
babyArrow.x += Note.swagWidth * 2;
|
||||
babyArrow.animation.addByPrefix('static', 'arrowUP');
|
||||
babyArrow.animation.addByPrefix('pressed', 'up press', 24, false);
|
||||
babyArrow.animation.addByPrefix('confirm', 'up confirm', 24, false);
|
||||
babyArrow.animation.addByPrefix('static', 'arrow static instance 4');
|
||||
babyArrow.animation.addByPrefix('pressed', 'up press instance 1', 24, false);
|
||||
babyArrow.animation.addByPrefix('confirm', 'up confirm instance 1', 24, false);
|
||||
case 3:
|
||||
babyArrow.x += Note.swagWidth * 3;
|
||||
babyArrow.animation.addByPrefix('static', 'arrowRIGHT');
|
||||
babyArrow.animation.addByPrefix('pressed', 'right press', 24, false);
|
||||
babyArrow.animation.addByPrefix('confirm', 'right confirm', 24, false);
|
||||
babyArrow.animation.addByPrefix('static', 'arrow static instance 3');
|
||||
babyArrow.animation.addByPrefix('pressed', 'right press instance 1', 24, false);
|
||||
babyArrow.animation.addByPrefix('confirm', 'right confirm instance 1', 24, false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2041,6 +2079,7 @@ class PlayState extends MusicBeatState
|
||||
#end
|
||||
FlxG.switchState(new ChartingState());
|
||||
FlxG.stage.removeEventListener(KeyboardEvent.KEY_DOWN,handleInput);
|
||||
FlxG.stage.removeEventListener(KeyboardEvent.KEY_UP,releaseInput);
|
||||
#if windows
|
||||
if (luaModchart != null)
|
||||
{
|
||||
@ -2093,6 +2132,7 @@ class PlayState extends MusicBeatState
|
||||
|
||||
FlxG.switchState(new AnimationDebug(SONG.player2));
|
||||
FlxG.stage.removeEventListener(KeyboardEvent.KEY_DOWN,handleInput);
|
||||
FlxG.stage.removeEventListener(KeyboardEvent.KEY_UP,releaseInput);
|
||||
#if windows
|
||||
if (luaModchart != null)
|
||||
{
|
||||
@ -2106,6 +2146,7 @@ class PlayState extends MusicBeatState
|
||||
{
|
||||
FlxG.switchState(new AnimationDebug(SONG.player1));
|
||||
FlxG.stage.removeEventListener(KeyboardEvent.KEY_DOWN,handleInput);
|
||||
FlxG.stage.removeEventListener(KeyboardEvent.KEY_UP,releaseInput);
|
||||
#if windows
|
||||
if (luaModchart != null)
|
||||
{
|
||||
@ -2660,6 +2701,7 @@ class PlayState extends MusicBeatState
|
||||
function endSong():Void
|
||||
{
|
||||
FlxG.stage.removeEventListener(KeyboardEvent.KEY_DOWN,handleInput);
|
||||
FlxG.stage.removeEventListener(KeyboardEvent.KEY_UP,releaseInput);
|
||||
if (useVideo)
|
||||
{
|
||||
GlobalVideo.get().stop();
|
||||
@ -3149,6 +3191,8 @@ class PlayState extends MusicBeatState
|
||||
};
|
||||
#end
|
||||
|
||||
var nonCpp = false;
|
||||
|
||||
|
||||
// Prevent player input if botplay is on
|
||||
if(PlayStateChangeables.botPlay)
|
||||
@ -3158,6 +3202,10 @@ class PlayState extends MusicBeatState
|
||||
releaseArray = [false, false, false, false];
|
||||
}
|
||||
|
||||
#if !cpp
|
||||
nonCpp = true;
|
||||
#end
|
||||
|
||||
var anas:Array<Ana> = [null,null,null,null];
|
||||
|
||||
for (i in 0...pressArray.length)
|
||||
@ -3174,7 +3222,7 @@ class PlayState extends MusicBeatState
|
||||
});
|
||||
}
|
||||
|
||||
if (KeyBinds.gamepad && !FlxG.keys.justPressed.ANY)
|
||||
if ((KeyBinds.gamepad && !FlxG.keys.justPressed.ANY) || nonCpp)
|
||||
{
|
||||
// PRESSES, check for note hits
|
||||
if (pressArray.contains(true) && generatedMusic)
|
||||
|
Loading…
x
Reference in New Issue
Block a user