This commit is contained in:
Cameron Taylor 2020-10-23 16:12:38 -07:00
parent 4d7fc18fc4
commit 99b51a3f03
6 changed files with 132 additions and 81 deletions

View file

@ -6,7 +6,9 @@ All notable changes will be documented in this file.
- 32bit support
- Controller (dancepads) support
- Pause screen
- Main Menu overhaul
- Cool intro screen thing
## [1.0.0] - 2020-10-05
## [0.1.0] - 2020-10-05
### Added
- Uh, everything. This the game's initial gamejam release. We put it out

View file

@ -21,13 +21,14 @@ class AnimationDebug extends FlxState
var dumbTexts:FlxTypedGroup<FlxText>;
var animList:Array<String> = [];
var curAnim:Int = 0;
var isDad:Bool = false;
var isDad:Bool = true;
var daAnim:String = 'spooky';
var camFollow:FlxObject;
public function new(isDad:Bool = false)
public function new(daAnim:String = 'spooky')
{
super();
this.isDad = isDad;
this.daAnim = daAnim;
}
override function create()
@ -40,7 +41,7 @@ class AnimationDebug extends FlxState
if (isDad)
{
dad = new Character(0, 0);
dad = new Character(0, 0, daAnim);
dad.screenCenter();
dad.debugMode = true;
add(dad);

View file

@ -39,14 +39,14 @@ class Character extends FlxSprite
animation.addByIndices('danceRight', 'GF Dancing Beat', [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], "", 24, false);
addOffset('cheer');
addOffset('sad');
addOffset('danceLeft');
addOffset('danceRight');
addOffset('sad', -2, -2);
addOffset('danceLeft', 0, -9);
addOffset('danceRight', 0, -9);
addOffset("singUP");
addOffset("singRIGHT");
addOffset("singLEFT");
addOffset("singDOWN");
addOffset("singUP", 0, 4);
addOffset("singRIGHT", 0, -20);
addOffset("singLEFT", 0, -19);
addOffset("singDOWN", 0, -20);
playAnim('danceRight');
@ -66,6 +66,25 @@ class Character extends FlxSprite
addOffset("singRIGHT", 0, 27);
addOffset("singLEFT", -10, 10);
addOffset("singDOWN", 0, -30);
case 'spooky':
tex = FlxAtlasFrames.fromSparrow(AssetPaths.spooky_kids_assets__png, AssetPaths.spooky_kids_assets__xml);
frames = tex;
animation.addByPrefix('singUP', 'spooky UP NOTE', 24, false);
animation.addByPrefix('singDOWN', 'spooky DOWN note', 24, false);
animation.addByPrefix('singLEFT', 'note sing left', 24, false);
animation.addByPrefix('singRIGHT', 'spooky sing right', 24, false);
animation.addByIndices('danceLeft', 'spooky dance idle', [16, 0, 2, 6], "", 12, false);
animation.addByIndices('danceRight', 'spooky dance idle', [8, 10, 12, 14], "", 12, false);
addOffset('danceLeft');
addOffset('danceRight');
addOffset("singUP", -20, 26);
addOffset("singRIGHT", -130, -14);
addOffset("singLEFT", 130, -10);
addOffset("singDOWN", -50, -130);
playAnim('danceRight');
}
}
@ -81,6 +100,13 @@ class Character extends FlxSprite
case 'gf':
danced = !danced;
if (danced)
playAnim('danceRight');
else
playAnim('danceLeft');
case 'spooky':
danced = !danced;
if (danced)
playAnim('danceRight');
else

View file

