Merge pull request #3 from ninjamuffin99/master

merge changes 3
This commit is contained in:
Lotusotho 2021-02-04 22:29:12 +01:00 committed by GitHub
commit 6552b2d132
44 changed files with 2841 additions and 346 deletions

32
.github/ISSUE_TEMPLATE/bug.md vendored Normal file
View file

@ -0,0 +1,32 @@
---
name: Bug Report
about: Report a bug or critical performance issue
title: 'Bug Report: '
labels: bug
---
# Please check for duplicates or similar issues, as well performing simple troubleshooting steps (such as clearing cookies, clearing AppData, trying another browser) before submitting an issue.
## Where are you playing the game?
### Web
- [ ] [Newgrounds](https://www.newgrounds.com/portal/view/770371)
- [ ] [Itch.io](https://ninja-muffin24.itch.io/funkin)
#### If you are using a web build, what browser are you using?
- [ ] Chrome, or a Chromium based broswer (Edge, Opera, etc.)
- [ ] Firefox, or a Gecko based broswer
- [ ] Safari
- [ ] Other, please specify:
### Local
- [ ] Windows x86
- [ ] Windows x86_64
- [ ] Linux
- [ ] macOS
## What version of the game are you using? Look in the bottom left corner of the main menu.
## Have you identified any steps to reproduce the bug? If so, please describe them below. Use images if possible.
## Please describe your issue. Provide extensive detail and images if possibe.

10
.github/ISSUE_TEMPLATE/enhancement.md vendored Normal file
View file

@ -0,0 +1,10 @@
---
name: Enhancement
about: Suggest a new feature
title: 'Enhancement: '
labels: enhancement
---
# Please check for duplicates or similar issues before creating this issue.
## What is your suggestion, and why should it be implemented?

10
.github/ISSUE_TEMPLATE/question.md vendored Normal file
View file

@ -0,0 +1,10 @@
---
name: Question
about: Ask a general question
title: 'Question: '
labels: question
---
# Please check for duplicates or similar issues before asking your question.
## What is your question?

12
.github/PULL_REQUEST_TEMPLATE/bug.md vendored Normal file
View file

@ -0,0 +1,12 @@
---
name: Bug Fix
about: Fix a bug or critical performance issue
title: 'Bug Fix: '
labels: bug
---
# Please check for duplicates or similar PRs before creating this issue.
## Does this PR close any issue(s)? If so, link them below.
## Breifly describe the issue(s) fixed.

View file

@ -0,0 +1,12 @@
---
name: Enhancement
about: Add a new feature
title: 'Enhancement: '
labels: enhancement
---
# Please check for duplicates or similar PRs before creating this issue.
## Does this PR close any issue(s)? If so, link them below.
## What do your change(s) add, and why should they be implemented?

View file

@ -1,10 +1,10 @@
name: learn-github-actions
on: [push]
jobs:
check-bats-version:
runs-on: ubuntu-latest
build:
runs-on: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- run: npm install -g bats
- run: bats -v
- uses: krdlab/setup-haxe@v1
with:
haxe-version: 4.0.5
- run: |
haxe -version
haxelib install hxnodejs

View file

@ -4,8 +4,53 @@ All notable changes will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [UNRELEASED]
## [0.2.7] - 2021-02-02
### Added
- PIXEL DAY UPDATE LOL 1 WEEK LATER
- 3 New songs by Kawaisprite!
- COOL CUTSCENES
- WEEK 6 YOYOYOYOY
- Swaggy pixel art by Moawling!
### Changed
- Made it so you lose sliiiightly more health when you miss a note.
- Removed the default HaxeFlixel pause screen when the game window loses focus, can get screenshots of the game easier hehehe
### Fixed
- Idle animation bug with BF christmas and BF hair blow sprites ([Thanks to Injourn for the Pull Request!](https://github.com/ninjamuffin99/Funkin/pull/237))
## [0.2.6] - 2021-01-20
### Added
- 3 NEW CHRISTMAS SONGS. 2 BY KAWAISPRITE, 1 BY BASSETFILMS!!!!! BF WITH DRIP! SANTA HANGIN OUT!
- Enemy icons change when they you are winning a lot ([Thanks to pahaze for the Pull Request!](https://github.com/ninjamuffin99/Funkin/pull/138))
- Holding CTRL in charting editor places notes on both sides
- Q and E changes sustain lengths in note editor
- Other charting editor workflow improvements
- More hair physics
- Heads appear at top of chart editor to help show which side ur charting for
### Changed
- Tweaked code relating to inputs, hopefully making notes that are close together more fair to hit
### Removed
- Removed APE
### Fixed
- Maybe fixed double notes / jump notes. Need to tweak it for balance, but should open things up for cooler charts in the future.
- Old Verison popup screen weirdness ([Thanks to gedehari for the Pull Request!](https://github.com/ninjamuffin99/Funkin/pull/155))
- Song no longer loops when finishing the song. ([Thanks Injourn for the Pull Request!](https://github.com/ninjamuffin99/Funkin/pull/132))
- Screen wipe being cut off in the limo/mom stage. Should fill the whole screen now.
- Boyfriend animations on hold notes, and pressing on repeating notes should behave differently
## [0.2.5] - 2020-12-27
### Added
- MOMMY GF, 3 NEW ASS SONGS BY KAWAISPRITE, NEW ART BY PHANTOMARCADE,WOOOOOOAH!!!!
- Different icons depending on which character you are against, art by EVILSK8R!!
- Autosave to chart editor
- Clear section button to note editor
- Swap button in note editor
- a new boot text or two
- automatic check for when you're on an old version of the game!
### Changed
- Made Spookeez on Normal easier.
- Mouse is now visible in note editor
### Fixed
- Crash when playing Week 3 and then playing a non-week 3 song
- When pausing music at the start, it doesn't continue the song anyways. ([shoutouts gedehari for the Pull Request!](https://github.com/ninjamuffin99/Funkin/pull/48))
- IDK i think backing out of song menu should play main menu songs again hehe ([shoutouts gedehari for the Pull Request!](https://github.com/ninjamuffin99/Funkin/pull/48))

13
Modding.md Normal file
View file

@ -0,0 +1,13 @@
# RIGHT NOW THE MODS FOLDER DOES NOT WORK ENTIRELY JUST YET!!!
## THIS IS WORK IN PROGRESS!!!
# QUICK AND DIRTY MOD GUIDE
With the 0.2.6 update, I added a bit of a slightly nicer mod support backend.
It's POLYMOD, which is made by Lars Doucet: https://github.com/larsiusprime/polymod
You may have noticed that there's a new folder in the assets. MODS. Within it you will see 2 files. modList.txt, and a folder called introMod.
modList.txt will load any folder into the game. Put the folder you want to load into a new line in modList.txt, and reboot the game.
Now you may be wondering, what do I put in the folder? Well later down it'll get a bit more complicated, especially as I'll make the IN-GAME mod loader nicer.

View file

@ -2,7 +2,7 @@
<project>
<!-- _________________________ Application Settings _________________________ -->
<app title="Friday Night Funkin" file="Funkin" packageName="com.ninjamuffin99.funkin" main="Main" version="0.2.4.1" company="ninjamuffin99" />
<app title="Friday Night Funkin'" file="Funkin" packageName="com.ninjamuffin99.funkin" main="Main" version="0.2.7" company="ninjamuffin99" />
<!--Switch Export with Unique ApplicationID and Icon-->
<set name="APP_ID" value="0x0100f6c013bbc000" />
@ -24,7 +24,7 @@
<window if="html5" resizable="true" />
<!--Desktop-specific-->
<window if="desktop" orientation="landscape" fullscreen="false" resizable="true" />
<window if="desktop" orientation="landscape" fullscreen="false" resizable="true" vsync="false"/>
<!--Mobile-specific-->
<window if="mobile" orientation="landscape" fullscreen="true" width="0" height="0" />
@ -42,6 +42,8 @@
<assets path="assets/images" />
<assets path="assets/data" />
<assets path='example_mods' rename='mods' embed='false'/>
<!-- <template path='mods' /> -->
<!-- <library name="noPreload" preload='false'/> -->
<!-- <library name="noPreload"/> -->
@ -52,12 +54,16 @@
<assets path="CHANGELOG.md"/>
<assets path="assets/fonts/vcr.ttf" embed="true" />
<!-- NOTE FOR FUTURE SELF SINCE FONTS ARE ALWAYS FUCKY
TO FIX ONE OF THEM, I CONVERTED IT TO OTF. DUNNO IF YOU NEED TO
THEN UHHH I USED THE NAME OF THE FONT WITH SETFORMAT() ON THE TEXT!!!
NOT USING A DIRECT THING TO THE ASSET!!!
-->
<assets path="assets/fonts" embed='true'/>
<!-- _______________________________ Libraries ______________________________ -->
<haxelib name="flixel" />
<haxedev set='webgl' />
<!--In case you want to use the addons package-->
<haxelib name="flixel-addons" />
@ -67,6 +73,7 @@
<haxelib name="flixel-ui" />
<haxelib name="newgrounds"/>
<haxelib name="faxe" if='switch'/>
<haxelib name="polymod"/>
<!-- <haxelib name="markdown" /> -->
<!-- <haxelib name="HtmlParser" /> -->
@ -98,7 +105,7 @@
<!--<haxedef name="FLX_NO_SOUND_SYSTEM" />-->
<!--Disable the Flixel core focus lost screen-->
<!--<haxedef name="FLX_NO_FOCUS_LOST_SCREEN" />-->
<haxedef name="FLX_NO_FOCUS_LOST_SCREEN" />
<!--Disable the Flixel core debugger. Automatically gets set whenever you compile in release mode!-->
<haxedef name="FLX_NO_DEBUG" unless="debug" />

View file

@ -4,4 +4,89 @@ This is the repository for Friday Night Funkin, a game originally made for Ludum
Play the Ludum Dare prototype here: https://ninja-muffin24.itch.io/friday-night-funkin
Play the Newgrounds one here: https://www.newgrounds.com/portal/view/770371
Support the project on the itch.io page: https://ninja-muffin24.itch.io/funkin
Support the project on the itch.io page: https://ninja-muffin24.itch.io/funkin
## Credits / shoutouts
- [ninjamuffin99 (me!)](https://twitter.com/ninja_muffin99) - Programmer
- [PhantomArcade3K](https://twitter.com/phantomarcade3k) and [Evilsk8r](https://twitter.com/evilsk8r) - Art
- [Kawaisprite](https://twitter.com/kawaisprite) - Musician
This game was made with love to Newgrounds and it's community. Extra love to Tom Fulp.
## Build instructions
THESE INSTRUCTIONS ARE FOR COMPILING THE GAME'S SOURCE CODE!!!
IF YOU WANT TO JUST DOWNLOAD AND INSTALL AND PLAY THE GAME NORMALLY, GO TO ITCH.IO TO DOWNLOAD THE GAME FOR PC, MAC, AND LINUX!!
https://ninja-muffin24.itch.io/friday-night-funkin
IF YOU WANT TO COMPILE THE GAME YOURSELF, CONTINUE READING!!!
### Installing shit
First you need to install Haxe and HaxeFlixel. I'm too lazy to write and keep updated with that setup (which is pretty simple).
The link to that is on the [HaxeFlixel website](https://haxeflixel.com/documentation/getting-started/)
Other installations you'd need is the additional libraries, a fully updated list will be in `Project.xml` in the project root, but here are the one's I'm using as of writing.
```
hscript
flixel-ui
newgrounds
```
So for each of those type `haxelib install [library]` so shit like `haxelib install newgrounds`
You'll also need to install polymod. Do this with
```
haxelib git polymod https://github.com/larsiusprime/polymod.git
```
### Ignored files
I gitignore the API keys for the game, so that no one can nab them and post fake highscores on the leaderboards. But because of that the game
doesn't compile without it.
Just make a file in `/source` and call it `APIStuff.hx`, and copy paste this into it
```haxe
package;
class APIStuff
{
public static var API:String = "";
public static var EncKey:String = "";
}
```
and you should be good to go there.
### Compiling game
Once you have all those installed, it's pretty easy to compile the game. You just need to run 'lime test html5 -debug' in the root of the project to build and run the HTML5 version. (command prompt navigation guide can be found here: [https://ninjamuffin99.newgrounds.com/news/post/1090480](https://ninjamuffin99.newgrounds.com/news/post/1090480))
To run it from your desktop (Windows, Mac, Linux) it can be a bit more involved. For Linux, you only need to open a terminal in the project directory and run 'lime test linux -debug' and then run the executible file in export/release/linux/bin. For Windows, you need to install Visual Studio Community 2019. While installing VSC, don't click on any of the options to install workloads. Instead, go to the individual components tab and choose the following:
* MSVC v142 - VS 2019 C++ x64/x86 build tools
* Windows SDK (10.0.17763.0)
* C++ Profiling tools
* C++ CMake tools for windows
* C++ ATL for v142 build tools (x86 & x64)
* C++ MFC for v142 build tools (x86 & x64)
* C++/CLI support for v142 build tools (14.21)
* C++ Modules for v142 build tools (x64/x86)
* Clang Compiler for Windows
* Windows 10 SDK (10.0.17134.0)
* Windows 10 SDK (10.0.16299.0)
* MSVC v141 - VS 2017 C++ x64/x86 build tools
* MSVC v140 - VS 2015 C++ build tools (v14.00)
This will install about 22GB of crap, but once that is done you can open up a command line in the project's directory and run `lime test windows -debug`. Once that command finishes (it takes forever even on a higher end PC), you can run FNF from the .exe file under export\release\windows\bin
As for Mac, 'lime test mac -debug' should work, if not the internet surely has a guide on how to compile Haxe stuff for Mac.
### Additional guides
- [Command line basics](https://ninjamuffin99.newgrounds.com/news/post/1090480)

View file

@ -0,0 +1 @@
swagshit--moneymoney

1
example_mods/modList.txt Normal file
View file

@ -0,0 +1 @@
introMod

2
example_mods/readme.txt Normal file
View file

@ -0,0 +1,2 @@
THIS MOD FOLDER DOES NOT ENTIRELY WORK JUST YET!!!
DONT EXPECT MUCH OUT OF IT RIGHT NOW!!!

View file

@ -48,7 +48,6 @@ class Alphabet extends FlxSpriteGroup
this.text = text;
isBold = bold;
if (text != "")
{
if (typed)
@ -73,13 +72,13 @@ class Alphabet extends FlxSpriteGroup
// {
// }
if (character == " ")
if (character == " " || character == "-")
{
lastWasSpace = true;
}
if (AlphaCharacter.alphabet.indexOf(character.toLowerCase()) != -1)
//if (AlphaCharacter.alphabet.contains(character.toLowerCase()))
// if (AlphaCharacter.alphabet.contains(character.toLowerCase()))
{
if (lastSprite != null)
{
@ -123,7 +122,6 @@ class Alphabet extends FlxSpriteGroup
_finalText = text;
doSplitWords();
// trace(arrayShit);
var loopNum:Int = 0;
@ -140,7 +138,6 @@ class Alphabet extends FlxSpriteGroup
xPosResetted = true;
xPos = 0;
curRow += 1;
}
if (splitWords[loopNum] == " ")
@ -157,7 +154,7 @@ class Alphabet extends FlxSpriteGroup
#end
if (AlphaCharacter.alphabet.indexOf(splitWords[loopNum].toLowerCase()) != -1 || isNumber || isSymbol)
//if (AlphaCharacter.alphabet.contains(splitWords[loopNum].toLowerCase()) || isNumber || isSymbol)
// if (AlphaCharacter.alphabet.contains(splitWords[loopNum].toLowerCase()) || isNumber || isSymbol)
{
if (lastSprite != null && !xPosResetted)
@ -248,7 +245,7 @@ class AlphaCharacter extends FlxSprite
public function new(x:Float, y:Float)
{
super(x, y);
var tex = FlxAtlasFrames.fromSparrow(AssetPaths.alphabet__png, AssetPaths.alphabet__xml);
var tex = FlxAtlasFrames.fromSparrow('assets/images/alphabet.png', 'assets/images/alphabet.xml');
frames = tex;
antialiasing = true;

View file

@ -50,6 +50,7 @@ class AnimationDebug extends FlxState
add(dad);
char = dad;
dad.flipX = false;
}
else
{
@ -59,6 +60,7 @@ class AnimationDebug extends FlxState
add(bf);
char = bf;
bf.flipX = false;
}
dumbTexts = new FlxTypedGroup<FlxText>();

View file

@ -1,4 +0,0 @@
package;
@:build(flixel.system.FlxAssets.buildFileReferences("assets", true))
class AssetPaths {}

View file

@ -0,0 +1,30 @@
package;
import flixel.FlxSprite;
import flixel.graphics.frames.FlxAtlasFrames;
class BackgroundDancer extends FlxSprite
{
public function new(x:Float, y:Float)
{
super(x, y);
frames = FlxAtlasFrames.fromSparrow("assets/images/limo/limoDancer.png", "assets/images/limo/limoDancer.xml");
animation.addByIndices('danceLeft', 'bg dancer sketch PINK', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], "", 24, false);
animation.addByIndices('danceRight', 'bg dancer sketch PINK', [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], "", 24, false);
animation.play('danceLeft');
antialiasing = true;
}
var danceDir:Bool = false;
public function dance():Void
{
danceDir = !danceDir;
if (danceDir)
animation.play('danceRight', true);
else
animation.play('danceLeft', true);
}
}

39
source/BackgroundGirls.hx Normal file
View file

@ -0,0 +1,39 @@
package;
import flixel.FlxSprite;
import flixel.graphics.frames.FlxAtlasFrames;
class BackgroundGirls extends FlxSprite
{
public function new(x:Float, y:Float)
{
super(x, y);
// BG fangirls dissuaded
frames = FlxAtlasFrames.fromSparrow('assets/images/weeb/bgFreaks.png', 'assets/images/weeb/bgFreaks.xml');
animation.addByIndices('danceLeft', 'BG girls group', CoolUtil.numberArray(14), "", 24, false);
animation.addByIndices('danceRight', 'BG girls group', CoolUtil.numberArray(30, 15), "", 24, false);
animation.play('danceLeft');
}
var danceDir:Bool = false;
public function getScared():Void
{
animation.addByIndices('danceLeft', 'BG fangirls dissuaded', CoolUtil.numberArray(14), "", 24, false);
animation.addByIndices('danceRight', 'BG fangirls dissuaded', CoolUtil.numberArray(30, 15), "", 24, false);
dance();
}
public function dance():Void
{
danceDir = !danceDir;
if (danceDir)
animation.play('danceRight', true);
else
animation.play('danceLeft', true);
}
}

34
source/BlendModeEffect.hx Normal file
View file

@ -0,0 +1,34 @@
package;
import flixel.util.FlxColor;
import openfl.display.ShaderParameter;
typedef BlendModeShader =
{
var uBlendColor:ShaderParameter<Float>;
}
class BlendModeEffect
{
public var shader(default, null):BlendModeShader;
@:isVar
public var color(default, set):FlxColor;
public function new(shader:BlendModeShader, color:FlxColor):Void
{
shader.uBlendColor.value = [];
this.shader = shader;
this.color = color;
}
function set_color(color:FlxColor):FlxColor
{
shader.uBlendColor.value[0] = color.redFloat;
shader.uBlendColor.value[1] = color.greenFloat;
shader.uBlendColor.value[2] = color.blueFloat;
shader.uBlendColor.value[3] = color.alphaFloat;
return this.color = color;
}
}

View file

@ -11,28 +11,31 @@ class Boyfriend extends Character
{
public var stunned:Bool = false;
public function new(x:Float, y:Float)
public function new(x:Float, y:Float, ?char:String = 'bf')
{
super(x, y);
super(x, y, char, true);
}
override function update(elapsed:Float)
{
if (animation.curAnim.name.startsWith('sing'))
if (!debugMode)
{
holdTimer += elapsed;
}
else
holdTimer = 0;
if (animation.curAnim.name.startsWith('sing'))
{
holdTimer += elapsed;
}
else
holdTimer = 0;
if (animation.curAnim.name.endsWith('miss') && animation.curAnim.finished && !debugMode)
{
playAnim('idle', true, false, 10);
}
if (animation.curAnim.name.endsWith('miss') && animation.curAnim.finished && !debugMode)
{
playAnim('idle', true, false, 10);
}
if (animation.curAnim.name == 'firstDeath' && animation.curAnim.finished)
{
playAnim('deathLoop');
if (animation.curAnim.name == 'firstDeath' && animation.curAnim.finished)
{
playAnim('deathLoop');
}
}
super.update(elapsed);

View file

@ -31,7 +31,7 @@ class Character extends FlxSprite
{
case 'gf':
// GIRLFRIEND CODE
tex = FlxAtlasFrames.fromSparrow(AssetPaths.GF_assets__png, AssetPaths.GF_assets__xml);
tex = FlxAtlasFrames.fromSparrow('assets/images/GF_assets.png', 'assets/images/GF_assets.xml');
frames = tex;
animation.addByPrefix('cheer', 'GF Cheer', 24, false);
animation.addByPrefix('singLEFT', 'GF left note', 24, false);
@ -61,24 +61,85 @@ class Character extends FlxSprite
playAnim('danceRight');
case 'gf-christmas':
tex = FlxAtlasFrames.fromSparrow('assets/images/christmas/gfChristmas.png', 'assets/images/christmas/gfChristmas.xml');
frames = tex;
animation.addByPrefix('cheer', 'GF Cheer', 24, false);
animation.addByPrefix('singLEFT', 'GF left note', 24, false);
animation.addByPrefix('singRIGHT', 'GF Right Note', 24, false);
animation.addByPrefix('singUP', 'GF Up Note', 24, false);
animation.addByPrefix('singDOWN', 'GF Down Note', 24, false);
animation.addByIndices('sad', 'gf sad', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], "", 24, false);
animation.addByIndices('danceLeft', 'GF Dancing Beat', [30, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], "", 24, false);
animation.addByIndices('danceRight', 'GF Dancing Beat', [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], "", 24, false);
animation.addByIndices('hairBlow', "GF Dancing Beat Hair blowing", [0, 1, 2, 3], "", 24);
animation.addByIndices('hairFall', "GF Dancing Beat Hair Landing", [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], "", 24, false);
animation.addByPrefix('scared', 'GF FEAR', 24);
addOffset('cheer');
addOffset('sad', -2, -2);
addOffset('danceLeft', 0, -9);
addOffset('danceRight', 0, -9);
addOffset("singUP", 0, 4);
addOffset("singRIGHT", 0, -20);
addOffset("singLEFT", 0, -19);
addOffset("singDOWN", 0, -20);
addOffset('hairBlow', 45, -8);
addOffset('hairFall', 0, -9);
addOffset('scared', -2, -17);
playAnim('danceRight');
case 'gf-car':
tex = FlxAtlasFrames.fromSparrow('assets/images/gfCar.png', 'assets/images/gfCar.xml');
frames = tex;
animation.addByIndices('singUP', 'GF Dancing Beat Hair blowing CAR', [0], "", 24, false);
animation.addByIndices('danceLeft', 'GF Dancing Beat Hair blowing CAR', [30, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], "", 24, false);
animation.addByIndices('danceRight', 'GF Dancing Beat Hair blowing CAR', [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], "", 24,
false);
addOffset('danceLeft', 0);
addOffset('danceRight', 0);
playAnim('danceRight');
case 'gf-pixel':
tex = FlxAtlasFrames.fromSparrow('assets/images/weeb/gfPixel.png', 'assets/images/weeb/gfPixel.xml');
frames = tex;
animation.addByIndices('singUP', 'GF IDLE', [2], "", 24, false);
animation.addByIndices('danceLeft', 'GF IDLE', [30, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], "", 24, false);
animation.addByIndices('danceRight', 'GF IDLE', [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], "", 24, false);
addOffset('danceLeft', 0);
addOffset('danceRight', 0);
playAnim('danceRight');
setGraphicSize(Std.int(width * PlayState.daPixelZoom));
updateHitbox();
antialiasing = false;
case 'dad':
// DAD ANIMATION LOADING CODE
tex = FlxAtlasFrames.fromSparrow(AssetPaths.DADDY_DEAREST__png, AssetPaths.DADDY_DEAREST__xml);
tex = FlxAtlasFrames.fromSparrow('assets/images/DADDY_DEAREST.png', 'assets/images/DADDY_DEAREST.xml');
frames = tex;
animation.addByPrefix('idle', 'Dad idle dance', 24);
animation.addByPrefix('singUP', '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 LEFT', 24);
playAnim('idle');
addOffset('idle');
addOffset("singUP", -6, 50);
addOffset("singRIGHT", 0, 27);
addOffset("singLEFT", -10, 10);
addOffset("singDOWN", 0, -30);
playAnim('idle');
case 'spooky':
tex = FlxAtlasFrames.fromSparrow(AssetPaths.spooky_kids_assets__png, AssetPaths.spooky_kids_assets__xml);
tex = FlxAtlasFrames.fromSparrow('assets/images/spooky_kids_assets.png', 'assets/images/spooky_kids_assets.xml');
frames = tex;
animation.addByPrefix('singUP', 'spooky UP NOTE', 24, false);
animation.addByPrefix('singDOWN', 'spooky DOWN note', 24, false);
@ -96,10 +157,49 @@ class Character extends FlxSprite
addOffset("singDOWN", -50, -130);
playAnim('danceRight');
case 'monster':
tex = FlxAtlasFrames.fromSparrow(AssetPaths.Monster_Assets__png, AssetPaths.Monster_Assets__xml);
case 'mom':
tex = FlxAtlasFrames.fromSparrow('assets/images/Mom_Assets.png', 'assets/images/Mom_Assets.xml');
frames = tex;
animation.addByPrefix('idle', 'monster idle', 24);
animation.addByPrefix('idle', "Mom Idle", 24, false);
animation.addByPrefix('singUP', "Mom Up Pose", 24, false);
animation.addByPrefix('singDOWN', "MOM DOWN POSE", 24, false);
animation.addByPrefix('singLEFT', 'Mom Left Pose', 24, false);
// ANIMATION IS CALLED MOM LEFT POSE BUT ITS FOR THE RIGHT
// CUZ DAVE IS DUMB!
animation.addByPrefix('singRIGHT', 'Mom Pose Left', 24, false);
addOffset('idle');
addOffset("singUP", 14, 71);
addOffset("singRIGHT", 10, -60);
addOffset("singLEFT", 250, -23);
addOffset("singDOWN", 20, -160);
playAnim('idle');
case 'mom-car':
tex = FlxAtlasFrames.fromSparrow('assets/images/momCar.png', 'assets/images/momCar.xml');
frames = tex;
animation.addByPrefix('idle', "Mom Idle", 24, false);
animation.addByPrefix('singUP', "Mom Up Pose", 24, false);
animation.addByPrefix('singDOWN', "MOM DOWN POSE", 24, false);
animation.addByPrefix('singLEFT', 'Mom Left Pose', 24, false);
// ANIMATION IS CALLED MOM LEFT POSE BUT ITS FOR THE RIGHT
// CUZ DAVE IS DUMB!
animation.addByPrefix('singRIGHT', 'Mom Pose Left', 24, false);
addOffset('idle');
addOffset("singUP", 14, 71);
addOffset("singRIGHT", 10, -60);
addOffset("singLEFT", 250, -23);
addOffset("singDOWN", 20, -160);
playAnim('idle');
case 'monster':
tex = FlxAtlasFrames.fromSparrow('assets/images/Monster_Assets.png', 'assets/images/Monster_Assets.xml');
frames = tex;
animation.addByPrefix('idle', 'monster idle', 24, false);
animation.addByPrefix('singUP', 'monster up note', 24, false);
animation.addByPrefix('singDOWN', 'monster down', 24, false);
animation.addByPrefix('singLEFT', 'Monster left note', 24, false);
@ -111,8 +211,23 @@ class Character extends FlxSprite
addOffset("singLEFT", -30);
addOffset("singDOWN", -30, -40);
playAnim('idle');
case 'monster-christmas':
tex = FlxAtlasFrames.fromSparrow('assets/images/christmas/monsterChristmas.png', 'assets/images/christmas/monsterChristmas.xml');
frames = tex;
animation.addByPrefix('idle', 'monster idle', 24, false);
animation.addByPrefix('singUP', 'monster up note', 24, false);
animation.addByPrefix('singDOWN', 'monster down', 24, false);
animation.addByPrefix('singLEFT', 'Monster left note', 24, false);
animation.addByPrefix('singRIGHT', 'Monster Right note', 24, false);
addOffset('idle');
addOffset("singUP", -20, 50);
addOffset("singRIGHT", -51);
addOffset("singLEFT", -30);
addOffset("singDOWN", -40, -94);
playAnim('idle');
case 'pico':
tex = FlxAtlasFrames.fromSparrow(AssetPaths.Pico_FNF_assetss__png, AssetPaths.Pico_FNF_assetss__xml);
tex = FlxAtlasFrames.fromSparrow('assets/images/Pico_FNF_assetss.png', 'assets/images/Pico_FNF_assetss.xml');
frames = tex;
animation.addByPrefix('idle', "Pico Idle Dance", 24);
animation.addByPrefix('singUP', 'pico Up note0', 24, false);
@ -136,7 +251,6 @@ class Character extends FlxSprite
animation.addByPrefix('singUPmiss', 'pico Up note miss', 24);
animation.addByPrefix('singDOWNmiss', 'Pico Down Note MISS', 24);
playAnim('idle');
addOffset('idle');
addOffset("singUP", -29, 27);
addOffset("singRIGHT", -68, -7);
@ -147,11 +261,12 @@ class Character extends FlxSprite
addOffset("singLEFTmiss", 62, 64);
addOffset("singDOWNmiss", 210, -28);
if (!isPlayer)
flipX = true;
playAnim('idle');
flipX = true;
case 'bf':
var tex = FlxAtlasFrames.fromSparrow(AssetPaths.BOYFRIEND__png, AssetPaths.BOYFRIEND__xml);
var tex = FlxAtlasFrames.fromSparrow('assets/images/BOYFRIEND.png', 'assets/images/BOYFRIEND.xml');
frames = tex;
animation.addByPrefix('idle', 'BF idle dance', 24, false);
animation.addByPrefix('singUP', 'BF NOTE UP0', 24, false);
@ -169,9 +284,6 @@ class Character extends FlxSprite
animation.addByPrefix('deathConfirm', "BF Dead confirm", 24, false);
animation.addByPrefix('scared', 'BF idle shaking', 24);
playAnim('idle');
antialiasing = true;
addOffset('idle', -5);
addOffset("singUP", -29, 27);
@ -187,12 +299,232 @@ class Character extends FlxSprite
addOffset('deathLoop', 37, 5);
addOffset('deathConfirm', 37, 69);
addOffset('scared', -4);
playAnim('idle');
flipX = true;
case 'bf-christmas':
var tex = FlxAtlasFrames.fromSparrow('assets/images/christmas/bfChristmas.png', 'assets/images/christmas/bfChristmas.xml');
frames = tex;
animation.addByPrefix('idle', 'BF idle dance', 24, false);
animation.addByPrefix('singUP', 'BF NOTE UP0', 24, false);
animation.addByPrefix('singLEFT', 'BF NOTE LEFT0', 24, false);
animation.addByPrefix('singRIGHT', 'BF NOTE RIGHT0', 24, false);
animation.addByPrefix('singDOWN', 'BF NOTE DOWN0', 24, false);
animation.addByPrefix('singUPmiss', 'BF NOTE UP MISS', 24, false);
animation.addByPrefix('singLEFTmiss', 'BF NOTE LEFT MISS', 24, false);
animation.addByPrefix('singRIGHTmiss', 'BF NOTE RIGHT MISS', 24, false);
animation.addByPrefix('singDOWNmiss', 'BF NOTE DOWN MISS', 24, false);
animation.addByPrefix('hey', 'BF HEY', 24, false);
addOffset('idle', -5);
addOffset("singUP", -29, 27);
addOffset("singRIGHT", -38, -7);
addOffset("singLEFT", 12, -6);
addOffset("singDOWN", -10, -50);
addOffset("singUPmiss", -29, 27);
addOffset("singRIGHTmiss", -30, 21);
addOffset("singLEFTmiss", 12, 24);
addOffset("singDOWNmiss", -11, -19);
addOffset("hey", 7, 4);
playAnim('idle');
flipX = true;
case 'bf-car':
var tex = FlxAtlasFrames.fromSparrow('assets/images/bfCar.png', 'assets/images/bfCar.xml');
frames = tex;
animation.addByPrefix('idle', 'BF idle dance', 24, false);
animation.addByPrefix('singUP', 'BF NOTE UP0', 24, false);
animation.addByPrefix('singLEFT', 'BF NOTE LEFT0', 24, false);
animation.addByPrefix('singRIGHT', 'BF NOTE RIGHT0', 24, false);
animation.addByPrefix('singDOWN', 'BF NOTE DOWN0', 24, false);
animation.addByPrefix('singUPmiss', 'BF NOTE UP MISS', 24, false);
animation.addByPrefix('singLEFTmiss', 'BF NOTE LEFT MISS', 24, false);
animation.addByPrefix('singRIGHTmiss', 'BF NOTE RIGHT MISS', 24, false);
animation.addByPrefix('singDOWNmiss', 'BF NOTE DOWN MISS', 24, false);
addOffset('idle', -5);
addOffset("singUP", -29, 27);
addOffset("singRIGHT", -38, -7);
addOffset("singLEFT", 12, -6);
addOffset("singDOWN", -10, -50);
addOffset("singUPmiss", -29, 27);
addOffset("singRIGHTmiss", -30, 21);
addOffset("singLEFTmiss", 12, 24);
addOffset("singDOWNmiss", -11, -19);
playAnim('idle');
flipX = true;
case 'bf-pixel':
frames = FlxAtlasFrames.fromSparrow('assets/images/weeb/bfPixel.png', 'assets/images/weeb/bfPixel.xml');
animation.addByPrefix('idle', 'BF IDLE', 24, false);
animation.addByPrefix('singUP', 'BF UP NOTE', 24, false);
animation.addByPrefix('singLEFT', 'BF LEFT NOTE', 24, false);
animation.addByPrefix('singRIGHT', 'BF RIGHT NOTE', 24, false);
animation.addByPrefix('singDOWN', 'BF DOWN NOTE', 24, false);
animation.addByPrefix('singUPmiss', 'BF UP MISS', 24, false);
animation.addByPrefix('singLEFTmiss', 'BF LEFT MISS', 24, false);
animation.addByPrefix('singRIGHTmiss', 'BF RIGHT MISS', 24, false);
animation.addByPrefix('singDOWNmiss', 'BF DOWN MISS', 24, false);
addOffset('idle');
addOffset("singUP");
addOffset("singRIGHT");
addOffset("singLEFT");
addOffset("singDOWN");
addOffset("singUPmiss");
addOffset("singRIGHTmiss");
addOffset("singLEFTmiss");
addOffset("singDOWNmiss");
setGraphicSize(Std.int(width * 6));
updateHitbox();
playAnim('idle');
width -= 100;
height -= 100;
antialiasing = false;
flipX = true;
case 'bf-pixel-dead':
frames = FlxAtlasFrames.fromSparrow('assets/images/weeb/bfPixelsDEAD.png', 'assets/images/weeb/bfPixelsDEAD.xml');
animation.addByPrefix('singUP', "BF Dies pixel", 24, false);
animation.addByPrefix('firstDeath', "BF Dies pixel", 24, false);
animation.addByPrefix('deathLoop', "Retry Loop", 24, true);
animation.addByPrefix('deathConfirm', "RETRY CONFIRM", 24, false);
animation.play('firstDeath');
addOffset('firstDeath');
addOffset('deathLoop', -37);
addOffset('deathConfirm', -37);
playAnim('firstDeath');
// pixel bullshit
setGraphicSize(Std.int(width * 6));
updateHitbox();
antialiasing = false;
flipX = true;
case 'senpai':
frames = FlxAtlasFrames.fromSparrow('assets/images/weeb/senpai.png', 'assets/images/weeb/senpai.xml');
animation.addByPrefix('idle', 'Senpai Idle', 24, false);
animation.addByPrefix('singUP', 'SENPAI UP NOTE', 24, false);
animation.addByPrefix('singLEFT', 'SENPAI LEFT NOTE', 24, false);
animation.addByPrefix('singRIGHT', 'SENPAI RIGHT NOTE', 24, false);
animation.addByPrefix('singDOWN', 'SENPAI DOWN NOTE', 24, false);
addOffset('idle');
addOffset("singUP", 5, 37);
addOffset("singRIGHT");
addOffset("singLEFT", 40);
addOffset("singDOWN", 14);
playAnim('idle');
setGraphicSize(Std.int(width * 6));
updateHitbox();
antialiasing = false;
case 'senpai-angry':
frames = FlxAtlasFrames.fromSparrow('assets/images/weeb/senpai.png', 'assets/images/weeb/senpai.xml');
animation.addByPrefix('idle', 'Angry Senpai Idle', 24, false);
animation.addByPrefix('singUP', 'Angry Senpai UP NOTE', 24, false);
animation.addByPrefix('singLEFT', 'Angry Senpai LEFT NOTE', 24, false);
animation.addByPrefix('singRIGHT', 'Angry Senpai RIGHT NOTE', 24, false);
animation.addByPrefix('singDOWN', 'Angry Senpai DOWN NOTE', 24, false);
addOffset('idle');
addOffset("singUP", 5, 37);
addOffset("singRIGHT");
addOffset("singLEFT", 40);
addOffset("singDOWN", 14);
playAnim('idle');
setGraphicSize(Std.int(width * 6));
updateHitbox();
antialiasing = false;
case 'spirit':
frames = FlxAtlasFrames.fromSpriteSheetPacker('assets/images/weeb/spirit.png', 'assets/images/weeb/spirit.txt');
animation.addByPrefix('idle', "idle spirit_", 24, false);
animation.addByPrefix('singUP', "up_", 24, false);
animation.addByPrefix('singRIGHT', "right_", 24, false);
animation.addByPrefix('singLEFT', "left_", 24, false);
animation.addByPrefix('singDOWN', "spirit down_", 24, false);
addOffset('idle', -220, -280);
addOffset('singUP', -220, -240);
addOffset("singRIGHT", -220, -280);
addOffset("singLEFT", -200, -280);
addOffset("singDOWN", 170, 110);
setGraphicSize(Std.int(width * 6));
updateHitbox();
playAnim('idle');
antialiasing = false;
case 'parents-christmas':
frames = FlxAtlasFrames.fromSparrow('assets/images/christmas/mom_dad_christmas_assets.png',
'assets/images/christmas/mom_dad_christmas_assets.xml');
animation.addByPrefix('idle', 'Parent Christmas Idle', 24, false);
animation.addByPrefix('singUP', 'Parent Up Note Dad', 24, false);
animation.addByPrefix('singDOWN', 'Parent Down Note Dad', 24, false);
animation.addByPrefix('singLEFT', 'Parent Left Note Dad', 24, false);
animation.addByPrefix('singRIGHT', 'Parent Right Note Dad', 24, false);
animation.addByPrefix('singUP-alt', 'Parent Up Note Mom', 24, false);
animation.addByPrefix('singDOWN-alt', 'Parent Down Note Mom', 24, false);
animation.addByPrefix('singLEFT-alt', 'Parent Left Note Mom', 24, false);
animation.addByPrefix('singRIGHT-alt', 'Parent Right Note Mom', 24, false);
addOffset('idle');
addOffset("singUP", -47, 24);
addOffset("singRIGHT", -1, -23);
addOffset("singLEFT", -30, 16);
addOffset("singDOWN", -31, -29);
addOffset("singUP-alt", -47, 24);
addOffset("singRIGHT-alt", -1, -24);
addOffset("singLEFT-alt", -30, 15);
addOffset("singDOWN-alt", -30, -27);
playAnim('idle');
}
dance();
if (isPlayer)
{
flipX = !flipX;
// Doesn't flip for BF, since his are already in the right place???
if (!curCharacter.startsWith('bf'))
{
// var animArray
var oldRight = animation.getByName('singRIGHT').frames;
animation.getByName('singRIGHT').frames = animation.getByName('singLEFT').frames;
animation.getByName('singLEFT').frames = oldRight;
// IF THEY HAVE MISS ANIMATIONS??
if (animation.getByName('singRIGHTmiss') != null)
{
var oldMiss = animation.getByName('singRIGHTmiss').frames;
animation.getByName('singRIGHTmiss').frames = animation.getByName('singLEFTmiss').frames;
animation.getByName('singLEFTmiss').frames = oldMiss;
}
}
}
}
override function update(elapsed:Float)
{
if (curCharacter != 'bf')
if (!curCharacter.startsWith('bf'))
{
if (animation.curAnim.name.startsWith('sing'))
{
@ -227,34 +559,63 @@ class Character extends FlxSprite
*/
public function dance()
{
switch (curCharacter)
if (!debugMode)
{
case 'bf':
switch (curCharacter)
{
case 'gf':
if (!animation.curAnim.name.startsWith('hair'))
{
danced = !danced;
case 'gf':
if (!animation.curAnim.name.startsWith('hair'))
{
if (danced)
playAnim('danceRight');
else
playAnim('danceLeft');
}
case 'gf-christmas':
if (!animation.curAnim.name.startsWith('hair'))
{
danced = !danced;
if (danced)
playAnim('danceRight');
else
playAnim('danceLeft');
}
case 'gf-car':
if (!animation.curAnim.name.startsWith('hair'))
{
danced = !danced;
if (danced)
playAnim('danceRight');
else
playAnim('danceLeft');
}
case 'gf-pixel':
if (!animation.curAnim.name.startsWith('hair'))
{
danced = !danced;
if (danced)
playAnim('danceRight');
else
playAnim('danceLeft');
}
case 'spooky':
danced = !danced;
if (danced)
playAnim('danceRight');
else
playAnim('danceLeft');
}
case 'spooky':
danced = !danced;
if (danced)
playAnim('danceRight');
else
playAnim('danceLeft');
case 'dad':
playAnim('idle');
case 'monster':
playAnim('idle');
case 'pico':
playAnim('idle');
default:
playAnim('idle');
}
}
}
@ -267,6 +628,8 @@ class Character extends FlxSprite
{
offset.set(daOffset[0], daOffset[1]);
}
else
offset.set(0, 0);
if (curCharacter == 'gf')
{

View file

@ -24,6 +24,7 @@ import flixel.ui.FlxButton;
import flixel.ui.FlxSpriteButton;
import flixel.util.FlxColor;
import haxe.Json;
import lime.utils.Assets;
import openfl.events.Event;
import openfl.events.IOErrorEvent;
import openfl.events.IOErrorEvent;
@ -46,6 +47,8 @@ class ChartingState extends MusicBeatState
*/
var curSection:Int = 0;
public static var lastSection:Int = 0;
var bpmTxt:FlxText;
var strumLine:FlxSprite;
@ -76,11 +79,33 @@ class ChartingState extends MusicBeatState
var vocals:FlxSound;
var leftIcon:HealthIcon;
var rightIcon:HealthIcon;
override function create()
{
curSection = lastSection;
gridBG = FlxGridOverlay.create(GRID_SIZE, GRID_SIZE, GRID_SIZE * 8, GRID_SIZE * 16);
add(gridBG);
leftIcon = new HealthIcon('bf');
rightIcon = new HealthIcon('dad');
leftIcon.scrollFactor.set(1, 1);
rightIcon.scrollFactor.set(1, 1);
leftIcon.setGraphicSize(0, 45);
rightIcon.setGraphicSize(0, 45);
add(leftIcon);
add(rightIcon);
leftIcon.setPosition(0, -100);
rightIcon.setPosition(gridBG.width / 2, -100);
var gridBlackLine:FlxSprite = new FlxSprite(gridBG.x + gridBG.width / 2).makeGraphic(2, Std.int(gridBG.height), FlxColor.BLACK);
add(gridBlackLine);
curRenderedNotes = new FlxTypedGroup<Note>();
curRenderedSustains = new FlxTypedGroup<FlxSprite>();
@ -89,11 +114,11 @@ class ChartingState extends MusicBeatState
else
{
_song = {
song: 'Monster',
song: 'Test',
notes: [],
bpm: 95,
bpm: 150,
sections: 0,
needsVoices: false,
needsVoices: true,
player1: 'bf',
player2: 'dad',
sectionLengths: [],
@ -102,6 +127,9 @@ class ChartingState extends MusicBeatState
};
}
FlxG.mouse.visible = true;
FlxG.save.bind('funkin', 'ninjamuffin99');
tempBpm = _song.bpm;
addSection();
@ -152,14 +180,26 @@ class ChartingState extends MusicBeatState
typingShit = UI_songTitle;
var check_voices = new FlxUICheckBox(10, 25, null, null, "Has voice track", 100);
check_voices.checked = true;
_song.needsVoices = check_voices.checked;
check_voices.checked = _song.needsVoices;
// _song.needsVoices = check_voices.checked;
check_voices.callback = function()
{
_song.needsVoices = check_voices.checked;
trace('CHECKED!');
};
var check_mute_inst = new FlxUICheckBox(10, 200, null, null, "Mute Instrumental (in editor)", 100);
check_mute_inst.checked = false;
check_mute_inst.callback = function()
{
var vol:Float = 1;
if (check_mute_inst.checked)
vol = 0;
FlxG.sound.music.volume = vol;
};
var saveButton:FlxButton = new FlxButton(110, 8, "Save", function()
{
saveLevel();
@ -175,15 +215,17 @@ class ChartingState extends MusicBeatState
loadJson(_song.song.toLowerCase());
});
var loadAutosaveBtn:FlxButton = new FlxButton(reloadSongJson.x, reloadSongJson.y + 30, 'load autosave', loadAutosave);
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);
var stepperBPM:FlxUINumericStepper = new FlxUINumericStepper(10, 65, 1, 1, 1, 339, 0);
stepperBPM.value = Conductor.bpm;
stepperBPM.name = 'song_bpm';
var characters:Array<String> = ["bf", 'dad', 'gf', 'spooky', 'monster', 'pico'];
var characters:Array<String> = CoolUtil.coolTextFile('assets/data/characterList.txt');
var player1DropDown = new FlxUIDropDownMenu(10, 100, FlxUIDropDownMenu.makeStrIdLabelArray(characters, true), function(character:String)
{
@ -203,9 +245,11 @@ class ChartingState extends MusicBeatState
tab_group_song.add(UI_songTitle);
tab_group_song.add(check_voices);
tab_group_song.add(check_mute_inst);
tab_group_song.add(saveButton);
tab_group_song.add(reloadSong);
tab_group_song.add(reloadSongJson);
tab_group_song.add(loadAutosaveBtn);
tab_group_song.add(stepperBPM);
tab_group_song.add(stepperSpeed);
tab_group_song.add(player1DropDown);
@ -221,6 +265,7 @@ class ChartingState extends MusicBeatState
var check_mustHitSection:FlxUICheckBox;
var check_changeBPM:FlxUICheckBox;
var stepperSectionBPM:FlxUINumericStepper;
var check_altAnim:FlxUICheckBox;
function addSectionUI():Void
{
@ -235,18 +280,34 @@ class ChartingState extends MusicBeatState
stepperSectionBPM.value = Conductor.bpm;
stepperSectionBPM.name = 'section_bpm';
var stepperCopy:FlxUINumericStepper = new FlxUINumericStepper(110, 30, 1, 1, -999, 999, 0);
var stepperCopy:FlxUINumericStepper = new FlxUINumericStepper(110, 130, 1, 1, -999, 999, 0);
var copyButton:FlxButton = new FlxButton(110, 8, "Copy last section", function()
var copyButton:FlxButton = new FlxButton(10, 130, "Copy last section", function()
{
copySection(Std.int(stepperCopy.value));
});
var clearSectionButton:FlxButton = new FlxButton(10, 150, "Clear", clearSection);
var swapSection:FlxButton = new FlxButton(10, 170, "Swap section", function()
{
for (i in 0..._song.notes[curSection].sectionNotes.length)
{
var note = _song.notes[curSection].sectionNotes[i];
note[1] = (note[1] + 4) % 8;
_song.notes[curSection].sectionNotes[i] = note;
updateGrid();
}
});
check_mustHitSection = new FlxUICheckBox(10, 30, null, null, "Must hit section", 100);
check_mustHitSection.name = 'check_mustHit';
check_mustHitSection.checked = true;
// _song.needsVoices = check_mustHit.checked;
check_altAnim = new FlxUICheckBox(10, 400, null, null, "Alt Animation", 100);
check_altAnim.name = 'check_altAnim';
check_changeBPM = new FlxUICheckBox(10, 60, null, null, 'Change BPM', 100);
check_changeBPM.name = 'check_changeBPM';
@ -254,8 +315,11 @@ class ChartingState extends MusicBeatState
tab_group_section.add(stepperSectionBPM);
tab_group_section.add(stepperCopy);
tab_group_section.add(check_mustHitSection);
tab_group_section.add(check_altAnim);
tab_group_section.add(check_changeBPM);
tab_group_section.add(copyButton);
tab_group_section.add(clearSectionButton);
tab_group_section.add(swapSection);
UI_box.addGroup(tab_group_section);
}
@ -289,7 +353,7 @@ class ChartingState extends MusicBeatState
FlxG.sound.playMusic('assets/music/' + daSong + "_Inst" + TitleState.soundExt, 0.6);
// WONT WORK FOR TUTORIAL! REDO LATER
// WONT WORK FOR TUTORIAL OR TEST SONG!!! REDO LATER
vocals = new FlxSound().loadEmbedded("assets/music/" + daSong + "_Voices" + TitleState.soundExt);
FlxG.sound.list.add(vocals);
@ -334,9 +398,14 @@ class ChartingState extends MusicBeatState
{
case 'Must hit section':
_song.notes[curSection].mustHitSection = check.checked;
updateHeads();
case 'Change BPM':
_song.notes[curSection].changeBPM = check.checked;
FlxG.log.add('changed bpm shit');
case "Alt Animation":
_song.notes[curSection].altAnim = check.checked;
}
}
else if (id == FlxUINumericStepper.CHANGE_EVENT && (sender is FlxUINumericStepper))
@ -459,12 +528,39 @@ class ChartingState extends MusicBeatState
if (FlxG.keys.justPressed.ENTER)
{
lastSection = curSection;
PlayState.SONG = _song;
FlxG.sound.music.stop();
vocals.stop();
FlxG.switchState(new PlayState());
}
if (FlxG.keys.justPressed.E)
{
changeNoteSustain(Conductor.stepCrochet);
}
if (FlxG.keys.justPressed.Q)
{
changeNoteSustain(-Conductor.stepCrochet);
}
if (FlxG.keys.justPressed.TAB)
{
if (FlxG.keys.pressed.SHIFT)
{
UI_box.selected_tab -= 1;
if (UI_box.selected_tab < 0)
UI_box.selected_tab = 2;
}
else
{
UI_box.selected_tab += 1;
if (UI_box.selected_tab >= 3)
UI_box.selected_tab = 0;
}
}
if (!typingShit.hasFocus)
{
if (FlxG.keys.justPressed.SPACE)
@ -484,27 +580,58 @@ class ChartingState extends MusicBeatState
if (FlxG.keys.justPressed.R)
{
if (FlxG.keys.pressed.SHIFT)
changeSection();
resetSection(true);
else
changeSection(curSection);
resetSection();
}
if (FlxG.keys.pressed.W || FlxG.keys.pressed.S)
if (FlxG.mouse.wheel != 0)
{
FlxG.sound.music.pause();
vocals.pause();
var daTime:Float = 700 * FlxG.elapsed;
if (FlxG.keys.pressed.W)
{
FlxG.sound.music.time -= daTime;
}
else
FlxG.sound.music.time += daTime;
FlxG.sound.music.time -= (FlxG.mouse.wheel * Conductor.stepCrochet * 0.4);
vocals.time = FlxG.sound.music.time;
}
if (!FlxG.keys.pressed.SHIFT)
{
if (FlxG.keys.pressed.W || FlxG.keys.pressed.S)
{
FlxG.sound.music.pause();
vocals.pause();
var daTime:Float = 700 * FlxG.elapsed;
if (FlxG.keys.pressed.W)
{
FlxG.sound.music.time -= daTime;
}
else
FlxG.sound.music.time += daTime;
vocals.time = FlxG.sound.music.time;
}
}
else
{
if (FlxG.keys.justPressed.W || FlxG.keys.justPressed.S)
{
FlxG.sound.music.pause();
vocals.pause();
var daTime:Float = Conductor.stepCrochet * 2;
if (FlxG.keys.justPressed.W)
{
FlxG.sound.music.time -= daTime;
}
else
FlxG.sound.music.time += daTime;
vocals.time = FlxG.sound.music.time;
}
}
}
_song.bpm = tempBpm;
@ -517,9 +644,9 @@ class ChartingState extends MusicBeatState
var shiftThing:Int = 1;
if (FlxG.keys.pressed.SHIFT)
shiftThing = 4;
if (FlxG.keys.justPressed.RIGHT)
if (FlxG.keys.justPressed.RIGHT || FlxG.keys.justPressed.D)
changeSection(curSection + shiftThing);
if (FlxG.keys.justPressed.LEFT)
if (FlxG.keys.justPressed.LEFT || FlxG.keys.justPressed.A)
changeSection(curSection - shiftThing);
bpmTxt.text = bpmTxt.text = Std.string(FlxMath.roundDecimal(Conductor.songPosition / 1000, 2))
@ -530,6 +657,21 @@ class ChartingState extends MusicBeatState
super.update(elapsed);
}
function changeNoteSustain(value:Float):Void
{
if (curSelectedNote != null)
{
if (curSelectedNote[2] != null)
{
curSelectedNote[2] += value;
curSelectedNote[2] = Math.max(curSelectedNote[2], 0);
}
}
updateNoteUI();
updateGrid();
}
function recalculateSteps():Int
{
var steps:Int = 0;
@ -552,6 +694,29 @@ class ChartingState extends MusicBeatState
return curStep;
}
function resetSection(songBeginning:Bool = false):Void
{
updateGrid();
FlxG.sound.music.pause();
vocals.pause();
// Basically old shit from changeSection???
FlxG.sound.music.time = lengthBpmBullshit() * Conductor.stepCrochet * curSection;
if (songBeginning)
{
FlxG.sound.music.time = 0;
curSection = 0;
}
vocals.time = FlxG.sound.music.time;
updateCurStep();
updateGrid();
updateSectionUI();
}
function changeSection(sec:Int = 0, ?updateMusic:Bool = true):Void
{
trace('changing section' + sec);
@ -606,13 +771,31 @@ class ChartingState extends MusicBeatState
stepperLength.value = sec.lengthInSteps;
check_mustHitSection.checked = sec.mustHitSection;
check_altAnim.checked = sec.altAnim;
check_changeBPM.checked = sec.changeBPM;
stepperSectionBPM.value = sec.bpm;
updateHeads();
}
function updateHeads():Void
{
if (check_mustHitSection.checked)
{
leftIcon.animation.play('bf');
rightIcon.animation.play('dad');
}
else
{
leftIcon.animation.play('dad');
rightIcon.animation.play('bf');
}
}
function updateNoteUI():Void
{
stepperSusLength.value = curSelectedNote[2];
if (curSelectedNote != null)
stepperSusLength.value = curSelectedNote[2];
}
function updateGrid():Void
@ -684,7 +867,8 @@ class ChartingState extends MusicBeatState
changeBPM: false,
mustHitSection: true,
sectionNotes: [],
typeOfSection: 0
typeOfSection: 0,
altAnim: false
};
_song.notes.push(sec);
@ -722,6 +906,13 @@ class ChartingState extends MusicBeatState
updateGrid();
}
function clearSection():Void
{
_song.notes[curSection].sectionNotes = [];
updateGrid();
}
function clearSong():Void
{
for (daSection in 0..._song.notes.length)
@ -742,11 +933,18 @@ class ChartingState extends MusicBeatState
curSelectedNote = _song.notes[curSection].sectionNotes[_song.notes[curSection].sectionNotes.length - 1];
if (FlxG.keys.pressed.CONTROL)
{
_song.notes[curSection].sectionNotes.push([noteStrum, (noteData + 4) % 8, noteSus]);
}
trace(getStrumTime(dummyArrow.y) + (curSection * (Conductor.stepCrochet * lengthBpmBullshit())));
trace(curSection);
updateGrid();
updateNoteUI();
autosaveSong();
}
function getStrumTime(yPos:Float):Float
@ -807,11 +1005,21 @@ class ChartingState extends MusicBeatState
FlxG.resetState();
}
var mp3File:Sound;
var waveForm:FlxSprite;
function drawWave():Void
function loadAutosave():Void
{
PlayState.SONG = Song.parseJSONshit(FlxG.save.data.autosave);
FlxG.resetState();
}
function autosaveSong():Void
{
FlxG.save.data.autosave = Json.stringify({
"song": _song,
"bpm": Conductor.bpm,
"sections": _song.notes.length,
'notes': _song.notes
});
FlxG.save.flush();
}
private function saveLevel()

30
source/CoolUtil.hx Normal file
View file

@ -0,0 +1,30 @@
package;
import lime.utils.Assets;
using StringTools;
class CoolUtil
{
public static function coolTextFile(path:String):Array<String>
{
var daList:Array<String> = Assets.getText(path).trim().split('\n');
for (i in 0...daList.length)
{
daList[i] = daList[i].trim();
}
return daList;
}
public static function numberArray(max:Int, ?min = 0):Array<Int>
{
var dumbArray:Array<Int> = [];
for (i in min...max)
{
dumbArray.push(i);
}
return dumbArray;
}
}

View file

@ -2,38 +2,139 @@ package;
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.addons.text.FlxTypeText;
import flixel.graphics.frames.FlxAtlasFrames;
import flixel.group.FlxSpriteGroup;
import flixel.input.FlxKeyManager;
import flixel.text.FlxText;
import flixel.util.FlxColor;
import flixel.util.FlxTimer;
using StringTools;
class DialogueBox extends FlxSpriteGroup
{
var box:FlxSprite;
var curCharacter:String = '';
var dialogue:Alphabet;
var dialogueList:Array<String> = [];
// SECOND DIALOGUE FOR THE PIXEL SHIT INSTEAD???
var swagDialogue:FlxTypeText;
var dropText:FlxText;
public var finishThing:Void->Void;
var portraitLeft:FlxSprite;
var portraitRight:FlxSprite;
var handSelect:FlxSprite;
var bgFade:FlxSprite;
public function new(talkingRight:Bool = true, ?dialogueList:Array<String>)
{
super();
box = new FlxSprite(40);
box.frames = FlxAtlasFrames.fromSparrow(AssetPaths.speech_bubble_talking__png, AssetPaths.speech_bubble_talking__xml);
box.animation.addByPrefix('normalOpen', 'Speech Bubble Normal Open', 24, false);
box.animation.addByPrefix('normal', 'speech bubble normal', 24);
switch (PlayState.SONG.song.toLowerCase())
{
case 'senpai':
FlxG.sound.playMusic('assets/music/Lunchbox' + TitleState.soundExt, 0);
FlxG.sound.music.fadeIn(1, 0, 0.8);
case 'thorns':
FlxG.sound.playMusic('assets/music/LunchboxScary' + TitleState.soundExt, 0);
FlxG.sound.music.fadeIn(1, 0, 0.8);
}
bgFade = new FlxSprite(-200, -200).makeGraphic(Std.int(FlxG.width * 1.3), Std.int(FlxG.height * 1.3), 0xFFB3DFd8);
bgFade.scrollFactor.set();
bgFade.alpha = 0;
add(bgFade);
new FlxTimer().start(0.83, function(tmr:FlxTimer)
{
bgFade.alpha += (1 / 5) * 0.7;
if (bgFade.alpha > 0.7)
bgFade.alpha = 0.7;
}, 5);
portraitLeft = new FlxSprite(-20, 40);
portraitLeft.frames = FlxAtlasFrames.fromSparrow('assets/images/weeb/senpaiPortrait.png', 'assets/images/weeb/senpaiPortrait.xml');
portraitLeft.animation.addByPrefix('enter', 'Senpai Portrait Enter', 24, false);
portraitLeft.setGraphicSize(Std.int(portraitLeft.width * PlayState.daPixelZoom * 0.9));
portraitLeft.updateHitbox();
portraitLeft.scrollFactor.set();
add(portraitLeft);
portraitLeft.visible = false;
portraitRight = new FlxSprite(0, 40);
portraitRight.frames = FlxAtlasFrames.fromSparrow('assets/images/weeb/bfPortrait.png', 'assets/images/weeb/bfPortrait.xml');
portraitRight.animation.addByPrefix('enter', 'Boyfriend portrait enter', 24, false);
portraitRight.setGraphicSize(Std.int(portraitRight.width * PlayState.daPixelZoom * 0.9));
portraitRight.updateHitbox();
portraitRight.scrollFactor.set();
add(portraitRight);
portraitRight.visible = false;
box = new FlxSprite(-20, 45);
switch (PlayState.SONG.song.toLowerCase())
{
case 'senpai':
box.frames = FlxAtlasFrames.fromSparrow('assets/images/weeb/pixelUI/dialogueBox-pixel.png',
'assets/images/weeb/pixelUI/dialogueBox-pixel.xml');
box.animation.addByPrefix('normalOpen', 'Text Box Appear', 24, false);
box.animation.addByIndices('normal', 'Text Box Appear', [4], "", 24);
case 'roses':
FlxG.sound.play('assets/sounds/ANGRY_TEXT_BOX' + TitleState.soundExt);
box.frames = FlxAtlasFrames.fromSparrow('assets/images/weeb/pixelUI/dialogueBox-senpaiMad.png',
'assets/images/weeb/pixelUI/dialogueBox-senpaiMad.xml');
box.animation.addByPrefix('normalOpen', 'SENPAI ANGRY IMPACT SPEECH', 24, false);
box.animation.addByIndices('normal', 'SENPAI ANGRY IMPACT SPEECH', [4], "", 24);
case 'thorns':
box.frames = FlxAtlasFrames.fromSparrow('assets/images/weeb/pixelUI/dialogueBox-evil.png', 'assets/images/weeb/pixelUI/dialogueBox-evil.xml');
box.animation.addByPrefix('normalOpen', 'Spirit Textbox spawn', 24, false);
box.animation.addByIndices('normal', 'Spirit Textbox spawn', [11], "", 24);
var face:FlxSprite = new FlxSprite(320, 170).loadGraphic('assets/images/weeb/spiritFaceForward.png');
face.setGraphicSize(Std.int(face.width * 6));
add(face);
}
box.animation.play('normalOpen');
box.setGraphicSize(Std.int(box.width * PlayState.daPixelZoom * 0.9));
box.updateHitbox();
add(box);
handSelect = new FlxSprite(FlxG.width * 0.9, FlxG.height * 0.9).loadGraphic('assets/images/weeb/pixelUI/hand_textbox.png');
add(handSelect);
box.screenCenter(X);
portraitLeft.screenCenter(X);
if (!talkingRight)
{
box.flipX = true;
// box.flipX = true;
}
dropText = new FlxText(242, 502, Std.int(FlxG.width * 0.6), "", 32);
dropText.font = 'Pixel Arial 11 Bold';
dropText.color = 0xFFD89494;
add(dropText);
swagDialogue = new FlxTypeText(240, 500, Std.int(FlxG.width * 0.6), "", 32);
swagDialogue.font = 'Pixel Arial 11 Bold';
swagDialogue.color = 0xFF3F2021;
swagDialogue.sounds = [FlxG.sound.load('assets/sounds/pixelText' + TitleState.soundExt, 0.6)];
add(swagDialogue);
dialogue = new Alphabet(0, 80, "", false, true);
// dialogue.x = 90;
add(dialogue);
// add(dialogue);
this.dialogueList = dialogueList;
}
@ -43,6 +144,18 @@ class DialogueBox extends FlxSpriteGroup
override function update(elapsed:Float)
{
// HARD CODING CUZ IM STUPDI
if (PlayState.SONG.song.toLowerCase() == 'roses')
portraitLeft.visible = false;
if (PlayState.SONG.song.toLowerCase() == 'thorns')
{
portraitLeft.color = FlxColor.BLACK;
swagDialogue.color = FlxColor.WHITE;
dropText.color = FlxColor.BLACK;
}
dropText.text = swagDialogue.text;
if (box.animation.curAnim != null)
{
if (box.animation.curAnim.name == 'normalOpen' && box.animation.curAnim.finished)
@ -58,14 +171,37 @@ class DialogueBox extends FlxSpriteGroup
dialogueStarted = true;
}
if (FlxG.keys.justPressed.SPACE)
if (FlxG.keys.justPressed.ANY)
{
remove(dialogue);
FlxG.sound.play('assets/sounds/clickText' + TitleState.soundExt, 0.8);
if (dialogueList[1] == null)
{
finishThing();
kill();
if (!isEnding)
{
isEnding = true;
if (PlayState.SONG.song.toLowerCase() == 'senpai' || PlayState.SONG.song.toLowerCase() == 'thorns')
FlxG.sound.music.fadeOut(2.2, 0);
new FlxTimer().start(0.2, function(tmr:FlxTimer)
{
box.alpha -= 1 / 5;
bgFade.alpha -= 1 / 5 * 0.7;
portraitLeft.visible = false;
portraitRight.visible = false;
swagDialogue.alpha -= 1 / 5;
dropText.alpha = swagDialogue.alpha;
}, 5);
new FlxTimer().start(1.2, function(tmr:FlxTimer)
{
finishThing();
kill();
});
}
}
else
{
@ -77,10 +213,43 @@ class DialogueBox extends FlxSpriteGroup
super.update(elapsed);
}
var isEnding:Bool = false;
function startDialogue():Void
{
var theDialog:Alphabet = new Alphabet(0, 70, dialogueList[0], false, true);
dialogue = theDialog;
add(theDialog);
cleanDialog();
// var theDialog:Alphabet = new Alphabet(0, 70, dialogueList[0], false, true);
// dialogue = theDialog;
// add(theDialog);
// swagDialogue.text = ;
swagDialogue.resetText(dialogueList[0]);
swagDialogue.start(0.04, true);
switch (curCharacter)
{
case 'dad':
portraitRight.visible = false;
if (!portraitLeft.visible)
{
portraitLeft.visible = true;
portraitLeft.animation.play('enter');
}
case 'bf':
portraitLeft.visible = false;
if (!portraitRight.visible)
{
portraitRight.visible = true;
portraitRight.animation.play('enter');
}
}
}
function cleanDialog():Void
{
var splitName:Array<String> = dialogueList[0].split(":");
curCharacter = splitName[1];
dialogueList[0] = dialogueList[0].substr(splitName[1].length + 2).trim();
}
}

View file

@ -10,9 +10,11 @@ import flixel.text.FlxText;
import flixel.util.FlxColor;
import lime.utils.Assets;
using StringTools;
class FreeplayState extends MusicBeatState
{
var songs:Array<String> = ["Bopeebo", "Dadbattle", "Fresh", "Tutorial"];
var songs:Array<String> = [];
var selector:FlxText;
var curSelected:Int = 0;
@ -28,6 +30,8 @@ class FreeplayState extends MusicBeatState
override function create()
{
songs = CoolUtil.coolTextFile('assets/data/freeplaySonglist.txt');
/*
if (FlxG.sound.music != null)
{
@ -55,11 +59,33 @@ class FreeplayState extends MusicBeatState
songs.push('Blammed');
}
if (StoryMenuState.weekUnlocked[4] || isDebug)
{
songs.push('Satin-Panties');
songs.push('High');
songs.push('Milf');
}
if (StoryMenuState.weekUnlocked[5] || isDebug)
{
songs.push('Cocoa');
songs.push('Eggnog');
songs.push('Winter-Horrorland');
}
if (StoryMenuState.weekUnlocked[6] || isDebug)
{
songs.push('Senpai');
songs.push('Roses');
songs.push('Thorns');
// songs.push('Winter-Horrorland');
}
// LOAD MUSIC
// LOAD CHARACTERS
var bg:FlxSprite = new FlxSprite().loadGraphic(AssetPaths.menuBGBlue__png);
var bg:FlxSprite = new FlxSprite().loadGraphic('assets/images/menuBGBlue.png');
add(bg);
grpSongs = new FlxTypedGroup<Alphabet>();

View file

@ -24,7 +24,7 @@ class GameOverState extends FlxTransitionableState
override function create()
{
/* var loser:FlxSprite = new FlxSprite(100, 100);
var loseTex = FlxAtlasFrames.fromSparrow(AssetPaths.lose__png, AssetPaths.lose__xml);
var loseTex = FlxAtlasFrames.fromSparrow(AssetPaths.lose.png, AssetPaths.lose.xml);
loser.frames = loseTex;
loser.animation.addByPrefix('lose', 'lose', 24, false);
loser.animation.play('lose');
@ -37,7 +37,7 @@ class GameOverState extends FlxTransitionableState
FlxG.camera.follow(bf, LOCKON, 0.001);
/*
var restart:FlxSprite = new FlxSprite(500, 50).loadGraphic(AssetPaths.restart__png);
var restart:FlxSprite = new FlxSprite(500, 50).loadGraphic(AssetPaths.restart.png);
restart.setGraphicSize(Std.int(restart.width * 0.6));
restart.updateHitbox();
restart.alpha = 0;

View file

@ -12,21 +12,35 @@ class GameOverSubstate extends MusicBeatSubstate
var bf:Boyfriend;
var camFollow:FlxObject;
// var
var stageSuffix:String = "";
public function new(x:Float, y:Float)
{
var daStage = PlayState.curStage;
var daBf:String = '';
switch (daStage)
{
case 'school':
stageSuffix = '-pixel';
daBf = 'bf-pixel-dead';
case 'schoolEvil':
stageSuffix = '-pixel';
daBf = 'bf-pixel-dead';
default:
daBf = 'bf';
}
super();
Conductor.songPosition = 0;
bf = new Boyfriend(x, y);
bf = new Boyfriend(x, y, daBf);
add(bf);
camFollow = new FlxObject(bf.getGraphicMidpoint().x, bf.getGraphicMidpoint().y, 1, 1);
add(camFollow);
FlxG.sound.play('assets/sounds/fnf_loss_sfx' + TitleState.soundExt);
FlxG.sound.play('assets/sounds/fnf_loss_sfx' + stageSuffix + TitleState.soundExt);
Conductor.changeBPM(100);
// FlxG.camera.followLerp = 1;
@ -63,7 +77,7 @@ class GameOverSubstate extends MusicBeatSubstate
if (bf.animation.curAnim.name == 'firstDeath' && bf.animation.curAnim.finished)
{
FlxG.sound.playMusic('assets/music/gameOver' + TitleState.soundExt);
FlxG.sound.playMusic('assets/music/gameOver' + stageSuffix + TitleState.soundExt);
}
if (FlxG.sound.music.playing)
@ -88,7 +102,7 @@ class GameOverSubstate extends MusicBeatSubstate
isEnding = true;
bf.playAnim('deathConfirm', true);
FlxG.sound.music.stop();
FlxG.sound.play('assets/music/gameOverEnd' + TitleState.soundExt);
FlxG.sound.play('assets/music/gameOverEnd' + stageSuffix + TitleState.soundExt);
new FlxTimer().start(0.7, function(tmr:FlxTimer)
{
FlxG.camera.fade(FlxColor.BLACK, 2, false, function()

35
source/HealthIcon.hx Normal file
View file

@ -0,0 +1,35 @@
package;
import flixel.FlxSprite;
class HealthIcon extends FlxSprite
{
public function new(char:String = 'bf', isPlayer:Bool = false)
{
super();
loadGraphic('assets/images/iconGrid.png', true, 150, 150);
antialiasing = true;
animation.add('bf', [0, 1], 0, false, isPlayer);
animation.add('bf-car', [0, 1], 0, false, isPlayer);
animation.add('bf-christmas', [0, 1], 0, false, isPlayer);
animation.add('bf-pixel', [21, 21], 0, false, isPlayer);
animation.add('spooky', [2, 3], 0, false, isPlayer);
animation.add('pico', [4, 5], 0, false, isPlayer);
animation.add('mom', [6, 7], 0, false, isPlayer);
animation.add('mom-car', [6, 7], 0, false, isPlayer);
animation.add('tankman', [8, 9], 0, false, isPlayer);
animation.add('face', [10, 11], 0, false, isPlayer);
animation.add('dad', [12, 13], 0, false, isPlayer);
animation.add('senpai', [22, 22], 0, false, isPlayer);
animation.add('senpai-angry', [22, 22], 0, false, isPlayer);
animation.add('spirit', [23, 23], 0, false, isPlayer);
animation.add('bf-old', [14, 15], 0, false, isPlayer);
animation.add('gf', [16], 0, false, isPlayer);
animation.add('parents-christmas', [17], 0, false, isPlayer);
animation.add('monster', [19, 20], 0, false, isPlayer);
animation.add('monster-christmas', [19, 20], 0, false, isPlayer);
animation.play(char);
scrollFactor.set();
}
}

View file

@ -10,8 +10,11 @@ import flixel.text.FlxText;
import flixel.tweens.FlxEase;
import flixel.tweens.FlxTween;
import flixel.util.FlxColor;
import io.newgrounds.NG;
import lime.app.Application;
using StringTools;
class MainMenuState extends MusicBeatState
{
var curSelected:Int = 0;
@ -36,7 +39,7 @@ class MainMenuState extends MusicBeatState
persistentUpdate = persistentDraw = true;
var bg:FlxSprite = new FlxSprite(-80).loadGraphic(AssetPaths.menuBG__png);
var bg:FlxSprite = new FlxSprite(-80).loadGraphic('assets/images/menuBG.png');
bg.scrollFactor.x = 0;
bg.scrollFactor.y = 0.18;
bg.setGraphicSize(Std.int(bg.width * 1.1));
@ -48,7 +51,7 @@ class MainMenuState extends MusicBeatState
camFollow = new FlxObject(0, 0, 1, 1);
add(camFollow);
magenta = new FlxSprite(-80).loadGraphic(AssetPaths.menuDesat__png);
magenta = new FlxSprite(-80).loadGraphic('assets/images/menuDesat.png');
magenta.scrollFactor.x = 0;
magenta.scrollFactor.y = 0.18;
magenta.setGraphicSize(Std.int(magenta.width * 1.1));
@ -63,7 +66,7 @@ class MainMenuState extends MusicBeatState
menuItems = new FlxTypedGroup<FlxSprite>();
add(menuItems);
var tex = FlxAtlasFrames.fromSparrow(AssetPaths.FNF_main_menu_assets__png, AssetPaths.FNF_main_menu_assets__xml);
var tex = FlxAtlasFrames.fromSparrow('assets/images/FNF_main_menu_assets.png', 'assets/images/FNF_main_menu_assets.xml');
for (i in 0...optionShit.length)
{
@ -86,6 +89,8 @@ class MainMenuState extends MusicBeatState
versionShit.setFormat("VCR OSD Mono", 16, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
add(versionShit);
// NG.core.calls.event.logEvent('swag').send();
changeItem();
super.create();

View file

@ -13,7 +13,7 @@ class MenuCharacter extends FlxSprite
this.character = character;
var tex = FlxAtlasFrames.fromSparrow(AssetPaths.campaign_menu_UI_characters__png, AssetPaths.campaign_menu_UI_characters__xml);
var tex = FlxAtlasFrames.fromSparrow('assets/images/campaign_menu_UI_characters.png', 'assets/images/campaign_menu_UI_characters.xml');
frames = tex;
animation.addByPrefix('bf', "BF idle dance white", 24);
@ -22,6 +22,10 @@ class MenuCharacter extends FlxSprite
animation.addByPrefix('dad', "Dad idle dance BLACK LINE", 24);
animation.addByPrefix('spooky', "spooky dance idle BLACK LINES", 24);
animation.addByPrefix('pico', "Pico Idle Dance", 24);
animation.addByPrefix('mom', "Mom Idle BLACK LINES", 24);
animation.addByPrefix('parents-christmas', "Parent Christmas Idle", 24);
animation.addByPrefix('senpai', "SENPAI idle Black Lines", 24);
// Parent Christmas Idle
animation.play(character);
updateHitbox();

View file

@ -14,7 +14,7 @@ class MenuItem extends FlxSpriteGroup
{
super(x, y);
var tex = FlxAtlasFrames.fromSparrow(AssetPaths.campaign_menu_UI_assets__png, AssetPaths.campaign_menu_UI_assets__xml);
var tex = FlxAtlasFrames.fromSparrow('assets/images/campaign_menu_UI_assets.png', 'assets/images/campaign_menu_UI_assets.xml');
week = new FlxSprite();
week.frames = tex;
@ -23,6 +23,9 @@ class MenuItem extends FlxSpriteGroup
week.animation.addByPrefix('week1', "WEEK1 select", 24);
week.animation.addByPrefix('week2', "week2 select", 24);
week.animation.addByPrefix('week3', "Week 3 press", 24);
week.animation.addByPrefix('week4', "Week 4 press", 24);
week.animation.addByPrefix('week5', "week 5", 24);
week.animation.addByPrefix('week6', "Week 6", 24);
add(week);
week.animation.play('week' + weekNum);

View file

@ -3,6 +3,7 @@ package;
import flixel.FlxG;
import flixel.addons.transition.FlxTransitionableState;
import flixel.addons.ui.FlxUIState;
import flixel.math.FlxRect;
import flixel.util.FlxTimer;
class MusicBeatState extends FlxUIState
@ -22,6 +23,9 @@ class MusicBeatState extends FlxUIState
override function create()
{
if (transIn != null)
trace('reg ' + transIn.region);
#if (!web)
TitleState.soundExt = '.ogg';
#end

View file

@ -2,11 +2,16 @@ package;
import flixel.FlxG;
import flixel.util.FlxSignal;
import flixel.util.FlxTimer;
import io.newgrounds.NG;
import io.newgrounds.components.ScoreBoardComponent.Period;
import io.newgrounds.objects.Medal;
import io.newgrounds.objects.Score;
import io.newgrounds.objects.ScoreBoard;
import io.newgrounds.objects.events.Response;
import io.newgrounds.objects.events.Result.GetCurrentVersionResult;
import io.newgrounds.objects.events.Result.GetVersionResult;
import lime.app.Application;
import openfl.display.Stage;
/**
@ -22,6 +27,29 @@ class NGio
public static var ngDataLoaded(default, null):FlxSignal = new FlxSignal();
public static var ngScoresLoaded(default, null):FlxSignal = new FlxSignal();
public static var GAME_VER:String = "";
public static var gotOnlineVer:Bool = false;
public static function noLogin(api:String)
{
trace('INIT NOLOGIN');
GAME_VER = "v" + Application.current.meta.get('version');
NG.create(api);
new FlxTimer().start(2, function(tmr:FlxTimer)
{
var call = NG.core.calls.app.getCurrentVersion(GAME_VER).addDataHandler(function(response:Response<GetCurrentVersionResult>)
{
GAME_VER = response.result.data.current_version;
trace('CURRENT NG VERSION: ' + GAME_VER);
gotOnlineVer = true;
});
call.send();
});
}
public function new(api:String, encKey:String, ?sessionId:String)
{
trace("connecting to newgrounds");
@ -148,11 +176,8 @@ class NGio
inline static public function logEvent(event:String)
{
if (isLoggedIn)
{
NG.core.calls.event.logEvent(event);
trace('should have logged: ' + event);
}
NG.core.calls.event.logEvent(event).send();
trace('should have logged: ' + event);
}
inline static public function unlockMedal(id:Int)

View file

@ -2,7 +2,11 @@ package;
import flixel.FlxSprite;
import flixel.graphics.frames.FlxAtlasFrames;
import flixel.math.FlxMath;
import flixel.util.FlxColor;
import polymod.format.ParseRules.TargetSignatureElement;
using StringTools;
class Note extends FlxSprite
{
@ -43,26 +47,84 @@ class Note extends FlxSprite
this.noteData = noteData;
var tex = FlxAtlasFrames.fromSparrow(AssetPaths.NOTE_assets__png, AssetPaths.NOTE_assets__xml);
frames = tex;
animation.addByPrefix('greenScroll', 'green0');
animation.addByPrefix('redScroll', 'red0');
animation.addByPrefix('blueScroll', 'blue0');
animation.addByPrefix('purpleScroll', 'purple0');
var daStage:String = PlayState.curStage;
animation.addByPrefix('purpleholdend', 'pruple end hold');
animation.addByPrefix('greenholdend', 'green hold end');
animation.addByPrefix('redholdend', 'red hold end');
animation.addByPrefix('blueholdend', 'blue hold end');
switch (daStage)
{
case 'school':
loadGraphic('assets/images/weeb/pixelUI/arrows-pixels.png', true, 17, 17);
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.add('greenScroll', [6]);
animation.add('redScroll', [7]);
animation.add('blueScroll', [5]);
animation.add('purpleScroll', [4]);
setGraphicSize(Std.int(width * 0.7));
updateHitbox();
antialiasing = true;
if (isSustainNote)
{
loadGraphic('assets/images/weeb/pixelUI/arrowEnds.png', true, 7, 6);
animation.add('purpleholdend', [4]);
animation.add('greenholdend', [6]);
animation.add('redholdend', [7]);
animation.add('blueholdend', [5]);
animation.add('purplehold', [0]);
animation.add('greenhold', [2]);
animation.add('redhold', [3]);
animation.add('bluehold', [1]);
}
setGraphicSize(Std.int(width * PlayState.daPixelZoom));
updateHitbox();
case 'schoolEvil': // COPY PASTED CUZ I AM LAZY
loadGraphic('assets/images/weeb/pixelUI/arrows-pixels.png', true, 17, 17);
animation.add('greenScroll', [6]);
animation.add('redScroll', [7]);
animation.add('blueScroll', [5]);
animation.add('purpleScroll', [4]);
if (isSustainNote)
{
loadGraphic('assets/images/weeb/pixelUI/arrowEnds.png', true, 7, 6);
animation.add('purpleholdend', [4]);
animation.add('greenholdend', [6]);
animation.add('redholdend', [7]);
animation.add('blueholdend', [5]);
animation.add('purplehold', [0]);
animation.add('greenhold', [2]);
animation.add('redhold', [3]);
animation.add('bluehold', [1]);
}
setGraphicSize(Std.int(width * PlayState.daPixelZoom));
updateHitbox();
default:
frames = FlxAtlasFrames.fromSparrow('assets/images/NOTE_assets.png', 'assets/images/NOTE_assets.xml');
animation.addByPrefix('greenScroll', 'green0');
animation.addByPrefix('redScroll', 'red0');
animation.addByPrefix('blueScroll', 'blue0');
animation.addByPrefix('purpleScroll', 'purple0');
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('purplehold', 'purple hold piece');
animation.addByPrefix('greenhold', 'green hold piece');
animation.addByPrefix('redhold', 'red hold piece');
animation.addByPrefix('bluehold', 'blue hold piece');
setGraphicSize(Std.int(width * 0.7));
updateHitbox();
antialiasing = true;
}
switch (noteData)
{
@ -105,6 +167,9 @@ class Note extends FlxSprite
x -= width / 2;
if (PlayState.curStage.startsWith('school'))
x += 30;
if (prevNote.isSustainNote)
{
switch (prevNote.noteData)
@ -120,7 +185,7 @@ class Note extends FlxSprite
}
prevNote.offset.y = -19;
prevNote.scale.y *= (2.25 * PlayState.SONG.speed);
prevNote.scale.y *= (2.25 * FlxMath.roundDecimal(PlayState.SONG.speed, 1));
// prevNote.setGraphicSize();
}
}

View file

@ -1,14 +1,30 @@
package;
import Controls.Control;
import flash.text.TextField;
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.addons.display.FlxGridOverlay;
import flixel.group.FlxGroup.FlxTypedGroup;
import flixel.input.keyboard.FlxKey;
import flixel.math.FlxMath;
import flixel.text.FlxText;
import flixel.util.FlxColor;
import lime.utils.Assets;
class OptionsMenu extends MusicBeatState
{
var selector:FlxText;
var curSelected:Int = 0;
var controlsStrings:Array<String> = [];
private var grpControls:FlxTypedGroup<Alphabet>;
override function create()
{
var menuBG:FlxSprite = new FlxSprite().loadGraphic(AssetPaths.menuDesat__png);
var menuBG:FlxSprite = new FlxSprite().loadGraphic('assets/images/menuDesat.png');
controlsStrings = CoolUtil.coolTextFile('assets/data/controls.txt');
menuBG.color = 0xFFea71fd;
menuBG.setGraphicSize(Std.int(menuBG.width * 1.1));
menuBG.updateHitbox();
@ -16,14 +32,97 @@ class OptionsMenu extends MusicBeatState
menuBG.antialiasing = true;
add(menuBG);
grpControls = new FlxTypedGroup<Alphabet>();
add(grpControls);
for (i in 0...controlsStrings.length)
{
if (controlsStrings[i].indexOf('set') != -1)
{
var controlLabel:Alphabet = new Alphabet(0, (70 * i) + 30, controlsStrings[i].substring(3) + ': ' + controlsStrings[i + 1], true, false);
controlLabel.isMenuItem = true;
controlLabel.targetY = i;
grpControls.add(controlLabel);
}
// DONT PUT X IN THE FIRST PARAMETER OF new ALPHABET() !!
}
super.create();
}
override function update(elapsed:Float)
{
if (controls.BACK)
FlxG.switchState(new MainMenuState());
super.update(elapsed);
if (controls.ACCEPT)
{
changeBinding();
}
if (isSettingControl)
waitingInput();
else
{
if (controls.BACK)
FlxG.switchState(new MainMenuState());
if (controls.UP_P)
changeSelection(-1);
if (controls.DOWN_P)
changeSelection(1);
}
}
function waitingInput():Void
{
if (FlxG.keys.getIsDown().length > 0)
{
PlayerSettings.player1.controls.replaceBinding(Control.LEFT, Keys, FlxG.keys.getIsDown()[0].ID, null);
}
// PlayerSettings.player1.controls.replaceBinding(Control)
}
var isSettingControl:Bool = false;
function changeBinding():Void
{
if (!isSettingControl)
{
isSettingControl = true;
}
}
function changeSelection(change:Int = 0)
{
#if !switch
NGio.logEvent('Fresh');
#end
FlxG.sound.play('assets/sounds/scrollMenu' + TitleState.soundExt, 0.4);
curSelected += change;
if (curSelected < 0)
curSelected = grpControls.length - 1;
if (curSelected >= grpControls.length)
curSelected = 0;
// selector.y = (70 * curSelected) + 30;
var bullShit:Int = 0;
for (item in grpControls.members)
{
item.targetY = bullShit - curSelected;
bullShit++;
item.alpha = 0.6;
// item.setGraphicSize(Std.int(item.width * 0.8));
if (item.targetY == 0)
{
item.alpha = 1;
// item.setGraphicSize(Std.int(item.width));
}
}
}
}

View file

@ -0,0 +1,45 @@
package;
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.FlxSubState;
import flixel.text.FlxText;
import flixel.util.FlxColor;
import lime.app.Application;
class OutdatedSubState extends MusicBeatState
{
public static var leftState:Bool = false;
override function create()
{
super.create();
var bg:FlxSprite = new FlxSprite().makeGraphic(FlxG.width, FlxG.height, FlxColor.BLACK);
add(bg);
var ver = "v" + Application.current.meta.get('version');
var txt:FlxText = new FlxText(0, 0, FlxG.width,
"HEY! You're running an outdated version of the game!\nCurrent version is "
+ ver
+ " while the most recent version is "
+ NGio.GAME_VER
+ "! Press Space to go to itch.io, or ESCAPE to ignore this!!",
32);
txt.setFormat("VCR OSD Mono", 32, FlxColor.WHITE, CENTER);
txt.screenCenter();
add(txt);
}
override function update(elapsed:Float)
{
if (controls.ACCEPT)
{
FlxG.openURL("https://ninja-muffin24.itch.io/funkin");
}
if (controls.BACK)
{
leftState = true;
FlxG.switchState(new MainMenuState());
}
super.update(elapsed);
}
}

33
source/OverlayShader.hx Normal file
View file

@ -0,0 +1,33 @@
package;
import flixel.system.FlxAssets.FlxShader;
class OverlayShader extends FlxShader
{
@:glFragmentSource('
#pragma header
uniform vec4 uBlendColor;
vec3 blendLighten(base:Vec3, blend:Vec3) : Vec3 {
return mix(
1.0 - 2.0 * (1.0 - base) * (1.0 - blend),
2.0 * base * blend,
step( base, vec3(0.5) )
);
}
vec4 blendLighten(vec4 base, vec4 blend, float opacity)
{
return (blendLighten(base, blend) * opacity + base * (1.0 - opacity));
}
void main()
{
vec4 base = texture2D(bitmap, openfl_TextureCoordv);
gl_FragColor = blendLighten(base, uBlendColor, uBlendColor.a);
}')
public function new()
{
super();
}
}

View file

@ -46,7 +46,7 @@ class PauseSubState extends MusicBeatSubstate
changeSelection();
cameras = [FlxG.cameras.list[1]];
cameras = [FlxG.cameras.list[FlxG.cameras.list.length - 1]];
}
override function update(elapsed:Float)

File diff suppressed because it is too large Load diff

View file

@ -8,6 +8,7 @@ typedef SwagSection =
var mustHitSection:Bool;
var bpm:Int;
var changeBPM:Bool;
var altAnim:Bool;
}
class Section

View file

@ -58,10 +58,6 @@ class Song
// LOL GOING THROUGH THE BULLSHIT TO CLEAN IDK WHATS STRANGE
}
var swagShit:SwagSong = cast Json.parse(rawJson).song;
swagShit.validScore = true;
trace(swagShit.notes[0]);
// FIX THE CASTING ON WINDOWS/NATIVE
// Windows???
// trace(songData);
@ -80,6 +76,13 @@ class Song
daBpm = songData.bpm;
daSectionLengths = songData.sectionLengths; */
return parseJSONshit(rawJson);
}
public static function parseJSONshit(rawJson:String):SwagSong
{
var swagShit:SwagSong = cast Json.parse(rawJson).song;
swagShit.validScore = true;
return swagShit;
}
}

View file

@ -8,6 +8,7 @@ import flixel.group.FlxGroup;
import flixel.math.FlxMath;
import flixel.text.FlxText;
import flixel.tweens.FlxTween;
import flixel.util.FlxColor;
import flixel.util.FlxTimer;
import lime.net.curl.CURLCode;
@ -21,18 +22,37 @@ class StoryMenuState extends MusicBeatState
['Tutorial'],
['Bopeebo', 'Fresh', 'Dadbattle'],
['Spookeez', 'South'],
['Pico', 'Philly', "Blammed"]
['Pico', 'Philly', "Blammed"],
['Satin-Panties', "High", "Milf"],
['Cocoa', 'Eggnog', 'Winter-Horrorland'],
['Senpai', 'Roses', 'Thorns']
];
var curDifficulty:Int = 1;
public static var weekUnlocked:Array<Bool> = [true, true, false, false];
public static var weekUnlocked:Array<Bool> = [true, true, true, true, true, true, true];
var weekCharacters:Array<Dynamic> = [
['dad', 'bf', 'gf'],
['dad', 'bf', 'gf'],
['spooky', 'bf', 'gf'],
['pico', 'bf', 'gf']
['pico', 'bf', 'gf'],
['mom', 'bf', 'gf'],
['parents-christmas', 'bf', 'gf'],
['senpai', 'bf', 'gf']
];
var weekNames:Array<String> = [
"",
"Daddy Dearest",
"Spooky Month",
"PICO",
"MOMMY MUST MURDER",
"RED SNOW",
"hating simulator ft. moawling"
];
var txtWeekTitle:FlxText;
var curWeek:Int = 0;
var txtTracklist:FlxText;
@ -60,18 +80,25 @@ class StoryMenuState extends MusicBeatState
scoreText = new FlxText(10, 10, 0, "SCORE: 49324858", 36);
scoreText.setFormat("VCR OSD Mono", 32);
txtWeekTitle = new FlxText(FlxG.width * 0.7, 10, 0, "", 32);
txtWeekTitle.setFormat("VCR OSD Mono", 32, FlxColor.WHITE, RIGHT);
txtWeekTitle.alpha = 0.7;
var rankText:FlxText = new FlxText(0, 10);
rankText.text = 'RANK: GREAT';
rankText.setFormat("assets/fonts/vcr.ttf", 32);
rankText.size = scoreText.size;
rankText.screenCenter(X);
var ui_tex = FlxAtlasFrames.fromSparrow(AssetPaths.campaign_menu_UI_assets__png, AssetPaths.campaign_menu_UI_assets__xml);
var ui_tex = FlxAtlasFrames.fromSparrow('assets/images/campaign_menu_UI_assets.png', 'assets/images/campaign_menu_UI_assets.xml');
var yellowBG:FlxSprite = new FlxSprite(0, 56).makeGraphic(FlxG.width, 400, 0xFFF9CF51);
grpWeekText = new FlxTypedGroup<MenuItem>();
add(grpWeekText);
var blackBarThingie:FlxSprite = new FlxSprite().makeGraphic(FlxG.width, 56, FlxColor.BLACK);
add(blackBarThingie);
grpWeekCharacters = new FlxTypedGroup<MenuCharacter>();
grpLocks = new FlxTypedGroup<FlxSprite>();
@ -124,9 +151,10 @@ class StoryMenuState extends MusicBeatState
weekCharacterThing.setGraphicSize(Std.int(weekCharacterThing.width * 0.5));
weekCharacterThing.updateHitbox();
case 'pico':
weekCharacterThing.y += 170;
weekCharacterThing.flipX = true;
weekCharacterThing.x -= 40;
case 'parents-christmas':
weekCharacterThing.setGraphicSize(Std.int(weekCharacterThing.width * 0.9));
weekCharacterThing.updateHitbox();
}
grpWeekCharacters.add(weekCharacterThing);
@ -173,6 +201,7 @@ class StoryMenuState extends MusicBeatState
add(txtTracklist);
// add(rankText);
add(scoreText);
add(txtWeekTitle);
updateText();
@ -187,6 +216,10 @@ class StoryMenuState extends MusicBeatState
lerpScore = Math.floor(FlxMath.lerp(lerpScore, intendedScore, 0.5));
scoreText.text = "WEEK SCORE:" + lerpScore;
txtWeekTitle.text = weekNames[curWeek].toUpperCase();
txtWeekTitle.x = FlxG.width - (txtWeekTitle.width + 10);
// FlxG.watch.addQuick('font', scoreText.font);
difficultySelectors.visible = weekUnlocked[curWeek];
@ -360,6 +393,30 @@ class StoryMenuState extends MusicBeatState
grpWeekCharacters.members[2].animation.play(weekCharacters[curWeek][2]);
txtTracklist.text = "Tracks\n";
switch (grpWeekCharacters.members[0].animation.curAnim.name)
{
case 'parents-christmas':
grpWeekCharacters.members[0].offset.set(200, 200);
grpWeekCharacters.members[0].setGraphicSize(Std.int(grpWeekCharacters.members[0].width * 0.99));
case 'senpai':
grpWeekCharacters.members[0].offset.set(130, 0);
grpWeekCharacters.members[0].setGraphicSize(Std.int(grpWeekCharacters.members[0].width * 1.4));
case 'mom':
grpWeekCharacters.members[0].offset.set(100, 200);
grpWeekCharacters.members[0].setGraphicSize(Std.int(grpWeekCharacters.members[0].width * 1));
case 'dad':
grpWeekCharacters.members[0].offset.set(120, 200);
grpWeekCharacters.members[0].setGraphicSize(Std.int(grpWeekCharacters.members[0].width * 1));
default:
grpWeekCharacters.members[0].offset.set(100, 100);
grpWeekCharacters.members[0].setGraphicSize(Std.int(grpWeekCharacters.members[0].width * 1));
// grpWeekCharacters.members[0].updateHitbox();
}
var stringThing:Array<String> = weekData[curWeek];
for (i in stringThing)

View file

@ -20,7 +20,12 @@ import flixel.tweens.FlxEase;
import flixel.tweens.FlxTween;
import flixel.util.FlxColor;
import flixel.util.FlxTimer;
import lime.utils.Assets;
import io.newgrounds.NG;
import lime.app.Application;
import openfl.Assets;
import polymod.Polymod;
using StringTools;
class TitleState extends MusicBeatState
{
@ -39,6 +44,8 @@ class TitleState extends MusicBeatState
override public function create():Void
{
Polymod.init({modRoot: "mods", dirs: ['introMod']});
#if (!web)
TitleState.soundExt = '.ogg';
#end
@ -51,6 +58,8 @@ class TitleState extends MusicBeatState
super.create();
NGio.noLogin(APIStuff.API);
#if ng
var ng:NGio = new NGio(APIStuff.API, APIStuff.EncKey);
trace('NEWGROUNDS LOL');
@ -62,7 +71,9 @@ class TitleState extends MusicBeatState
if (FlxG.save.data.weekUnlocked != null)
{
StoryMenuState.weekUnlocked = FlxG.save.data.weekUnlocked;
// FIX LATER!!!
// WEEK UNLOCK PROGRESSION!!
// StoryMenuState.weekUnlocked = FlxG.save.data.weekUnlocked;
if (StoryMenuState.weekUnlocked.length < 4)
StoryMenuState.weekUnlocked.insert(0, true);
@ -72,8 +83,10 @@ class TitleState extends MusicBeatState
StoryMenuState.weekUnlocked[0] = true;
}
#if SKIP_TO_PLAYSTATE
FlxG.switchState(new StoryMenuState());
#if FREEPLAY
FlxG.switchState(new FreeplayState());
#elseif CHARTING
FlxG.switchState(new ChartingState());
#else
startIntro();
#end
@ -93,16 +106,17 @@ class TitleState extends MusicBeatState
diamond.destroyOnNoUse = false;
FlxTransitionableState.defaultTransIn = new TransitionData(FADE, FlxColor.BLACK, 1, new FlxPoint(0, -1), {asset: diamond, width: 32, height: 32},
new FlxRect(0, 0, FlxG.width, FlxG.height));
new FlxRect(-200, -200, FlxG.width * 1.4, FlxG.height * 1.4));
FlxTransitionableState.defaultTransOut = new TransitionData(FADE, FlxColor.BLACK, 0.7, new FlxPoint(0, 1),
{asset: diamond, width: 32, height: 32}, new FlxRect(0, 0, FlxG.width, FlxG.height));
FlxTransitionableState.defaultTransIn.tileData = {asset: diamond, width: 32, height: 32};
FlxTransitionableState.defaultTransOut.tileData = {asset: diamond, width: 32, height: 32};
{asset: diamond, width: 32, height: 32}, new FlxRect(-200, -200, FlxG.width * 1.4, FlxG.height * 1.4));
transIn = FlxTransitionableState.defaultTransIn;
transOut = FlxTransitionableState.defaultTransOut;
// HAD TO MODIFY SOME BACKEND SHIT
// IF THIS PR IS HERE IF ITS ACCEPTED UR GOOD TO GO
// https://github.com/HaxeFlixel/flixel-addons/pull/348
// var music:FlxSound = new FlxSound();
// music.loadStream('assets/music/freakyMenu' + TitleState.soundExt);
// FlxG.sound.list.add(music);
@ -122,7 +136,7 @@ class TitleState extends MusicBeatState
add(bg);
logoBl = new FlxSprite(-150, -100);
logoBl.frames = FlxAtlasFrames.fromSparrow(AssetPaths.logoBumpin__png, AssetPaths.logoBumpin__xml);
logoBl.frames = FlxAtlasFrames.fromSparrow('assets/images/logoBumpin.png', 'assets/images/logoBumpin.xml');
logoBl.antialiasing = true;
logoBl.animation.addByPrefix('bump', 'logo bumpin', 24);
logoBl.animation.play('bump');
@ -131,7 +145,7 @@ class TitleState extends MusicBeatState
// logoBl.color = FlxColor.BLACK;
gfDance = new FlxSprite(FlxG.width * 0.4, FlxG.height * 0.07);
gfDance.frames = FlxAtlasFrames.fromSparrow(AssetPaths.gfDanceTitle__png, AssetPaths.gfDanceTitle__xml);
gfDance.frames = FlxAtlasFrames.fromSparrow('assets/images/gfDanceTitle.png', 'assets/images/gfDanceTitle.xml');
gfDance.animation.addByIndices('danceLeft', 'gfDance', [30, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], "", 24, false);
gfDance.animation.addByIndices('danceRight', 'gfDance', [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], "", 24, false);
gfDance.antialiasing = true;
@ -139,7 +153,7 @@ class TitleState extends MusicBeatState
add(logoBl);
titleText = new FlxSprite(100, FlxG.height * 0.8);
titleText.frames = FlxAtlasFrames.fromSparrow(AssetPaths.titleEnter__png, AssetPaths.titleEnter__xml);
titleText.frames = FlxAtlasFrames.fromSparrow('assets/images/titleEnter.png', 'assets/images/titleEnter.xml');
titleText.animation.addByPrefix('idle', "Press Enter to Begin", 24);
titleText.animation.addByPrefix('press', "ENTER PRESSED", 24);
titleText.antialiasing = true;
@ -148,7 +162,7 @@ class TitleState extends MusicBeatState
// titleText.screenCenter(X);
add(titleText);
var logo:FlxSprite = new FlxSprite().loadGraphic(AssetPaths.logo__png);
var logo:FlxSprite = new FlxSprite().loadGraphic('assets/images/logo.png');
logo.screenCenter();
logo.antialiasing = true;
// add(logo);
@ -170,7 +184,7 @@ class TitleState extends MusicBeatState
credTextShit.visible = false;
ngSpr = new FlxSprite(0, FlxG.height * 0.52).loadGraphic(AssetPaths.newgrounds_logo__png);
ngSpr = new FlxSprite(0, FlxG.height * 0.52).loadGraphic('assets/images/newgrounds_logo.png');
add(ngSpr);
ngSpr.visible = false;
ngSpr.setGraphicSize(Std.int(ngSpr.width * 0.8));
@ -252,7 +266,19 @@ class TitleState extends MusicBeatState
new FlxTimer().start(2, function(tmr:FlxTimer)
{
FlxG.switchState(new MainMenuState());
// Check if version is outdated
var version:String = "v" + Application.current.meta.get('version');
if (version.trim() != NGio.GAME_VER.trim() && !OutdatedSubState.leftState)
{
trace('OLD VERSION!');
FlxG.switchState(new OutdatedSubState());
}
else
{
FlxG.switchState(new MainMenuState());
}
});
// FlxG.sound.play('assets/music/titleShoot' + TitleState.soundExt, 0.7);
}

133
source/WiggleEffect.hx Normal file
View file

@ -0,0 +1,133 @@
package;
// STOLEN FROM HAXEFLIXEL DEMO LOL
import flixel.system.FlxAssets.FlxShader;
enum WiggleEffectType
{
DREAMY;
WAVY;
HEAT_WAVE_HORIZONTAL;
HEAT_WAVE_VERTICAL;
FLAG;
}
class WiggleEffect
{
public var shader(default, null):WiggleShader = new WiggleShader();
public var effectType(default, set):WiggleEffectType = DREAMY;
public var waveSpeed(default, set):Float = 0;
public var waveFrequency(default, set):Float = 0;
public var waveAmplitude(default, set):Float = 0;
public function new():Void
{
shader.uTime.value = [0];
}
public function update(elapsed:Float):Void
{
shader.uTime.value[0] += elapsed;
}
function set_effectType(v:WiggleEffectType):WiggleEffectType
{
effectType = v;
shader.effectType.value = [WiggleEffectType.getConstructors().indexOf(Std.string(v))];
return v;
}
function set_waveSpeed(v:Float):Float
{
waveSpeed = v;
shader.uSpeed.value = [waveSpeed];
return v;
}
function set_waveFrequency(v:Float):Float
{
waveFrequency = v;
shader.uFrequency.value = [waveFrequency];
return v;
}
function set_waveAmplitude(v:Float):Float
{
waveAmplitude = v;
shader.uWaveAmplitude.value = [waveAmplitude];
return v;
}
}
class WiggleShader extends FlxShader
{
@:glFragmentSource('
#pragma header
//uniform float tx, ty; // x,y waves phase
uniform float uTime;
const int EFFECT_TYPE_DREAMY = 0;
const int EFFECT_TYPE_WAVY = 1;
const int EFFECT_TYPE_HEAT_WAVE_HORIZONTAL = 2;
const int EFFECT_TYPE_HEAT_WAVE_VERTICAL = 3;
const int EFFECT_TYPE_FLAG = 4;
uniform int effectType;
/**
* How fast the waves move over time
*/
uniform float uSpeed;
/**
* Number of waves over time
*/
uniform float uFrequency;
/**
* How much the pixels are going to stretch over the waves
*/
uniform float uWaveAmplitude;
vec2 sineWave(vec2 pt)
{
float x = 0.0;
float y = 0.0;
if (effectType == EFFECT_TYPE_DREAMY)
{
float offsetX = sin(pt.y * uFrequency + uTime * uSpeed) * uWaveAmplitude;
pt.x += offsetX; // * (pt.y - 1.0); // <- Uncomment to stop bottom part of the screen from moving
}
else if (effectType == EFFECT_TYPE_WAVY)
{
float offsetY = sin(pt.x * uFrequency + uTime * uSpeed) * uWaveAmplitude;
pt.y += offsetY; // * (pt.y - 1.0); // <- Uncomment to stop bottom part of the screen from moving
}
else if (effectType == EFFECT_TYPE_HEAT_WAVE_HORIZONTAL)
{
x = sin(pt.x * uFrequency + uTime * uSpeed) * uWaveAmplitude;
}
else if (effectType == EFFECT_TYPE_HEAT_WAVE_VERTICAL)
{
y = sin(pt.y * uFrequency + uTime * uSpeed) * uWaveAmplitude;
}
else if (effectType == EFFECT_TYPE_FLAG)
{
y = sin(pt.y * uFrequency + 10.0 * pt.x + uTime * uSpeed) * uWaveAmplitude;
x = sin(pt.x * uFrequency + 5.0 * pt.y + uTime * uSpeed) * uWaveAmplitude;
}
return vec2(pt.x + x, pt.y + y);
}
void main()
{
vec2 uv = sineWave(openfl_TextureCoordv);
gl_FragColor = texture2D(bitmap, uv);
}')
public function new()
{
super();
}
}