dynamic camer, reformat chart, lvl2

This commit is contained in:
Cameron Taylor 2020-10-04 17:53:49 -07:00
parent de17188ae4
commit 9e1ccaf083
36 changed files with 92 additions and 36 deletions

View File

Before

Width:  |  Height:  |  Size: 116 B

After

Width:  |  Height:  |  Size: 116 B

View File

Before

Width:  |  Height:  |  Size: 122 B

After

Width:  |  Height:  |  Size: 122 B

View File

Before

Width:  |  Height:  |  Size: 127 B

After

Width:  |  Height:  |  Size: 127 B

View File

Before

Width:  |  Height:  |  Size: 100 B

After

Width:  |  Height:  |  Size: 100 B

View File

Before

Width:  |  Height:  |  Size: 117 B

After

Width:  |  Height:  |  Size: 117 B

View File

Before

Width:  |  Height:  |  Size: 127 B

After

Width:  |  Height:  |  Size: 127 B

View File

Before

Width:  |  Height:  |  Size: 125 B

After

Width:  |  Height:  |  Size: 125 B

View File

Before

Width:  |  Height:  |  Size: 127 B

After

Width:  |  Height:  |  Size: 127 B

View File

Before

Width:  |  Height:  |  Size: 128 B

After

Width:  |  Height:  |  Size: 128 B

View File

Before

Width:  |  Height:  |  Size: 123 B

After

Width:  |  Height:  |  Size: 123 B

View File

Before

Width:  |  Height:  |  Size: 126 B

After

Width:  |  Height:  |  Size: 126 B

View File

Before

Width:  |  Height:  |  Size: 123 B

After

Width:  |  Height:  |  Size: 123 B

View File

Before

Width:  |  Height:  |  Size: 117 B

After

Width:  |  Height:  |  Size: 117 B

View File

Before

Width:  |  Height:  |  Size: 127 B

After

Width:  |  Height:  |  Size: 127 B

View File

Before

Width:  |  Height:  |  Size: 127 B

After

Width:  |  Height:  |  Size: 127 B

View File