@ -153,15 +153,15 @@ class ChartingState extends MusicBeatState
loadJson(_song.song.toLowerCase());
});
var stepperSpeed:FlxUINumericStepper = new FlxUINumericStepper(10, 80, 0.1, 1, 0.1, 10, 1, null);
var stepperSpeed:FlxUINumericStepper = new FlxUINumericStepper(10, 80, 0.1, 1, 0.1, 10, 1);
stepperSpeed.value = _song.speed;
stepperSpeed.name = 'song_speed';
var stepperBPM:FlxUINumericStepper = new FlxUINumericStepper(10, 65, 1, 1, 1, 250, 0, null);
var stepperBPM:FlxUINumericStepper = new FlxUINumericStepper(10, 65, 1, 1, 1, 250, 0);
stepperBPM.value = Conductor.bpm;
stepperBPM.name = 'song_bpm';
var characters:Array<String> = ["bf", 'dad', 'gf'];
var characters:Array<String> = ["bf", 'dad', 'gf', 'spooky'];
var player1DropDown = new FlxUIDropDownMenu(10, 100, FlxUIDropDownMenu.makeStrIdLabelArray(characters, true), function(character:String)
{

View file

@ -61,7 +61,7 @@ class PlayState extends MusicBeatState
private var healthBar:FlxBar;
private var generatedMusic:Bool = false;
private var countingDown:Bool = false;
private var startingSong:Bool = false;
private var healthHeads:FlxSprite;
@ -111,10 +111,13 @@ class PlayState extends MusicBeatState
dad = new Character(100, 100, SONG.player2);
add(dad);
if (SONG.player2 == 'gf')
switch (SONG.player2)
{
dad.setPosition(gf.x, gf.y);
gf.visible = false;
case 'gf':
dad.setPosition(gf.x, gf.y);
gf.visible = false;
case "spooky":
dad.y += 200;
}
boyfriend = new Boyfriend(770, 450);
@ -130,13 +133,59 @@ class PlayState extends MusicBeatState
playerStrums = new FlxTypedGroup<FlxSprite>();
var swagCounter:Int = 0;
startingSong = true;
startCountdown();
generateSong(SONG.song);
countingDown = true;
// add(strumLine);
camFollow = new FlxObject(0, 0, 1, 1);
camFollow.setPosition(dad.getGraphicMidpoint().x, dad.getGraphicMidpoint().y);
add(camFollow);
FlxG.camera.follow(camFollow, LOCKON, 0.04);
// FlxG.camera.setScrollBounds(0, FlxG.width, 0, FlxG.height);
FlxG.camera.zoom = 1.05;
FlxG.worldBounds.set(0, 0, FlxG.width, FlxG.height);
FlxG.fixedTimestep = false;
healthBarBG = new FlxSprite(0, FlxG.height * 0.9).loadGraphic(AssetPaths.healthBar__png);
healthBarBG.screenCenter(X);
healthBarBG.scrollFactor.set();
add(healthBarBG);
healthBar = new FlxBar(healthBarBG.x + 4, healthBarBG.y + 4, RIGHT_TO_LEFT, Std.int(healthBarBG.width - 8), Std.int(healthBarBG.height - 8), this,
'health', 0, 2);
healthBar.scrollFactor.set();
healthBar.createFilledBar(0xFFFF0000, 0xFF66FF33);
// healthBar
add(healthBar);
healthHeads = new FlxSprite();
var headTex = FlxAtlasFrames.fromSparrow(AssetPaths.healthHeads__png, AssetPaths.healthHeads__xml);
healthHeads.frames = headTex;
healthHeads.animation.add('healthy', [0]);
healthHeads.animation.add('unhealthy', [1]);
healthHeads.y = healthBar.y - (healthHeads.height / 2);
healthHeads.scrollFactor.set();
healthHeads.antialiasing = true;
add(healthHeads);
super.create();
}
function startCountdown():Void
{
startedCountdown = true;
Conductor.songPosition = 0;
Conductor.songPosition -= Conductor.crochet * 5;
var swagCounter:Int = 0;
new FlxTimer().start(Conductor.crochet / 1000, function(tmr:FlxTimer)
{
switch (swagCounter)
@ -188,49 +237,11 @@ class PlayState extends MusicBeatState
swagCounter += 1;
// generateSong('fresh');
}, 5);
// add(strumLine);
camFollow = new FlxObject(0, 0, 1, 1);
camFollow.setPosition(dad.getGraphicMidpoint().x, dad.getGraphicMidpoint().y);
add(camFollow);
FlxG.camera.follow(camFollow, LOCKON, 0.04);
// FlxG.camera.setScrollBounds(0, FlxG.width, 0, FlxG.height);
FlxG.camera.zoom = 1.05;
FlxG.worldBounds.set(0, 0, FlxG.width, FlxG.height);
FlxG.fixedTimestep = false;
healthBarBG = new FlxSprite(0, FlxG.height * 0.9).loadGraphic(AssetPaths.healthBar__png);
healthBarBG.screenCenter(X);
healthBarBG.scrollFactor.set();
add(healthBarBG);
healthBar = new FlxBar(healthBarBG.x + 4, healthBarBG.y + 4, RIGHT_TO_LEFT, Std.int(healthBarBG.width - 8), Std.int(healthBarBG.height - 8), this,
'health', 0, 2);
healthBar.scrollFactor.set();
healthBar.createFilledBar(0xFFFF0000, 0xFF66FF33);
// healthBar
add(healthBar);
healthHeads = new FlxSprite();
var headTex = FlxAtlasFrames.fromSparrow(AssetPaths.healthHeads__png, AssetPaths.healthHeads__xml);
healthHeads.frames = headTex;
healthHeads.animation.add('healthy', [0]);
healthHeads.animation.add('unhealthy', [1]);
healthHeads.y = healthBar.y - (healthHeads.height / 2);
healthHeads.scrollFactor.set();
healthHeads.antialiasing = true;
add(healthHeads);
super.create();
}
function startSong():Void
{
countingDown = false;
startingSong = false;
FlxG.sound.playMusic("assets/music/" + SONG.song + "_Inst" + TitleState.soundExt);
vocals.play();
}
@ -458,6 +469,7 @@ class PlayState extends MusicBeatState
}
private var paused:Bool = false;
var startedCountdown:Bool = false;
override public function update(elapsed:Float)
{
@ -491,14 +503,16 @@ class PlayState extends MusicBeatState
/* if (FlxG.keys.justPressed.NINE)
FlxG.switchState(new Charting()); */
if (FlxG.keys.justPressed.EIGHT)
FlxG.switchState(new AnimationDebug(true));
FlxG.switchState(new AnimationDebug(SONG.player2));
if (countingDown)
if (startingSong)
{
Conductor.songPosition += FlxG.elapsed * 1000;
if (Conductor.songPosition >= 0)
startSong();
if (startedCountdown)
{
Conductor.songPosition += FlxG.elapsed * 1000;
if (Conductor.songPosition >= 0)
startSong();
}
}
else
Conductor.songPosition = FlxG.sound.music.time;
@ -941,6 +955,14 @@ class PlayState extends MusicBeatState
});
}
if (upR || leftR || rightR || downR)
{
if (boyfriend.animation.curAnim.name.startsWith('sing'))
{
boyfriend.playAnim('idle');
}
}
playerStrums.forEach(function(spr:FlxSprite)
{
switch (spr.ID)

View file

@ -39,7 +39,7 @@ class Song
var daSong:String = '';
var daSectionLengths:Array<Int> = [];
var rawJson = Assets.getText('assets/data/' + jsonInput + '/' + jsonInput + '.json').trim();
var rawJson = Assets.getText('assets/data/' + jsonInput.toLowerCase() + '/' + jsonInput.toLowerCase() + '.json').trim();
while (!rawJson.endsWith("}"))
{
@ -47,23 +47,23 @@ class Song
// LOL GOING THROUGH THE BULLSHIT TO CLEAN IDK WHATS STRANGE
}
trace(rawJson);
var songData:Song = Json.parse(rawJson).song;
// FIX THE CASTING ON WINDOWS/NATIVE
var songData:Song = Json.parse(rawJson).song; // Windows???
trace(songData);
// trace('LOADED FROM JSON: ' + songData.notes);
for (i in 0...songData.notes.length)
{
trace('LOADED FROM JSON: ' + songData.notes[i].sectionNotes);
// songData.notes[i].sectionNotes = songData.notes[i].sectionNotes
}
/*
daNotes = songData.notes;
daSong = songData.song;
daSections = songData.sections;
daBpm = songData.bpm;
daSectionLengths = songData.sectionLengths; */
for (i in 0...songData.notes.length)
{
trace('LOADED FROM JSON: ' + songData.notes[i].sectionNotes);
// songData.notes[i].sectionNotes = songData.notes[i].sectionNotes
}
daNotes = songData.notes;
daSong = songData.song;
daSections = songData.sections;
daBpm = songData.bpm;
daSectionLengths = songData.sectionLengths; */
return songData;
}