@ -0,0 +1,5 @@
{
"song": "Fresh",
"bpm": 120,
"sections": 8
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 792 KiB

After

Width:  |  Height:  |  Size: 1.1 MiB

View File

@ -2,21 +2,49 @@
<TextureAtlas imagePath="DADDY_DEAREST.png">
<!-- Created with Adobe Animate version 20.0.0.17400 -->
<!-- http://www.adobe.com/products/animate.html -->
<SubTexture name="Dad Sing Note DOWN0000" x="0" y="792" width="470" height="730"/>
<SubTexture name="Dad Sing Note LEFT0000" x="424" y="3055" width="370" height="777"/>
<SubTexture name="Dad Sing Note RIGHT0000" x="0" y="0" width="465" height="792"/>
<SubTexture name="Dad Sing Note UP0000" x="0" y="1522" width="408" height="818"/>
<SubTexture name="Dad idle dance0000" x="0" y="2340" width="419" height="767" frameX="-6" frameY="0" frameWidth="429" frameHeight="767"/>
<SubTexture name="Dad idle dance0001" x="0" y="2340" width="419" height="767" frameX="-6" frameY="0" frameWidth="429" frameHeight="767"/>
<SubTexture name="Dad idle dance0002" x="465" y="0" width="429" height="759" frameX="0" frameY="-8" frameWidth="429" frameHeight="767"/>
<SubTexture name="Dad idle dance0003" x="465" y="0" width="429" height="759" frameX="0" frameY="-8" frameWidth="429" frameHeight="767"/>
<SubTexture name="Dad idle dance0004" x="0" y="3107" width="424" height="757" frameX="-2" frameY="-10" frameWidth="429" frameHeight="767"/>
<SubTexture name="Dad idle dance0005" x="0" y="3107" width="424" height="757" frameX="-2" frameY="-10" frameWidth="429" frameHeight="767"/>
<SubTexture name="Dad idle dance0006" x="470" y="759" width="423" height="759" frameX="-3" frameY="-8" frameWidth="429" frameHeight="767"/>
<SubTexture name="Dad idle dance0007" x="470" y="759" width="423" height="759" frameX="-3" frameY="-8" frameWidth="429" frameHeight="767"/>
<SubTexture name="Dad idle dance0008" x="419" y="2289" width="419" height="766" frameX="-5" frameY="-1" frameWidth="429" frameHeight="767"/>
<SubTexture name="Dad idle dance0009" x="419" y="2289" width="419" height="766" frameX="-5" frameY="-1" frameWidth="429" frameHeight="767"/>
<SubTexture name="Dad idle dance0010" x="408" y="1522" width="419" height="767" frameX="-6" frameY="0" frameWidth="429" frameHeight="767"/>
<SubTexture name="Dad idle dance0011" x="408" y="1522" width="419" height="767" frameX="-6" frameY="0" frameWidth="429" frameHeight="767"/>
<SubTexture name="Dad idle dance0012" x="0" y="2340" width="419" height="767" frameX="-6" frameY="0" frameWidth="429" frameHeight="767"/>
<SubTexture name="Dad Sing Note DOWN0000" x="1369" y="0" width="470" height="730" frameX="0" frameY="-5" frameWidth="470" frameHeight="735"/>
<SubTexture name="Dad Sing Note DOWN0001" x="1369" y="0" width="470" height="730" frameX="0" frameY="-5" frameWidth="470" frameHeight="735"/>
<SubTexture name="Dad Sing Note DOWN0002" x="1839" y="0" width="462" height="735" frameX="-4" frameY="0" frameWidth="470" frameHeight="735"/>
<SubTexture name="Dad Sing Note DOWN0003" x="1839" y="0" width="462" height="735" frameX="-4" frameY="0" frameWidth="470" frameHeight="735"/>
<SubTexture name="Dad Sing Note DOWN0004" x="1839" y="0" width="462" height="735" frameX="-4" frameY="0" frameWidth="470" frameHeight="735"/>
<SubTexture name="Dad Sing Note DOWN0005" x="1839" y="0" width="462" height="735" frameX="-4" frameY="0" frameWidth="470" frameHeight="735"/>
<SubTexture name="Dad Sing Note DOWN0006" x="1839" y="0" width="462" height="735" frameX="-4" frameY="0" frameWidth="470" frameHeight="735"/>
<SubTexture name="Dad Sing Note LEFT0000" x="843" y="793" width="370" height="777"/>
<SubTexture name="Dad Sing Note RIGHT0000" x="0" y="0" width="465" height="792" frameX="0" frameY="-1" frameWidth="465" frameHeight="793"/>
<SubTexture name="Dad Sing Note RIGHT0001" x="0" y="0" width="465" height="792" frameX="0" frameY="-1" frameWidth="465" frameHeight="793"/>
<SubTexture name="Dad Sing Note RIGHT0002" x="465" y="0" width="452" height="793" frameX="0" frameY="0" frameWidth="465" frameHeight="793"/>
<SubTexture name="Dad Sing Note RIGHT0003" x="465" y="0" width="452" height="793" frameX="0" frameY="0" frameWidth="465" frameHeight="793"/>
<SubTexture name="Dad Sing Note RIGHT0004" x="917" y="0" width="452" height="793" frameX="0" frameY="0" frameWidth="465" frameHeight="793"/>
<SubTexture name="Dad Sing Note RIGHT0005" x="917" y="0" width="452" height="793" frameX="0" frameY="0" frameWidth="465" frameHeight="793"/>
<SubTexture name="Dad Sing Note RIGHT0006" x="465" y="0" width="452" height="793" frameX="0" frameY="0" frameWidth="465" frameHeight="793"/>
<SubTexture name="Dad Sing Note RIGHT0007" x="465" y="0" width="452" height="793" frameX="0" frameY="0" frameWidth="465" frameHeight="793"/>
<SubTexture name="Dad Sing Note RIGHT0008" x="917" y="0" width="452" height="793" frameX="0" frameY="0" frameWidth="465" frameHeight="793"/>
<SubTexture name="Dad Sing Note RIGHT0009" x="917" y="0" width="452" height="793" frameX="0" frameY="0" frameWidth="465" frameHeight="793"/>
<SubTexture name="Dad Sing Note RIGHT0010" x="465" y="0" width="452" height="793" frameX="0" frameY="0" frameWidth="465" frameHeight="793"/>
<SubTexture name="Dad Sing Note RIGHT0011" x="465" y="0" width="452" height="793" frameX="0" frameY="0" frameWidth="465" frameHeight="793"/>
<SubTexture name="Dad Sing Note RIGHT0012" x="917" y="0" width="452" height="793" frameX="0" frameY="0" frameWidth="465" frameHeight="793"/>
<SubTexture name="Dad Sing Note RIGHT0013" x="917" y="0" width="452" height="793" frameX="0" frameY="0" frameWidth="465" frameHeight="793"/>
<SubTexture name="Dad Sing Note RIGHT0014" x="465" y="0" width="452" height="793" frameX="0" frameY="0" frameWidth="465" frameHeight="793"/>
<SubTexture name="Dad Sing Note RIGHT0015" x="465" y="0" width="452" height="793" frameX="0" frameY="0" frameWidth="465" frameHeight="793"/>
<SubTexture name="Dad Sing Note RIGHT0016" x="917" y="0" width="452" height="793" frameX="0" frameY="0" frameWidth="465" frameHeight="793"/>
<SubTexture name="Dad Sing Note RIGHT0017" x="917" y="0" width="452" height="793" frameX="0" frameY="0" frameWidth="465" frameHeight="793"/>
<SubTexture name="Dad Sing Note RIGHT0018" x="465" y="0" width="452" height="793" frameX="0" frameY="0" frameWidth="465" frameHeight="793"/>
<SubTexture name="Dad Sing Note UP0000" x="2301" y="0" width="408" height="818" frameX="-1" frameY="0" frameWidth="409" frameHeight="818"/>
<SubTexture name="Dad Sing Note UP0001" x="2301" y="0" width="408" height="818" frameX="-1" frameY="0" frameWidth="409" frameHeight="818"/>
<SubTexture name="Dad Sing Note UP0002" x="2709" y="0" width="408" height="810" frameX="0" frameY="-8" frameWidth="409" frameHeight="818"/>
<SubTexture name="Dad Sing Note UP0003" x="2709" y="0" width="408" height="810" frameX="0" frameY="-8" frameWidth="409" frameHeight="818"/>
<SubTexture name="Dad Sing Note UP0004" x="3117" y="0" width="408" height="810" frameX="0" frameY="-8" frameWidth="409" frameHeight="818"/>
<SubTexture name="Dad idle dance0000" x="1369" y="730" width="419" height="767" frameX="-6" frameY="0" frameWidth="429" frameHeight="767"/>
<SubTexture name="Dad idle dance0001" x="1369" y="730" width="419" height="767" frameX="-6" frameY="0" frameWidth="429" frameHeight="767"/>
<SubTexture name="Dad idle dance0002" x="3525" y="0" width="429" height="759" frameX="0" frameY="-8" frameWidth="429" frameHeight="767"/>
<SubTexture name="Dad idle dance0003" x="3525" y="0" width="429" height="759" frameX="0" frameY="-8" frameWidth="429" frameHeight="767"/>
<SubTexture name="Dad idle dance0004" x="0" y="792" width="424" height="757" frameX="-2" frameY="-10" frameWidth="429" frameHeight="767"/>
<SubTexture name="Dad idle dance0005" x="0" y="792" width="424" height="757" frameX="-2" frameY="-10" frameWidth="429" frameHeight="767"/>
<SubTexture name="Dad idle dance0006" x="3525" y="759" width="423" height="759" frameX="-3" frameY="-8" frameWidth="429" frameHeight="767"/>
<SubTexture name="Dad idle dance0007" x="3525" y="759" width="423" height="759" frameX="-3" frameY="-8" frameWidth="429" frameHeight="767"/>
<SubTexture name="Dad idle dance0008" x="424" y="793" width="419" height="766" frameX="-5" frameY="-1" frameWidth="429" frameHeight="767"/>
<SubTexture name="Dad idle dance0009" x="424" y="793" width="419" height="766" frameX="-5" frameY="-1" frameWidth="429" frameHeight="767"/>
<SubTexture name="Dad idle dance0010" x="1788" y="735" width="419" height="767" frameX="-6" frameY="0" frameWidth="429" frameHeight="767"/>
<SubTexture name="Dad idle dance0011" x="1788" y="735" width="419" height="767" frameX="-6" frameY="0" frameWidth="429" frameHeight="767"/>
<SubTexture name="Dad idle dance0012" x="1369" y="730" width="419" height="767" frameX="-6" frameY="0" frameWidth="429" frameHeight="767"/>
</TextureAtlas>

BIN
assets/music/Fresh.mp3 Normal file

Binary file not shown.

BIN
assets/music/Fresh_Inst.mp3 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -20,16 +20,11 @@ class Boyfriend extends Character
animation.addByPrefix('hey', 'BF HEY', 24, false);
playAnim('idle');
addOffset('idle');
addOffset("singUP", -28, 27);
addOffset('idle', -5);
addOffset("singUP", -29, 27);
addOffset("singRIGHT", -38, -7);
addOffset("singLEFT", 12, -6);
addOffset("singDOWN", -14, -50);
addOffset("hey", 1, 6);
}
override function update(elapsed:Float)
{
super.update(elapsed);
addOffset("singDOWN", -10, -50);
addOffset("hey", 7, 4);
}
}

View File

@ -11,7 +11,7 @@ class ChartParser
var IMG_WIDTH:Int = 8;
var regex:EReg = new EReg("[ \t]*((\r\n)|\r|\n)[ \t]*", "g");
var csvData = FlxStringUtil.imageToCSV('assets/data/' + songName + '/section' + section + '.png');
var csvData = FlxStringUtil.imageToCSV('assets/data/' + songName + '/' + songName + '_section' + section + '.png');
var lines:Array<String> = regex.split(csvData);
var rows:Array<String> = lines.filter(function(line) return line != "");

View File

@ -7,6 +7,7 @@ import flixel.FlxState;
import flixel.addons.display.FlxGridOverlay;
import flixel.group.FlxGroup.FlxTypedGroup;
import flixel.text.FlxText;
import flixel.util.FlxColor;
/**
*DEBUG MODE
@ -83,6 +84,7 @@ class Charting extends FlxState
{
var text:FlxText = new FlxText(10, 20 + (18 * daLoop), 0, anim + ": " + offsets, 15);
text.scrollFactor.set();
text.color = FlxColor.BLUE;
dumbTexts.add(text);
if (pushList)

View File

@ -16,4 +16,12 @@ class Conductor
public static var safeZoneOffset:Float = (safeFrames / 60) * 1000; // is calculated in create(), is safeFrames in milliseconds
public function new() {}
public static function changeBPM(newBpm:Int)
{
bpm = newBpm;
crochet = ((60 / bpm) * 1000);
stepCrochet = crochet / 4;
}
}

View File

@ -11,14 +11,14 @@ class Dad extends Character
frames = dadTex;
animation.addByPrefix('idle', 'Dad idle dance', 24);
animation.addByPrefix('singUP', 'Dad Sing Note UP', 24);
animation.addByPrefix('singRIGHT', 'Dad Sing Note UP', 24);
animation.addByPrefix('singRIGHT', 'Dad Sing Note RIGHT', 24);
animation.addByPrefix('singDOWN', 'Dad Sing Note DOWN', 24);
animation.addByPrefix('singLEFT', 'Dad Sing Note RIGHT', 24);
animation.addByPrefix('singLEFT', 'Dad Sing Note LEFT', 24);
playAnim('idle');
addOffset('idle');
addOffset("singUP", -6, 50);
addOffset("singRIGHT", -6, 50);
addOffset("singRIGHT", 0, 27);
addOffset("singLEFT", -10, 10);
addOffset("singDOWN", 0, -30);
}

View File

@ -42,6 +42,7 @@ class PlayState extends FlxState
private var curSection:Int = 0;
private var sectionScores:Array<Dynamic> = [[], []];
private var sectionLengths:Array<Int> = [];
private var camFollow:FlxObject;
private var strumLineNotes:FlxTypedGroup<FlxSprite>;
@ -68,7 +69,7 @@ class PlayState extends FlxState
playerStrums = new FlxTypedGroup<FlxSprite>();
generateSong('assets/data/bopeebo/bopeebo.json');
generateSong('assets/data/fresh/fresh.json');
canHitText = new FlxText(10, 10, 0, "weed");
@ -98,6 +99,7 @@ class PlayState extends FlxState
generateStaticArrows(1);
var songData = Json.parse(Assets.getText(dataPath));
Conductor.changeBPM(songData.bpm);
FlxG.sound.playMusic("assets/music/" + songData.song + "_Inst.mp3");
vocals = new FlxSound().loadEmbedded("assets/music/" + songData.song + "_Voices.mp3");
@ -119,21 +121,32 @@ class PlayState extends FlxState
while (playerCounter < 2)
{
var daBeats:Int = 0; // Not exactly representative of 'daBeats' lol, just how much it has looped
var totalLength:Int = 0; // Total length of the song, in beats;
for (section in noteData)
{
var dumbassSection:Array<Dynamic> = section;
var daStep:Int = 0;
var coolSection:Int = Std.int(section.length / 4);
if (coolSection <= 4) // FIX SINCE MOST THE SHIT I MADE WERE ONLY 3 HTINGS LONG LOl
coolSection = 4;
else if (coolSection <= 8)
coolSection = 8;
for (songNotes in dumbassSection)
{
sectionScores[0].push(0);
sectionScores[1].push(0);
trace('SECTON');
trace(daBeats);
trace(totalLength);
if (songNotes != 0)
{
var daStrumTime:Float = (((daStep * Conductor.stepCrochet) + (Conductor.crochet * 8 * daBeats))
+ ((Conductor.crochet * 4) * playerCounter));
var daStrumTime:Float = ((daStep * Conductor.stepCrochet) + (Conductor.crochet * 8 * totalLength))
+ ((Conductor.crochet * coolSection) * playerCounter);
var swagNote:Note = new Note(daStrumTime, songNotes);
swagNote.scrollFactor.set(0, 0);
@ -160,11 +173,16 @@ class PlayState extends FlxState
daStep += 1;
}
// only need to do it once
if (playerCounter == 0)
sectionLengths.push(Math.round(coolSection / 4));
totalLength += Math.round(coolSection / 4);
daBeats += 1;
}
playerCounter += 1;
}
trace(sectionLengths);
}
private function generateStaticArrows(player:Int):Void
@ -237,9 +255,9 @@ class PlayState extends FlxState
FlxG.switchState(new Charting(true));
Conductor.songPosition = FlxG.sound.music.time;
var playerTurn:Int = totalBeats % 8;
var playerTurn:Int = totalBeats % (sectionLengths[curSection] * 8);
if (playerTurn == 7 && !sectionScored)
if (playerTurn == (sectionLengths[curSection] * 8) - 1 && !sectionScored)
{
popUpScore();
sectionScored = true;
@ -251,7 +269,7 @@ class PlayState extends FlxState
vocals.volume = 1;
}
if (playerTurn == 4)
if (playerTurn == Std.int((sectionLengths[curSection] * 8) / 2))
{
camFollow.setPosition(boyfriend.getGraphicMidpoint().x - 100, boyfriend.getGraphicMidpoint().y - 100);
}