1
.vscode/.temp
vendored
Normal file
@ -0,0 +1 @@
|
||||
TBA: tasks.json
|
21
.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"type": "lime",
|
||||
"command": "test",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "lime",
|
||||
"command": "build",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
Before Width: | Height: | Size: 560 KiB After Width: | Height: | Size: 443 KiB |
@ -57,6 +57,7 @@
|
||||
<library name="week4" preload="true" />
|
||||
<library name="week5" preload="true" />
|
||||
<library name="week6" preload="true" />
|
||||
<library name="sm" preload="true" />
|
||||
</section>
|
||||
|
||||
<section if="NO_PRELOAD_ALL">
|
||||
@ -69,6 +70,7 @@
|
||||
<library name="week4" preload="false" />
|
||||
<library name="week5" preload="false" />
|
||||
<library name="week6" preload="false" />
|
||||
<library name="sm" preload="false" />
|
||||
</section>
|
||||
|
||||
<assets path="assets/songs" library="songs" exclude="*.ogg" if="web"/>
|
||||
@ -89,6 +91,8 @@
|
||||
<assets path="assets/week5" library="week5" exclude="*.mp3" unless="web"/>
|
||||
<assets path="assets/week6" library="week6" exclude="*.ogg" if="web"/>
|
||||
<assets path="assets/week6" library="week6" exclude="*.mp3" unless="web"/>
|
||||
<assets path="assets/sm" library="sm" exclude="*.ogg" if="web"/>
|
||||
<assets path="assets/sm" library="sm" exclude="*.mp3" unless="web"/>
|
||||
|
||||
<assets path='example_mods' rename='mods' embed='false'/>
|
||||
<assets path='art/readme.txt' rename='do NOT readme.txt' />
|
||||
@ -160,6 +164,8 @@
|
||||
<!--Disable the Flixel core debugger. Automatically gets set whenever you compile in release mode!-->
|
||||
<haxedef name="FLX_NO_DEBUG" unless="debug" />
|
||||
|
||||
<haxedef name="HXCPP_GC_BIG_BLOCKS"/>
|
||||
|
||||
<!--Enable this for Nape release builds for a serious peformance improvement-->
|
||||
<haxedef name="NAPE_RELEASE_BUILD" unless="debug" />
|
||||
|
||||
|
29
README.md
@ -24,17 +24,23 @@ If you're looking for documentation, changelogs, or guides, you can find those o
|
||||
|
||||
# Previews ([skip](#features))
|
||||
|
||||
 
|
||||

|
||||
|
||||

|
||||

|
||||
|
||||

|
||||

|
||||
|
||||

|
||||

|
||||
|
||||

|
||||

|
||||
|
||||

|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
# Features
|
||||
|
||||
@ -43,12 +49,15 @@ If you're looking for documentation, changelogs, or guides, you can find those o
|
||||
- **More information during gameplay**
|
||||
- While you're playing, we show you information about how you're doing, such as your accuracy, combo break count, notes per second, and your grade/rating.
|
||||
- **Customizable keybinds**
|
||||
- Instead of being forced to use WASD and the arrow keys, you can customize the keybinds to any keys you want!
|
||||
- Instead of being forced to use WASD and the arrow keys, you can set any keybinds you want!
|
||||
- **Replays** (in beta)
|
||||
- Have you ever gotten a crazy score but didn't record? The replay system solves that: it automatically saves a "replay" of your gameplay every time you complete a song, which you can play back inside of the game.
|
||||
- Replays just store information about what you're doing, they don't actually record the screen -- so they take up way less space on your disk than videos.
|
||||
- **Audio offset**
|
||||
- If your headphones are delayed, you can set an offset in the options menu to line the game up with the delay and play with synced audio like intended.
|
||||
- If your speakers or headphones are delayed, you can set an offset in the options menu to line the game up with the delay and play with synced audio like intended!
|
||||
- **And much, much more!**
|
||||
- There's so much more in store than just what's listed here! If you can imagine a quality of life feature, it's probably
|
||||
either already included in Kade Engine or is being worked on!
|
||||
|
||||
# Credits
|
||||
### Friday Night Funkin'
|
||||
@ -65,4 +74,6 @@ This game was made with love to Newgrounds and its community. Extra love to Tom
|
||||
### Shoutouts
|
||||
- [GWebDev](https://github.com/GrowtopiaFli) - Video Code
|
||||
- [Rozebud](https://github.com/ThatRozebudDude) - Ideas (that I stole)
|
||||
- [Puyo](https://github.com/daniel11420) - Setting up appveyor and a lot of other help
|
||||
- [Puyo](https://github.com/puyoxyz) - Setting up appveyor and a lot of other help
|
||||
- [Smokey](https://github.com/Smokey555) - telling me that I should do the tricky asset loading
|
||||
- [Poco](https://github.com/poco0317) - math degree (aka most of the fucking math in this project)
|
||||
|
@ -9,7 +9,7 @@ install:
|
||||
- cd /home/appveyor
|
||||
- sudo add-apt-repository ppa:haxe/releases -y
|
||||
- sudo apt update
|
||||
- sudo apt install neko tar gcc-multilib g++-multilib -y
|
||||
- sudo apt install neko tar gcc-7 g++-7 gcc-7-multilib g++-7-multilib -y
|
||||
- wget https://github.com/HaxeFoundation/haxe/releases/download/4.1.5/haxe-4.1.5-linux64.tar.gz
|
||||
- mkdir $HAXE_INSTALLDIR
|
||||
- tar -xf haxe-4.1.5-linux64.tar.gz -C $HAXE_INSTALLDIR
|
||||
|
@ -37,6 +37,9 @@ install:
|
||||
- haxelib run lime rebuild extension-webm windows
|
||||
- haxelib install linc_luajit
|
||||
- haxelib install actuate
|
||||
#- haxelib git extension-webm https://github.com/KadeDev/extension-webm
|
||||
#- haxelib run lime rebuild extension-webm windows
|
||||
#why here's dublicate lmao
|
||||
- haxelib list
|
||||
|
||||
# No tests idk lol
|
||||
|
BIN
art/readme/KadeEngineDialogue.png
Normal file
After Width: | Height: | Size: 243 KiB |
BIN
art/readme/KadeEngineFreeplay.png
Normal file
After Width: | Height: | Size: 1.3 MiB |
BIN
art/readme/KadeEngineOptions.png
Normal file
After Width: | Height: | Size: 1.3 MiB |
BIN
art/readme/KadeEnginePauseScreen.png
Normal file
After Width: | Height: | Size: 348 KiB |
BIN
art/readme/KadeEnginePixelGameplay.png
Normal file
After Width: | Height: | Size: 271 KiB |
BIN
art/readme/KadeEngineReplayLoader.png
Normal file
After Width: | Height: | Size: 1.3 MiB |
BIN
art/readme/KadeEngineResultsScreen.png
Normal file
After Width: | Height: | Size: 753 KiB |
BIN
art/readme/KadeEngineTitleScreen.png
Normal file
After Width: | Height: | Size: 942 KiB |
BIN
art/readme/KadeEngineWeekSelect.png
Normal file
After Width: | Height: | Size: 458 KiB |
@ -1,4 +1,4 @@
|
||||
Tutorial:gf:1
|
||||
Tutorial:gf:0
|
||||
Bopeebo:dad:1
|
||||
Fresh:dad:1
|
||||
Dad Battle:dad:1
|
||||
|
1
assets/preload/data/test/test.json
Normal file
7
assets/preload/data/weekNames.txt
Normal file
@ -0,0 +1,7 @@
|
||||
Tutorial
|
||||
Daddy Dearest
|
||||
Spooky Month
|
||||
PICO
|
||||
MOMMY MUST MURDER
|
||||
RED SNOW
|
||||
Hating Simulator ft. Moawling
|
Before Width: | Height: | Size: 144 KiB After Width: | Height: | Size: 193 KiB |
BIN
assets/preload/images/stepmania-icon.png
Normal file
After Width: | Height: | Size: 7.0 KiB |
Before Width: | Height: | Size: 127 KiB After Width: | Height: | Size: 696 KiB |
@ -1,92 +1,92 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextureAtlas imagePath="NOTE_assets.png">
|
||||
<!-- Created with Adobe Animate version 21.0.0.35450 -->
|
||||
<!-- http://www.adobe.com/products/animate.html -->
|
||||
<SubTexture name="arrow static instance 10000" x="488" y="238" width="155" height="158"/>
|
||||
<SubTexture name="arrow static instance 20000" x="647" y="238" width="157" height="155"/>
|
||||
<SubTexture name="arrow static instance 30000" x="808" y="238" width="155" height="157"/>
|
||||
<SubTexture name="arrow static instance 40000" x="323" y="240" width="157" height="154"/>
|
||||
<SubTexture name="blue hold end instance 10000" x="1062" y="452" width="51" height="64"/>
|
||||
<SubTexture name="blue hold piece instance 10000" x="1282" y="457" width="51" height="44"/>
|
||||
<SubTexture name="blue instance 10000" x="0" y="240" width="158" height="154"/>
|
||||
<SubTexture name="down confirm instance 10000" x="0" y="0" width="240" height="236"/>
|
||||
<SubTexture name="down confirm instance 10001" x="244" y="0" width="240" height="236"/>
|
||||
<SubTexture name="down confirm instance 10002" x="1206" y="235" width="221" height="218" frameX="-6" frameY="-12" frameWidth="240" frameHeight="236"/>
|
||||
<SubTexture name="down confirm instance 10003" x="1206" y="235" width="221" height="218" frameX="-6" frameY="-12" frameWidth="240" frameHeight="236"/>
|
||||
<SubTexture name="down press instance 10000" x="805" y="399" width="143" height="139" frameX="-4" frameY="-3" frameWidth="150" frameHeight="146"/>
|
||||
<SubTexture name="down press instance 10001" x="805" y="399" width="143" height="139" frameX="-4" frameY="-3" frameWidth="150" frameHeight="146"/>
|
||||
<SubTexture name="down press instance 10002" x="1898" y="0" width="150" height="146"/>
|
||||
<SubTexture name="down press instance 10003" x="1898" y="0" width="150" height="146"/>
|
||||
<SubTexture name="green hold end instance 10000" x="1007" y="452" width="51" height="64"/>
|
||||
<SubTexture name="green hold piece instance 10000" x="1227" y="457" width="51" height="44"/>
|
||||
<SubTexture name="green instance 10000" x="162" y="240" width="157" height="154"/>
|
||||
<SubTexture name="left confirm instance 10000" x="972" y="0" width="230" height="232"/>
|
||||
<SubTexture name="left confirm instance 10001" x="1438" y="233" width="220" height="222" frameX="-5" frameY="-5" frameWidth="230" frameHeight="232"/>
|
||||
<SubTexture name="left confirm instance 10002" x="1438" y="0" width="227" height="229" frameX="-2" frameY="-1" frameWidth="230" frameHeight="232"/>
|
||||
<SubTexture name="left confirm instance 10003" x="1438" y="0" width="227" height="229" frameX="-2" frameY="-1" frameWidth="230" frameHeight="232"/>
|
||||
<SubTexture name="left press instance 10000" x="1898" y="449" width="139" height="142" frameX="-4" frameY="-3" frameWidth="146" frameHeight="149"/>
|
||||
<SubTexture name="left press instance 10001" x="1898" y="449" width="139" height="142" frameX="-4" frameY="-3" frameWidth="146" frameHeight="149"/>
|
||||
<SubTexture name="left press instance 10002" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10003" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10004" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10005" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10006" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10007" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10008" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10009" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10010" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10011" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10012" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10013" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10014" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10015" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10016" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10017" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10018" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="left press instance 10019" x="1898" y="150" width="146" height="149"/>
|
||||
<SubTexture name="pruple end hold instance 10000" x="1117" y="452" width="51" height="64"/>
|
||||
<SubTexture name="purple hold piece instance 10000" x="1337" y="457" width="51" height="44"/>
|
||||
<SubTexture name="purple instance 10000" x="0" y="398" width="154" height="157"/>
|
||||
<SubTexture name="red hold end instance 10000" x="952" y="452" width="51" height="64"/>
|
||||
<SubTexture name="red hold piece instance 10000" x="1172" y="457" width="51" height="44"/>
|
||||
<SubTexture name="red instance 10000" x="647" y="397" width="154" height="157"/>
|
||||
<SubTexture name="right confirm instance 10000" x="1669" y="0" width="225" height="228" frameX="-1" frameY="-2" frameWidth="228" frameHeight="231"/>
|
||||
<SubTexture name="right confirm instance 10001" x="1669" y="232" width="225" height="228" frameX="-1" frameY="-2" frameWidth="228" frameHeight="231"/>
|
||||
<SubTexture name="right confirm instance 10002" x="1206" y="0" width="228" height="231"/>
|
||||
<SubTexture name="right confirm instance 10003" x="1206" y="0" width="228" height="231"/>
|
||||
<SubTexture name="right press instance 10000" x="469" y="400" width="139" height="142" frameX="-3" frameY="-7" frameWidth="149" frameHeight="152"/>
|
||||
<SubTexture name="right press instance 10001" x="469" y="400" width="139" height="142" frameX="-3" frameY="-7" frameWidth="149" frameHeight="152"/>
|
||||
<SubTexture name="right press instance 10002" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10003" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10004" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10005" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10006" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10007" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10008" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10009" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10010" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10011" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10012" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10013" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10014" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10015" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10016" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10017" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10018" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10019" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10020" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10021" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10022" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10023" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10024" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10025" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="right press instance 10026" x="316" y="398" width="149" height="152"/>
|
||||
<SubTexture name="up confirm instance 10000" x="488" y="0" width="238" height="234"/>
|
||||
<SubTexture name="up confirm instance 10001" x="730" y="0" width="238" height="234"/>
|
||||
<SubTexture name="up confirm instance 10002" x="972" y="236" width="216" height="212" frameX="-11" frameY="-11" frameWidth="238" frameHeight="234"/>
|
||||
<SubTexture name="up confirm instance 10003" x="972" y="236" width="216" height="212" frameX="-11" frameY="-11" frameWidth="238" frameHeight="234"/>
|
||||
<SubTexture name="up press instance 10000" x="1898" y="303" width="144" height="142" frameX="-6" frameY="-4" frameWidth="154" frameHeight="151"/>
|
||||
<SubTexture name="up press instance 10001" x="1898" y="303" width="144" height="142" frameX="-6" frameY="-4" frameWidth="154" frameHeight="151"/>
|
||||
<SubTexture name="up press instance 10002" x="158" y="398" width="154" height="151"/>
|
||||
<SubTexture name="up press instance 10003" x="158" y="398" width="154" height="151"/>
|
||||
<SubTexture name="arrowDOWN0000" x="10" y="255" width="157" height="154"/>
|
||||
<SubTexture name="arrowLEFT0000" x="672" y="416" width="154" height="157"/>
|
||||
<SubTexture name="arrowRIGHT0000" x="10" y="419" width="154" height="157"/>
|
||||
<SubTexture name="arrowUP0000" x="177" y="255" width="157" height="154"/>
|
||||
<SubTexture name="blue alone0000" x="506" y="252" width="157" height="154"/>
|
||||
<SubTexture name="blue hold0000" x="1940" y="306" width="50" height="44"/>
|
||||
<SubTexture name="blue tail0000" x="1940" y="10" width="50" height="64"/>
|
||||
<SubTexture name="down confirm0000" x="10" y="10" width="238" height="235"/>
|
||||
<SubTexture name="down confirm0001" x="258" y="10" width="238" height="235"/>
|
||||
<SubTexture name="down confirm0002" x="1236" y="250" width="220" height="217" frameX="-6" frameY="-12" frameWidth="238" frameHeight="235"/>
|
||||
<SubTexture name="down confirm0003" x="1236" y="250" width="220" height="217" frameX="-6" frameY="-12" frameWidth="238" frameHeight="235"/>
|
||||
<SubTexture name="down press0000" x="1150" y="477" width="142" height="140" frameX="-4" frameY="-2" frameWidth="149" frameHeight="146"/>
|
||||
<SubTexture name="down press0001" x="1150" y="477" width="142" height="140" frameX="-4" frameY="-2" frameWidth="149" frameHeight="146"/>
|
||||
<SubTexture name="down press0002" x="344" y="255" width="149" height="146"/>
|
||||
<SubTexture name="down press0003" x="344" y="255" width="149" height="146"/>
|
||||
<SubTexture name="green alone0000" x="673" y="252" width="157" height="154"/>
|
||||
<SubTexture name="green hold0000" x="1940" y="360" width="50" height="44"/>
|
||||
<SubTexture name="green tail0000" x="1940" y="84" width="50" height="64"/>
|
||||
<SubTexture name="left confirm0000" x="998" y="10" width="228" height="231"/>
|
||||
<SubTexture name="left confirm0001" x="1472" y="248" width="218" height="221" frameX="-5" frameY="-5" frameWidth="228" frameHeight="231"/>
|
||||
<SubTexture name="left confirm0002" x="1472" y="10" width="225" height="228" frameX="-2" frameY="-1" frameWidth="228" frameHeight="231"/>
|
||||
<SubTexture name="left confirm0003" x="1472" y="10" width="225" height="228" frameX="-2" frameY="-1" frameWidth="228" frameHeight="231"/>
|
||||
<SubTexture name="left press0000" x="1302" y="477" width="140" height="142" frameX="-3" frameY="-3" frameWidth="146" frameHeight="149"/>
|
||||
<SubTexture name="left press0001" x="1302" y="477" width="140" height="142" frameX="-3" frameY="-3" frameWidth="146" frameHeight="149"/>
|
||||
<SubTexture name="left press0002" x="840" y="413" width="146" height="149"/>
|
||||
<SubTexture name="left press0003" x="840" y="413" width="146" height="149"/>
|
||||
<SubTexture name="left press0004" x="840" y="413" width="146" height="149"/>
|
||||
<SubTexture name="left press0005" x="840" y="413" width="146" height="149"/>
|
||||
<SubTexture name="left press0006" x="840" y="413" width="146" height="149"/>
|
||||
<SubTexture name="left press0007" x="840" y="413" width="146" height="149"/>
|
||||
<SubTexture name="left press0008" x="840" y="413" width="146" height="149"/>
|
||||
<SubTexture name="left press0009" x="840" y="413" width="146" height="149"/>
|
||||
<SubTexture name="left press0010" x="840" y="413" width="146" height="149"/>
|
||||
<SubTexture name="left press0011" x="840" y="413" width="146" height="149"/>
|
||||
<SubTexture name="left press0012" x="840" y="413" width="146" height="149"/>
|
||||
<SubTexture name="left press0013" x="840" y="413" width="146" height="149"/>
|
||||
<SubTexture name="left press0014" x="840" y="413" width="146" height="149"/>
|
||||
<SubTexture name="left press0015" x="840" y="413" width="146" height="149"/>
|
||||
<SubTexture name="left press0016" x="840" y="413" width="146" height="149"/>
|
||||
<SubTexture name="left press0017" x="840" y="413" width="146" height="149"/>
|
||||
<SubTexture name="left press0018" x="840" y="413" width="146" height="149"/>
|
||||
<SubTexture name="left press0019" x="840" y="413" width="146" height="149"/>
|
||||
<SubTexture name="purple alone0000" x="344" y="416" width="154" height="157"/>
|
||||
<SubTexture name="purple hold0000" x="1940" y="414" width="50" height="44"/>
|
||||
<SubTexture name="purple tail0000" x="1940" y="158" width="50" height="64"/>
|
||||
<SubTexture name="red alone0000" x="508" y="416" width="154" height="157"/>
|
||||
<SubTexture name="red hold0000" x="1940" y="468" width="50" height="44"/>
|
||||
<SubTexture name="red tail0000" x="1940" y="232" width="50" height="64"/>
|
||||
<SubTexture name="right confirm0000" x="1707" y="10" width="223" height="226" frameX="-1" frameY="-3" frameWidth="226" frameHeight="230"/>
|
||||
<SubTexture name="right confirm0001" x="1707" y="246" width="223" height="226" frameX="-1" frameY="-3" frameWidth="226" frameHeight="230"/>
|
||||
<SubTexture name="right confirm0002" x="1236" y="10" width="226" height="230"/>
|
||||
<SubTexture name="right confirm0003" x="1236" y="10" width="226" height="230"/>
|
||||
<SubTexture name="right press0000" x="1452" y="479" width="138" height="141" frameX="-3" frameY="-7" frameWidth="148" frameHeight="151"/>
|
||||
<SubTexture name="right press0001" x="1452" y="479" width="138" height="141" frameX="-3" frameY="-7" frameWidth="148" frameHeight="151"/>
|
||||
<SubTexture name="right press0002" x="840" y="252" width="148" height="151"/>
|
||||
<SubTexture name="right press0003" x="840" y="252" width="148" height="151"/>
|
||||
<SubTexture name="right press0004" x="840" y="252" width="148" height="151"/>
|
||||
<SubTexture name="right press0005" x="840" y="252" width="148" height="151"/>
|
||||
<SubTexture name="right press0006" x="840" y="252" width="148" height="151"/>
|
||||
<SubTexture name="right press0007" x="840" y="252" width="148" height="151"/>
|
||||
<SubTexture name="right press0008" x="840" y="252" width="148" height="151"/>
|
||||
<SubTexture name="right press0009" x="840" y="252" width="148" height="151"/>
|
||||
<SubTexture name="right press0010" x="840" y="252" width="148" height="151"/>
|
||||
<SubTexture name="right press0011" x="840" y="252" width="148" height="151"/>
|
||||
<SubTexture name="right press0012" x="840" y="252" width="148" height="151"/>
|
||||
<SubTexture name="right press0013" x="840" y="252" width="148" height="151"/>
|
||||
<SubTexture name="right press0014" x="840" y="252" width="148" height="151"/>
|
||||
<SubTexture name="right press0015" x="840" y="252" width="148" height="151"/>
|
||||
<SubTexture name="right press0016" x="840" y="252" width="148" height="151"/>
|
||||
<SubTexture name="right press0017" x="840" y="252" width="148" height="151"/>
|
||||
<SubTexture name="right press0018" x="840" y="252" width="148" height="151"/>
|
||||
<SubTexture name="right press0019" x="840" y="252" width="148" height="151"/>
|
||||
<SubTexture name="right press0020" x="840" y="252" width="148" height="151"/>
|
||||
<SubTexture name="right press0021" x="840" y="252" width="148" height="151"/>
|
||||
<SubTexture name="right press0022" x="840" y="252" width="148" height="151"/>
|
||||
<SubTexture name="right press0023" x="840" y="252" width="148" height="151"/>
|
||||
<SubTexture name="right press0024" x="840" y="252" width="148" height="151"/>
|
||||
<SubTexture name="right press0025" x="840" y="252" width="148" height="151"/>
|
||||
<SubTexture name="right press0026" x="840" y="252" width="148" height="151"/>
|
||||
<SubTexture name="up confirm0000" x="506" y="10" width="236" height="232"/>
|
||||
<SubTexture name="up confirm0001" x="752" y="10" width="236" height="232"/>
|
||||
<SubTexture name="up confirm0002" x="998" y="251" width="214" height="211" frameX="-11" frameY="-10" frameWidth="236" frameHeight="232"/>
|
||||
<SubTexture name="up confirm0003" x="998" y="251" width="214" height="211" frameX="-11" frameY="-10" frameWidth="236" frameHeight="232"/>
|
||||
<SubTexture name="up press0000" x="996" y="472" width="144" height="141" frameX="-5" frameY="-4" frameWidth="153" frameHeight="150"/>
|
||||
<SubTexture name="up press0001" x="996" y="472" width="144" height="141" frameX="-5" frameY="-4" frameWidth="153" frameHeight="150"/>
|
||||
<SubTexture name="up press0002" x="174" y="419" width="153" height="150"/>
|
||||
<SubTexture name="up press0003" x="174" y="419" width="153" height="150"/>
|
||||
</TextureAtlas>
|
||||
|
9
assets/shared/images/characters/bf-carOffsets.txt
Normal file
@ -0,0 +1,9 @@
|
||||
idle -5 0
|
||||
singUP -29 27
|
||||
singRIGHT -38 -7
|
||||
singLEFT 12 -6
|
||||
singDOWN -10 -50
|
||||
singUPmiss -29 27
|
||||
singRIGHTmiss -30 21
|
||||
singLEFTmiss 12 24
|
||||
singDOWNmiss -11 -19
|
10
assets/shared/images/characters/bf-christmasOffsets.txt
Normal file
@ -0,0 +1,10 @@
|
||||
idle -5 0
|
||||
singUP -29 27
|
||||
singRIGHT -38 -7
|
||||
singLEFT 12 -6
|
||||
singDOWN -10 -50
|
||||
singUPmiss -29 27
|
||||
singRIGHTmiss -30 21
|
||||
singLEFTmiss 12 24
|
||||
singDOWNmiss -11 -19
|
||||
hey 7 4
|
3
assets/shared/images/characters/bf-pixel-deadOffsets.txt
Normal file
@ -0,0 +1,3 @@
|
||||
firstDeath 0 0
|
||||
deathLoop -30 -12
|
||||
deathConfirm -30 -12
|
9
assets/shared/images/characters/bf-pixelOffsets.txt
Normal file
@ -0,0 +1,9 @@
|
||||
idle 0 0
|
||||
singUP 0 0
|
||||
singRIGHT 0 0
|
||||
singLEFT 0 0
|
||||
singDOWN 0 0
|
||||
singUPmiss 0 0
|
||||
singRIGHTmiss 0 0
|
||||
singLEFTmiss 0 0
|
||||
singDOWNmiss 0 0
|
14
assets/shared/images/characters/bfOffsets.txt
Normal file
@ -0,0 +1,14 @@
|
||||
idle -5 0
|
||||
singUP -29 27
|
||||
singRIGHT -38 -7
|
||||
singLEFT 12 -6
|
||||
singDOWN -10 -50
|
||||
singUPmiss -29 27
|
||||
singRIGHTmiss -30 21
|
||||
singLEFTmiss 12 24
|
||||
singDOWNmiss -11 -19
|
||||
hey 7 4
|
||||
firstDeath 37 11
|
||||
deathLoop 37 5
|
||||
deathConfirm 37 69
|
||||
scared -4 0
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextureAtlas imagePath="bfPixelsDEAD.png">
|
||||
<!-- Created with Adobe Animate version 20.0.0.17400 -->
|
||||
<!-- http://www.adobe.com/products/animate.html -->
|
||||
<!-- if you read this you're epic. -->
|
||||
<!-- manual tweaks done on BF Dies pixel last 2 frames -->
|
||||
<SubTexture name="BF Dies pixel0000" x="0" y="0" width="90" height="81"/>
|
||||
<SubTexture name="BF Dies pixel0001" x="100" y="0" width="90" height="81"/>
|
||||
<SubTexture name="BF Dies pixel0002" x="200" y="0" width="90" height="81"/>
|
||||
@ -58,8 +58,8 @@
|
||||
<SubTexture name="BF Dies pixel0053" x="300" y="273" width="90" height="81"/>
|
||||
<SubTexture name="BF Dies pixel0054" x="400" y="273" width="90" height="81"/>
|
||||
<SubTexture name="BF Dies pixel0055" x="500" y="273" width="90" height="81"/>
|
||||
<SubTexture name="BF Dies pixel0056" x="696" y="450" width="77" height="76"/>
|
||||
<SubTexture name="BF Dies pixel0057" x="696" y="450" width="77" height="76"/>
|
||||
<SubTexture name="BF Dies pixel0056" x="691" y="448" width="90" height="81"/>
|
||||
<SubTexture name="BF Dies pixel0057" x="691" y="448" width="90" height="81"/>
|
||||
<SubTexture name="RETRY CONFIRM0000" x="600" y="273" width="77" height="76"/>
|
||||
<SubTexture name="RETRY CONFIRM0001" x="687" y="273" width="77" height="76"/>
|
||||
<SubTexture name="RETRY CONFIRM0002" x="687" y="273" width="77" height="76"/>
|
||||
|
5
assets/shared/images/characters/dadOffsets.txt
Normal file
@ -0,0 +1,5 @@
|
||||
idle 0 0
|
||||
singUP -6 50
|
||||
singRIGHT 0 27
|
||||
singLEFT -10 10
|
||||
singDOWN 0 -30
|
2
assets/shared/images/characters/gf-carOffsets.txt
Normal file
@ -0,0 +1,2 @@
|
||||
danceLeft 0 0
|
||||
danceRight 0 0
|
11
assets/shared/images/characters/gf-christmasOffsets.txt
Normal file
@ -0,0 +1,11 @@
|
||||
cheer 0 0
|
||||
sad -2 -21
|
||||
danceLeft 0 -9
|
||||
danceRight 0 -9
|
||||
singUP 0 4
|
||||
singRIGHT 0 -20
|
||||
singLEFT 0 -19
|
||||
singDOWN 0 -20
|
||||
hairBlow 45 -8
|
||||
hairFall 0 -9
|
||||
scared -2 -17
|
2
assets/shared/images/characters/gf-pixelOffsets.txt
Normal file
@ -0,0 +1,2 @@
|
||||
danceLeft 0 0
|
||||
danceRight 0 0
|
11
assets/shared/images/characters/gfOffsets.txt
Normal file
@ -0,0 +1,11 @@
|
||||
cheer 0 0
|
||||
sad -2 -21
|
||||
danceLeft 0 -9
|
||||
danceRight 0 -9
|
||||
singUP 0 4
|
||||
singRIGHT 0 -20
|
||||
singLEFT 0 -19
|
||||
singDOWN 0 -20
|
||||
hairBlow 45 -8
|
||||
hairFall 0 -9
|
||||
scared -2 -17
|
5
assets/shared/images/characters/mom-carOffsets.txt
Normal file
@ -0,0 +1,5 @@
|
||||
idle 0 0
|
||||
singUP 14 71
|
||||
singRIGHT 10 -60
|
||||
singLEFT 250 -23
|
||||
singDOWN 20 -160
|
5
assets/shared/images/characters/momOffsets.txt
Normal file
@ -0,0 +1,5 @@
|
||||
idle 0 0
|
||||
singUP 14 71
|
||||
singRIGHT 10 -60
|
||||
singLEFT 250 -23
|
||||
singDOWN 20 -160
|
@ -0,0 +1,5 @@
|
||||
idle 0 0
|
||||
singUP -20 50
|
||||
singRIGHT -51 0
|
||||
singLEFT -30 0
|
||||
singDOWN -40 -94
|
5
assets/shared/images/characters/monsterOffsets.txt
Normal file
@ -0,0 +1,5 @@
|
||||
idle 0 0
|
||||
singUP -20 94
|
||||
singRIGHT -51 30
|
||||
singLEFT -30 20
|
||||
singDOWN -50 -80
|
@ -0,0 +1,9 @@
|
||||
idle 0 0
|
||||
singUP -47 24
|
||||
singRIGHT -1 -23
|
||||
singLEFT -30 16
|
||||
singDOWN -31 -29
|
||||
singUP-alt -47 24
|
||||
singRIGHT-alt -1 -24
|
||||
singLEFT-alt -30 15
|
||||
singDOWN-alt -30 -27
|
9
assets/shared/images/characters/picoOffsets.txt
Normal file
@ -0,0 +1,9 @@
|
||||
idle 0 0
|
||||
singUP -29 27
|
||||
singRIGHT -68 -7
|
||||
singLEFT 65 9
|
||||
singDOWN 200 -70
|
||||
singUPmiss -19 67
|
||||
singRIGHTmiss -60 41
|
||||
singLEFTmiss 62 64
|
||||
singDOWNmiss 210 -28
|
5
assets/shared/images/characters/senpai-angryOffsets.txt
Normal file
@ -0,0 +1,5 @@
|
||||
idle 0 0
|
||||
singUP 5 37
|
||||
singRIGHT 0 0
|
||||
singLEFT 40 0
|
||||
singDOWN 14 0
|
5
assets/shared/images/characters/senpaiOffsets.txt
Normal file
@ -0,0 +1,5 @@
|
||||
idle 0 0
|
||||
singUP 5 37
|
||||
singRIGHT 0 0
|
||||
singLEFT 40 0
|
||||
singDOWN 14 0
|
5
assets/shared/images/characters/spiritOffsets.txt
Normal file
@ -0,0 +1,5 @@
|
||||
idle -220 -280
|
||||
singUP -220 -240
|
||||
singRIGHT -220 -280
|
||||
singLEFT -200 -280
|
||||
singDOWN 170 110
|
6
assets/shared/images/characters/spookyOffsets.txt
Normal file
@ -0,0 +1,6 @@
|
||||
danceLeft 0 0
|
||||
danceRight 0 0
|
||||
singUP -20 26
|
||||
singRIGHT -130 -14
|
||||
singLEFT 130 -10
|
||||
singDOWN -50 -130
|
BIN
assets/shared/sounds/CLAP.mp3
Normal file
BIN
assets/shared/sounds/SNAP.mp3
Normal file
5
assets/sm/HOW TO ADD SM FILES.txt
Normal file
@ -0,0 +1,5 @@
|
||||
Put both the .sm and .ogg in the same folder and put the folder in this folder. Launch the game and go into freeplay, it'll load into the song list.
|
||||
|
||||
Limitations:
|
||||
- You can only use songs that have one difficulty, so if a song has more than one. Remove all but the one you want to play. (it doesn't matter if it's challenge or what ever)
|
||||
- The song must be a .ogg
|
@ -30,26 +30,19 @@
|
||||
- `haxelib git discord_rpc https://github.com/Aidan63/linc_discord-rpc`
|
||||
- `haxelib install actuate`
|
||||
- `haxelib git extension-webm https://github.com/KadeDev/extension-webm`
|
||||
- `lime rebuild extension-webm windows`
|
||||
- `lime rebuild extension-webm <ie. windows, macos, linux>`
|
||||
|
||||
### Windows-only dependencies (only for building *to* Windows. Building html5 on Windows does not require this)
|
||||
If you are planning to build for Windows, you also need to install **Visual Studio 2019**. While installing it, *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
|
||||
- MSVC v141 - VS 2017 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 22 GB of crap, but is necessary to build for Windows.
|
||||
This will install about 7 GB of crap, but is necessary to build for Windows.
|
||||
|
||||
### macOS-only dependencies (these are required for building on macOS at all, including html5.)
|
||||
If you are running macOS, you'll need to install Xcode. You can download it from the macOS App Store or from the [Xcode website](https://developer.apple.com/xcode/).
|
||||
|
35
docs/changelogs/changelog-1.6.md
Normal file
@ -0,0 +1,35 @@
|
||||
# Latest (master) changelog
|
||||
|
||||
Changes marked with 💖 will be listed in the short version of the changelog in `version.downloadMe`.
|
||||
|
||||
### Additions
|
||||
- 💖 Full reworked charter
|
||||
- Note quantization
|
||||
- 💖 BPM Changes & Scroll Speed Change Support
|
||||
- 💖 StepMania File Format support
|
||||
- Anti-Aliasing option for low end pc's
|
||||
- 💖 Pre-loading for characters option
|
||||
- New Logo
|
||||
- 💖 New Main Menu Remix
|
||||
- 💖 Difficulty Calculator
|
||||
- Week Locking
|
||||
- Character Offset Files
|
||||
- Many new options
|
||||
|
||||
### Changes
|
||||
- Reworked Health Drain to be harsher
|
||||
- 💖 Held notes being weird as fuck (completely reworked them)
|
||||
- Many beat based things actually go to the beat (blue balls, title screen, etc)
|
||||
- Losing Icon for Father Dearest & Mommy Mearest together
|
||||
|
||||
### Bugfixes
|
||||
- BF Animation ending too early
|
||||
- Held note end fix (this made me mad)
|
||||
- Up arrow having a 8 pixels next to it
|
||||
- Stop crashes with "R"
|
||||
- Fixed dropped inputs for stacked notes.
|
||||
- Fixed multiple crashes
|
||||
- Fixed spirit being weird
|
||||
- Fixed a lot of desyncs
|
||||
- Ghost Tapping works now
|
||||
- Pressing 7 while dying no longer freezes you in time.
|
@ -15,7 +15,9 @@ Scroll down to Line 26, or Search (Windows/Linux: `Ctrl+F`, Mac: `Cmd+F`) for "w
|
||||
---
|
||||
|
||||
```haxe
|
||||
var weekData:Array<Dynamic> = [
|
||||
static function weekData():Array<Dynamic>
|
||||
{
|
||||
return [
|
||||
|
||||
['Tutorial'],
|
||||
|
||||
@ -32,6 +34,7 @@ var weekData:Array<Dynamic> = [
|
||||
['Senpai', 'Roses', 'Thorns']
|
||||
|
||||
];
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
@ -45,7 +48,9 @@ Example
|
||||
---
|
||||
|
||||
```haxe
|
||||
var weekData:Array<Dynamic> = [
|
||||
static function weekData():Array<Dynamic>
|
||||
{
|
||||
return [
|
||||
|
||||
['Tutorial'],
|
||||
|
||||
@ -64,6 +69,7 @@ var weekData:Array<Dynamic> = [
|
||||
['Ugh', 'Guns', 'Stress']
|
||||
|
||||
];
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
@ -103,32 +109,21 @@ var weekCharacters:Array<Dynamic> = [
|
||||
|
||||
### Step 4. Week Names
|
||||
|
||||
Underneath the song list, there should be another array called `weekNames`. Creating a new line in that array, just enter a string that represents what you want the week to be called.
|
||||
In `assets/preload/data`, there should be a .txt file called `weekNames`. Creating a new line in that file, just enter a string that represents what you want the week to be called.
|
||||
|
||||
Example
|
||||
---
|
||||
|
||||
---
|
||||
```haxe
|
||||
var weekNames:Array<String> = [
|
||||
|
||||
"How to Funk",
|
||||
|
||||
"Daddy dearest",
|
||||
|
||||
"Spooky Month",
|
||||
|
||||
"PICO",
|
||||
|
||||
"Mommy Must Murder",
|
||||
|
||||
"Red Snow",
|
||||
|
||||
"Hating Simulator ft. Moawlings",
|
||||
|
||||
"Tankman"
|
||||
|
||||
];
|
||||
```
|
||||
Tutorial
|
||||
Daddy Dearest
|
||||
Spooky Month
|
||||
PICO
|
||||
MOMMY MUST MURDER
|
||||
RED SNOW
|
||||
Hating Simulator ft. Moawling
|
||||
TANKMAN
|
||||
```
|
||||
|
||||
---
|
||||
@ -137,23 +132,29 @@ var weekNames:Array<String> = [
|
||||
|
||||
### Step 5. Graphics
|
||||
|
||||
Displaying a week icon for your custom week is as simple as dropping a .png into `assets/images/storymenu`. Rename the file to `week7.png`, `week8.png`, etc.
|
||||
Displaying a week icon for your custom week is as simple as dropping a .png into `assets/preload/images/storymenu`. Rename the file to `week7.png`, `week8.png`, etc.
|
||||
|
||||
Example
|
||||
---
|
||||
|
||||
---
|
||||
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
=======
|
||||

|
||||
|
||||
NOTE: You will have to add a new item to `weekUnlocked`, so that the week is playable.
|
||||
Locate to line 39 and add in a new boolean called True so that the week can be playable.
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
 \* *for this screenshot I removed tankman from weekCharacters as it would crash because I don't have a tankman character added*
|
||||
### Conclusion
|
||||
|
||||
If you followed all of the steps correctly, you have successfully created a new week in the Story Mode.
|
||||
|
@ -278,9 +278,11 @@ class AlphaCharacter extends FlxSprite
|
||||
super(x, y);
|
||||
var tex = Paths.getSparrowAtlas('alphabet');
|
||||
frames = tex;
|
||||
|
||||
if(FlxG.save.data.antialiasing)
|
||||
{
|
||||
antialiasing = true;
|
||||
}
|
||||
}
|
||||
|
||||
public function createBold(letter:String)
|
||||
{
|
||||
|
@ -118,6 +118,9 @@ class AnimationDebug extends FlxState
|
||||
if (FlxG.keys.justPressed.Q)
|
||||
FlxG.camera.zoom -= 0.25;
|
||||
|
||||
if (FlxG.keys.justPressed.F)
|
||||
char.flipX = !char.flipX;
|
||||
|
||||
if (FlxG.keys.pressed.I || FlxG.keys.pressed.J || FlxG.keys.pressed.K || FlxG.keys.pressed.L)
|
||||
{
|
||||
if (FlxG.keys.pressed.I)
|
||||
|
@ -1,5 +1,6 @@
|
||||
package;
|
||||
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxSprite;
|
||||
import flixel.graphics.frames.FlxAtlasFrames;
|
||||
|
||||
@ -13,8 +14,11 @@ class BackgroundDancer extends FlxSprite
|
||||
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');
|
||||
if(FlxG.save.data.antialiasing)
|
||||
{
|
||||
antialiasing = true;
|
||||
}
|
||||
}
|
||||
|
||||
var danceDir:Bool = false;
|
||||
|
||||
|
@ -1,10 +1,20 @@
|
||||
#if sys
|
||||
package;
|
||||
|
||||
import lime.app.Application;
|
||||
#if windows
|
||||
import Discord.DiscordClient;
|
||||
#end
|
||||
import openfl.display.BitmapData;
|
||||
import openfl.utils.Assets;
|
||||
import flixel.ui.FlxBar;
|
||||
import haxe.Exception;
|
||||
import flixel.tweens.FlxEase;
|
||||
import flixel.tweens.FlxTween;
|
||||
#if cpp
|
||||
import sys.FileSystem;
|
||||
import sys.io.File;
|
||||
#end
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxSprite;
|
||||
import flixel.addons.transition.FlxTransitionSprite.GraphicTransTileDiamond;
|
||||
@ -25,15 +35,33 @@ class Caching extends MusicBeatState
|
||||
var toBeDone = 0;
|
||||
var done = 0;
|
||||
|
||||
var loaded = false;
|
||||
|
||||
var text:FlxText;
|
||||
var kadeLogo:FlxSprite;
|
||||
|
||||
public static var bitmapData:Map<String,FlxGraphic>;
|
||||
|
||||
var images = [];
|
||||
var music = [];
|
||||
var charts = [];
|
||||
|
||||
|
||||
override function create()
|
||||
{
|
||||
|
||||
FlxG.save.bind('funkin', 'ninjamuffin99');
|
||||
|
||||
PlayerSettings.init();
|
||||
|
||||
KadeEngineData.initSave();
|
||||
|
||||
FlxG.mouse.visible = false;
|
||||
|
||||
FlxG.worldBounds.set(0,0);
|
||||
|
||||
bitmapData = new Map<String,FlxGraphic>();
|
||||
|
||||
text = new FlxText(FlxG.width / 2, FlxG.height / 2 + 300,0,"Loading...");
|
||||
text.size = 34;
|
||||
text.alignment = FlxTextAlign.CENTER;
|
||||
@ -45,45 +73,13 @@ class Caching extends MusicBeatState
|
||||
text.y -= kadeLogo.height / 2 - 125;
|
||||
text.x -= 170;
|
||||
kadeLogo.setGraphicSize(Std.int(kadeLogo.width * 0.6));
|
||||
kadeLogo.antialiasing = true;
|
||||
|
||||
kadeLogo.alpha = 0;
|
||||
|
||||
add(kadeLogo);
|
||||
add(text);
|
||||
|
||||
trace('starting caching..');
|
||||
|
||||
sys.thread.Thread.create(() -> {
|
||||
cache();
|
||||
});
|
||||
|
||||
|
||||
super.create();
|
||||
}
|
||||
|
||||
var calledDone = false;
|
||||
|
||||
override function update(elapsed)
|
||||
#if cpp
|
||||
if (FlxG.save.data.cacheImages)
|
||||
{
|
||||
|
||||
if (toBeDone != 0 && done != toBeDone)
|
||||
{
|
||||
var alpha = HelperFunctions.truncateFloat(done / toBeDone * 100,2) / 100;
|
||||
kadeLogo.alpha = alpha;
|
||||
text.alpha = alpha;
|
||||
text.text = "Loading... (" + done + "/" + toBeDone + ")";
|
||||
}
|
||||
|
||||
super.update(elapsed);
|
||||
}
|
||||
|
||||
|
||||
function cache()
|
||||
{
|
||||
|
||||
var images = [];
|
||||
var music = [];
|
||||
|
||||
trace("caching images...");
|
||||
|
||||
for (i in FileSystem.readDirectory(FileSystem.absolutePath("assets/shared/images/characters")))
|
||||
@ -92,6 +88,7 @@ class Caching extends MusicBeatState
|
||||
continue;
|
||||
images.push(i);
|
||||
}
|
||||
}
|
||||
|
||||
trace("caching music...");
|
||||
|
||||
@ -99,16 +96,68 @@ class Caching extends MusicBeatState
|
||||
{
|
||||
music.push(i);
|
||||
}
|
||||
#end
|
||||
|
||||
toBeDone = Lambda.count(images) + Lambda.count(music);
|
||||
|
||||
var bar = new FlxBar(10,FlxG.height - 50,FlxBarFillDirection.LEFT_TO_RIGHT,FlxG.width,40,null,"done",0,toBeDone);
|
||||
bar.color = FlxColor.PURPLE;
|
||||
|
||||
add(bar);
|
||||
|
||||
add(kadeLogo);
|
||||
add(text);
|
||||
|
||||
trace('starting caching..');
|
||||
|
||||
#if cpp
|
||||
// update thread
|
||||
|
||||
sys.thread.Thread.create(() -> {
|
||||
while(!loaded)
|
||||
{
|
||||
if (toBeDone != 0 && done != toBeDone)
|
||||
{
|
||||
var alpha = HelperFunctions.truncateFloat(done / toBeDone * 100,2) / 100;
|
||||
kadeLogo.alpha = alpha;
|
||||
text.alpha = alpha;
|
||||
text.text = "Loading... (" + done + "/" + toBeDone + ")";
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// cache thread
|
||||
|
||||
sys.thread.Thread.create(() -> {
|
||||
cache();
|
||||
});
|
||||
#end
|
||||
|
||||
super.create();
|
||||
}
|
||||
|
||||
var calledDone = false;
|
||||
|
||||
override function update(elapsed)
|
||||
{
|
||||
super.update(elapsed);
|
||||
}
|
||||
|
||||
|
||||
function cache()
|
||||
{
|
||||
trace("LOADING: " + toBeDone + " OBJECTS.");
|
||||
|
||||
for (i in images)
|
||||
{
|
||||
var replaced = i.replace(".png","");
|
||||
FlxG.bitmap.add(Paths.image("characters/" + replaced,"shared"));
|
||||
trace("cached " + replaced);
|
||||
var data:BitmapData = BitmapData.fromFile("assets/shared/images/characters/" + i);
|
||||
trace('id ' + replaced + ' file - assets/shared/images/characters/' + i + ' ${data.width}');
|
||||
var graph = FlxGraphic.fromBitmapData(data);
|
||||
graph.persist = true;
|
||||
graph.destroyOnNoUse = false;
|
||||
bitmapData.set(replaced,graph);
|
||||
done++;
|
||||
}
|
||||
|
||||
@ -120,9 +169,15 @@ class Caching extends MusicBeatState
|
||||
done++;
|
||||
}
|
||||
|
||||
|
||||
trace("Finished caching...");
|
||||
|
||||
loaded = true;
|
||||
|
||||
trace(Assets.cache.hasBitmapData('GF_assets'));
|
||||
|
||||
FlxG.switchState(new TitleState());
|
||||
}
|
||||
|
||||
}
|
||||
#end
|
@ -26,13 +26,16 @@ class Character extends FlxSprite
|
||||
this.isPlayer = isPlayer;
|
||||
|
||||
var tex:FlxAtlasFrames;
|
||||
if(FlxG.save.data.antialiasing)
|
||||
{
|
||||
antialiasing = true;
|
||||
}
|
||||
|
||||
switch (curCharacter)
|
||||
{
|
||||
case 'gf':
|
||||
// GIRLFRIEND CODE
|
||||
tex = Paths.getSparrowAtlas('characters/GF_assets');
|
||||
tex = Paths.getSparrowAtlas('GF_assets','shared',true);
|
||||
frames = tex;
|
||||
animation.addByPrefix('cheer', 'GF Cheer', 24, false);
|
||||
animation.addByPrefix('singLEFT', 'GF left note', 24, false);
|
||||
@ -46,24 +49,12 @@ class Character extends FlxSprite
|
||||
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);
|
||||
loadOffsetFile(curCharacter);
|
||||
|
||||
playAnim('danceRight');
|
||||
|
||||
case 'gf-christmas':
|
||||
tex = Paths.getSparrowAtlas('characters/gfChristmas');
|
||||
tex = Paths.getSparrowAtlas('gfChristmas','shared',true);
|
||||
frames = tex;
|
||||
animation.addByPrefix('cheer', 'GF Cheer', 24, false);
|
||||
animation.addByPrefix('singLEFT', 'GF left note', 24, false);
|
||||
@ -77,44 +68,30 @@ class Character extends FlxSprite
|
||||
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);
|
||||
loadOffsetFile(curCharacter);
|
||||
|
||||
playAnim('danceRight');
|
||||
|
||||
case 'gf-car':
|
||||
tex = Paths.getSparrowAtlas('characters/gfCar');
|
||||
tex = Paths.getSparrowAtlas('gfCar','shared',true);
|
||||
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);
|
||||
loadOffsetFile(curCharacter);
|
||||
|
||||
playAnim('danceRight');
|
||||
|
||||
case 'gf-pixel':
|
||||
tex = Paths.getSparrowAtlas('characters/gfPixel');
|
||||
tex = Paths.getSparrowAtlas('gfPixel','shared',true);
|
||||
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);
|
||||
loadOffsetFile(curCharacter);
|
||||
|
||||
playAnim('danceRight');
|
||||
|
||||
@ -124,7 +101,7 @@ class Character extends FlxSprite
|
||||
|
||||
case 'dad':
|
||||
// DAD ANIMATION LOADING CODE
|
||||
tex = Paths.getSparrowAtlas('characters/DADDY_DEAREST', 'shared');
|
||||
tex = Paths.getSparrowAtlas('DADDY_DEAREST','shared',true);
|
||||
frames = tex;
|
||||
animation.addByPrefix('idle', 'Dad idle dance', 24);
|
||||
animation.addByPrefix('singUP', 'Dad Sing Note UP', 24);
|
||||
@ -132,15 +109,11 @@ class Character extends FlxSprite
|
||||
animation.addByPrefix('singDOWN', 'Dad Sing Note DOWN', 24);
|
||||
animation.addByPrefix('singLEFT', 'Dad Sing Note LEFT', 24);
|
||||
|
||||
addOffset('idle');
|
||||
addOffset("singUP", -6, 50);
|
||||
addOffset("singRIGHT", 0, 27);
|
||||
addOffset("singLEFT", -10, 10);
|
||||
addOffset("singDOWN", 0, -30);
|
||||
loadOffsetFile(curCharacter);
|
||||
|
||||
playAnim('idle');
|
||||
case 'spooky':
|
||||
tex = Paths.getSparrowAtlas('characters/spooky_kids_assets');
|
||||
tex = Paths.getSparrowAtlas('spooky_kids_assets','shared',true);
|
||||
frames = tex;
|
||||
animation.addByPrefix('singUP', 'spooky UP NOTE', 24, false);
|
||||
animation.addByPrefix('singDOWN', 'spooky DOWN note', 24, false);
|
||||
@ -149,17 +122,11 @@ class Character extends FlxSprite
|
||||
animation.addByIndices('danceLeft', 'spooky dance idle', [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);
|
||||
loadOffsetFile(curCharacter);
|
||||
|
||||
playAnim('danceRight');
|
||||
case 'mom':
|
||||
tex = Paths.getSparrowAtlas('characters/Mom_Assets');
|
||||
tex = Paths.getSparrowAtlas('Mom_Assets','shared',true);
|
||||
frames = tex;
|
||||
|
||||
animation.addByPrefix('idle', "Mom Idle", 24, false);
|
||||
@ -170,16 +137,12 @@ class Character extends FlxSprite
|
||||
// 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);
|
||||
loadOffsetFile(curCharacter);
|
||||
|
||||
playAnim('idle');
|
||||
|
||||
case 'mom-car':
|
||||
tex = Paths.getSparrowAtlas('characters/momCar');
|
||||
tex = Paths.getSparrowAtlas('momCar','shared',true);
|
||||
frames = tex;
|
||||
|
||||
animation.addByPrefix('idle', "Mom Idle", 24, false);
|
||||
@ -190,15 +153,11 @@ class Character extends FlxSprite
|
||||
// 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);
|
||||
loadOffsetFile(curCharacter);
|
||||
|
||||
playAnim('idle');
|
||||
case 'monster':
|
||||
tex = Paths.getSparrowAtlas('characters/Monster_Assets');
|
||||
tex = Paths.getSparrowAtlas('Monster_Assets','shared',true);
|
||||
frames = tex;
|
||||
animation.addByPrefix('idle', 'monster idle', 24, false);
|
||||
animation.addByPrefix('singUP', 'monster up note', 24, false);
|
||||
@ -206,14 +165,10 @@ class Character extends FlxSprite
|
||||
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", -30, -40);
|
||||
loadOffsetFile(curCharacter);
|
||||
playAnim('idle');
|
||||
case 'monster-christmas':
|
||||
tex = Paths.getSparrowAtlas('characters/monsterChristmas');
|
||||
tex = Paths.getSparrowAtlas('monsterChristmas','shared',true);
|
||||
frames = tex;
|
||||
animation.addByPrefix('idle', 'monster idle', 24, false);
|
||||
animation.addByPrefix('singUP', 'monster up note', 24, false);
|
||||
@ -221,14 +176,10 @@ class Character extends FlxSprite
|
||||
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);
|
||||
loadOffsetFile(curCharacter);
|
||||
playAnim('idle');
|
||||
case 'pico':
|
||||
tex = Paths.getSparrowAtlas('characters/Pico_FNF_assetss');
|
||||
tex = Paths.getSparrowAtlas('Pico_FNF_assetss','shared',true);
|
||||
frames = tex;
|
||||
animation.addByPrefix('idle', "Pico Idle Dance", 24);
|
||||
animation.addByPrefix('singUP', 'pico Up note0', 24, false);
|
||||
@ -252,22 +203,14 @@ class Character extends FlxSprite
|
||||
animation.addByPrefix('singUPmiss', 'pico Up note miss', 24);
|
||||
animation.addByPrefix('singDOWNmiss', 'Pico Down Note MISS', 24);
|
||||
|
||||
addOffset('idle');
|
||||
addOffset("singUP", -29, 27);
|
||||
addOffset("singRIGHT", -68, -7);
|
||||
addOffset("singLEFT", 65, 9);
|
||||
addOffset("singDOWN", 200, -70);
|
||||
addOffset("singUPmiss", -19, 67);
|
||||
addOffset("singRIGHTmiss", -60, 41);
|
||||
addOffset("singLEFTmiss", 62, 64);
|
||||
addOffset("singDOWNmiss", 210, -28);
|
||||
loadOffsetFile(curCharacter);
|
||||
|
||||
playAnim('idle');
|
||||
|
||||
flipX = true;
|
||||
|
||||
case 'bf':
|
||||
var tex = Paths.getSparrowAtlas('characters/BOYFRIEND', 'shared');
|
||||
var tex = Paths.getSparrowAtlas('BOYFRIEND','shared',true);
|
||||
frames = tex;
|
||||
|
||||
trace(tex.frames.length);
|
||||
@ -284,32 +227,19 @@ class Character extends FlxSprite
|
||||
animation.addByPrefix('hey', 'BF HEY', 24, false);
|
||||
|
||||
animation.addByPrefix('firstDeath', "BF dies", 24, false);
|
||||
animation.addByPrefix('deathLoop', "BF Dead Loop", 24, true);
|
||||
animation.addByPrefix('deathLoop', "BF Dead Loop", 24, false);
|
||||
animation.addByPrefix('deathConfirm', "BF Dead confirm", 24, false);
|
||||
|
||||
animation.addByPrefix('scared', 'BF idle shaking', 24);
|
||||
|
||||
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);
|
||||
addOffset('firstDeath', 37, 11);
|
||||
addOffset('deathLoop', 37, 5);
|
||||
addOffset('deathConfirm', 37, 69);
|
||||
addOffset('scared', -4);
|
||||
loadOffsetFile(curCharacter);
|
||||
|
||||
playAnim('idle');
|
||||
|
||||
flipX = true;
|
||||
|
||||
case 'bf-christmas':
|
||||
var tex = Paths.getSparrowAtlas('characters/bfChristmas');
|
||||
var tex = Paths.getSparrowAtlas('bfChristmas','shared',true);
|
||||
frames = tex;
|
||||
animation.addByPrefix('idle', 'BF idle dance', 24, false);
|
||||
animation.addByPrefix('singUP', 'BF NOTE UP0', 24, false);
|
||||
@ -322,22 +252,13 @@ class Character extends FlxSprite
|
||||
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);
|
||||
loadOffsetFile(curCharacter);
|
||||
|
||||
playAnim('idle');
|
||||
|
||||
flipX = true;
|
||||
case 'bf-car':
|
||||
var tex = Paths.getSparrowAtlas('characters/bfCar');
|
||||
var tex = Paths.getSparrowAtlas('bfCar','shared',true);
|
||||
frames = tex;
|
||||
animation.addByPrefix('idle', 'BF idle dance', 24, false);
|
||||
animation.addByPrefix('singUP', 'BF NOTE UP0', 24, false);
|
||||
@ -349,20 +270,12 @@ class Character extends FlxSprite
|
||||
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);
|
||||
loadOffsetFile(curCharacter);
|
||||
playAnim('idle');
|
||||
|
||||
flipX = true;
|
||||
case 'bf-pixel':
|
||||
frames = Paths.getSparrowAtlas('characters/bfPixel');
|
||||
frames = Paths.getSparrowAtlas('bfPixel','shared',true);
|
||||
animation.addByPrefix('idle', 'BF IDLE', 24, false);
|
||||
animation.addByPrefix('singUP', 'BF UP NOTE', 24, false);
|
||||
animation.addByPrefix('singLEFT', 'BF LEFT NOTE', 24, false);
|
||||
@ -373,15 +286,7 @@ class Character extends FlxSprite
|
||||
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");
|
||||
loadOffsetFile(curCharacter);
|
||||
|
||||
setGraphicSize(Std.int(width * 6));
|
||||
updateHitbox();
|
||||
@ -395,16 +300,14 @@ class Character extends FlxSprite
|
||||
|
||||
flipX = true;
|
||||
case 'bf-pixel-dead':
|
||||
frames = Paths.getSparrowAtlas('characters/bfPixelsDEAD');
|
||||
frames = Paths.getSparrowAtlas('bfPixelsDEAD','shared',true);
|
||||
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('deathLoop', "Retry Loop", 24, false);
|
||||
animation.addByPrefix('deathConfirm', "RETRY CONFIRM", 24, false);
|
||||
animation.play('firstDeath');
|
||||
|
||||
addOffset('firstDeath');
|
||||
addOffset('deathLoop', -37);
|
||||
addOffset('deathConfirm', -37);
|
||||
loadOffsetFile(curCharacter);
|
||||
playAnim('firstDeath');
|
||||
// pixel bullshit
|
||||
setGraphicSize(Std.int(width * 6));
|
||||
@ -413,18 +316,14 @@ class Character extends FlxSprite
|
||||
flipX = true;
|
||||
|
||||
case 'senpai':
|
||||
frames = Paths.getSparrowAtlas('characters/senpai');
|
||||
frames = Paths.getSparrowAtlas('senpai','shared',true);
|
||||
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);
|
||||
loadOffsetFile(curCharacter);
|
||||
|
||||
playAnim('idle');
|
||||
|
||||
@ -433,18 +332,14 @@ class Character extends FlxSprite
|
||||
|
||||
antialiasing = false;
|
||||
case 'senpai-angry':
|
||||
frames = Paths.getSparrowAtlas('characters/senpai');
|
||||
frames = Paths.getSparrowAtlas('senpai','shared',true);
|
||||
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);
|
||||
loadOffsetFile(curCharacter);
|
||||
playAnim('idle');
|
||||
|
||||
setGraphicSize(Std.int(width * 6));
|
||||
@ -453,18 +348,14 @@ class Character extends FlxSprite
|
||||
antialiasing = false;
|
||||
|
||||
case 'spirit':
|
||||
frames = Paths.getPackerAtlas('characters/spirit');
|
||||
frames = Paths.getPackerAtlas('spirit','shared',true);
|
||||
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);
|
||||
loadOffsetFile(curCharacter);
|
||||
|
||||
setGraphicSize(Std.int(width * 6));
|
||||
updateHitbox();
|
||||
@ -474,7 +365,7 @@ class Character extends FlxSprite
|
||||
antialiasing = false;
|
||||
|
||||
case 'parents-christmas':
|
||||
frames = Paths.getSparrowAtlas('characters/mom_dad_christmas_assets');
|
||||
frames = Paths.getSparrowAtlas('mom_dad_christmas_assets','shared',true);
|
||||
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);
|
||||
@ -487,15 +378,7 @@ class Character extends FlxSprite
|
||||
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);
|
||||
loadOffsetFile(curCharacter);
|
||||
|
||||
playAnim('idle');
|
||||
}
|
||||
@ -525,6 +408,17 @@ class Character extends FlxSprite
|
||||
}
|
||||
}
|
||||
|
||||
public function loadOffsetFile(character:String)
|
||||
{
|
||||
var offset:Array<String> = CoolUtil.coolTextFile(Paths.txt('images/characters/' + character + "Offsets", 'shared'));
|
||||
|
||||
for (i in 0...offset.length)
|
||||
{
|
||||
var data:Array<String> = offset[i].split(' ');
|
||||
addOffset(data[0], Std.parseInt(data[1]), Std.parseInt(data[2]));
|
||||
}
|
||||
}
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
if (!curCharacter.startsWith('bf'))
|
||||
@ -561,13 +455,13 @@ class Character extends FlxSprite
|
||||
/**
|
||||
* FOR GF DANCING SHIT
|
||||
*/
|
||||
public function dance()
|
||||
public function dance(forced:Bool = false)
|
||||
{
|
||||
if (!debugMode)
|
||||
{
|
||||
switch (curCharacter)
|
||||
{
|
||||
case 'gf':
|
||||
case 'gf' | 'gf-christmas' | 'gf-car' | 'gf-pixel':
|
||||
if (!animation.curAnim.name.startsWith('hair'))
|
||||
{
|
||||
danced = !danced;
|
||||
@ -577,39 +471,6 @@ class Character extends FlxSprite
|
||||
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;
|
||||
|
||||
@ -618,7 +479,7 @@ class Character extends FlxSprite
|
||||
else
|
||||
playAnim('danceLeft');
|
||||
default:
|
||||
playAnim('idle');
|
||||
playAnim('idle', forced);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -68,7 +68,23 @@ class Conductor
|
||||
trace("new BPM map BUDDY " + bpmChangeMap);
|
||||
}
|
||||
|
||||
public static function changeBPM(newBpm:Float)
|
||||
public static function recalculateTimingStruct(SONG:Song)
|
||||
{
|
||||
for(i in SONG.eventObjects)
|
||||
{
|
||||
/*TimingStruct.addTiming(beat,bpm,endBeat, Std.parseFloat(OFFSET));
|
||||
|
||||
if (changeEvents.length != 0)
|
||||
{
|
||||
var data = TimingStruct.AllTimings[currentIndex - 1];
|
||||
data.endBeat = beat;
|
||||
data.length = (data.endBeat - data.startBeat) / (data.bpm / 60);
|
||||
TimingStruct.AllTimings[currentIndex].startTime = data.startTime + data.length;
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
public static function changeBPM(newBpm:Float, ?recalcLength = true)
|
||||
{
|
||||
bpm = newBpm;
|
||||
|
||||
|
@ -594,7 +594,7 @@ class Controls extends FlxActionSet
|
||||
inline bindKeys(Control.RIGHT, [FlxKey.fromString(FlxG.save.data.rightBind), FlxKey.RIGHT]);
|
||||
inline bindKeys(Control.ACCEPT, [Z, SPACE, ENTER]);
|
||||
inline bindKeys(Control.BACK, [BACKSPACE, ESCAPE]);
|
||||
inline bindKeys(Control.PAUSE, [P, ENTER, ESCAPE]);
|
||||
inline bindKeys(Control.PAUSE, [ENTER, ESCAPE]);
|
||||
inline bindKeys(Control.RESET, [FlxKey.fromString(FlxG.save.data.killBind)]);
|
||||
}
|
||||
|
||||
|
@ -155,7 +155,7 @@ class DialogueBox extends FlxSpriteGroup
|
||||
portraitLeft.visible = false;
|
||||
if (PlayState.SONG.song.toLowerCase() == 'thorns')
|
||||
{
|
||||
portraitLeft.color = FlxColor.BLACK;
|
||||
portraitLeft.visible = false;
|
||||
swagDialogue.color = FlxColor.WHITE;
|
||||
dropText.color = FlxColor.BLACK;
|
||||
}
|
||||
|
372
source/DiffCalc.hx
Normal file
@ -0,0 +1,372 @@
|
||||
import openfl.system.System;
|
||||
import flixel.math.FlxMath;
|
||||
import Song.SwagSong;
|
||||
|
||||
class SmallNote // basically Note.hx but small as fuck
|
||||
{
|
||||
public var strumTime:Float;
|
||||
public var noteData:Int;
|
||||
|
||||
public function new(strum,data)
|
||||
{
|
||||
strumTime = strum;
|
||||
noteData = data;
|
||||
}
|
||||
}
|
||||
|
||||
class DiffCalc
|
||||
{
|
||||
public static var scale = 3 * 1.8;
|
||||
|
||||
public static var lastDiffHandOne:Array<Float> = [];
|
||||
public static var lastDiffHandTwo:Array<Float> = [];
|
||||
|
||||
public static function CalculateDiff(song:SwagSong, ?accuracy:Float = .93)
|
||||
{
|
||||
trace('calcuilafjwaf');
|
||||
// cleaned notes
|
||||
var cleanedNotes:Array<SmallNote> = [];
|
||||
|
||||
if (song.notes == null)
|
||||
return 0.0;
|
||||
|
||||
if (song.notes.length == 0)
|
||||
return 0.0;
|
||||
|
||||
// find all of the notes
|
||||
for(i in song.notes) // sections
|
||||
{
|
||||
for (ii in i.sectionNotes) // notes
|
||||
{
|
||||
if (ii[1] > 3 && !i.mustHitSection)
|
||||
cleanedNotes.push(new SmallNote(ii[0],Math.floor(Math.abs(ii[1]))));
|
||||
else if (ii[1] < 4 && i.mustHitSection)
|
||||
cleanedNotes.push(new SmallNote(ii[0],Math.floor(Math.abs(ii[1]))));
|
||||
}
|
||||
}
|
||||
|
||||
trace(cleanedNotes.length + " - playable notes");
|
||||
|
||||
var handOne:Array<SmallNote> = [];
|
||||
var handTwo:Array<SmallNote> = [];
|
||||
|
||||
cleanedNotes.sort((a, b) -> Std.int(a.strumTime - b.strumTime));
|
||||
|
||||
|
||||
|
||||
var firstNoteTime = cleanedNotes[0].strumTime;
|
||||
|
||||
// normalize the notes
|
||||
|
||||
for(i in cleanedNotes)
|
||||
{
|
||||
i.strumTime = (i.strumTime - firstNoteTime) * 2;
|
||||
}
|
||||
|
||||
for (i in cleanedNotes)
|
||||
{
|
||||
switch(i.noteData)
|
||||
{
|
||||
case 0:
|
||||
handOne.push(i);
|
||||
case 1:
|
||||
handOne.push(i);
|
||||
case 2:
|
||||
handTwo.push(i);
|
||||
case 3:
|
||||
handTwo.push(i);
|
||||
}
|
||||
}
|
||||
|
||||
// collect all of the notes in each col
|
||||
|
||||
var leftHandCol:Array<Float> = []; // d 0
|
||||
var leftMHandCol:Array<Float> = []; // f 1
|
||||
var rightMHandCol:Array<Float> = []; // j 2
|
||||
var rightHandCol:Array<Float> = []; // k 3
|
||||
|
||||
for(i in 0...handOne.length - 1)
|
||||
{
|
||||
if (handOne[i].noteData == 0)
|
||||
leftHandCol.push(handOne[i].strumTime);
|
||||
else
|
||||
leftMHandCol.push(handOne[i].strumTime);
|
||||
}
|
||||
for(i in 0...handTwo.length - 1)
|
||||
{
|
||||
if (handTwo[i].noteData == 3)
|
||||
rightHandCol.push(handTwo[i].strumTime);
|
||||
else
|
||||
rightMHandCol.push(handTwo[i].strumTime);
|
||||
}
|
||||
|
||||
|
||||
// length in segments of the song
|
||||
var length = ((cleanedNotes[cleanedNotes.length - 1].strumTime / 1000) / 0.5);
|
||||
|
||||
// hackey way of creating a array with a length
|
||||
var segmentsOne = new haxe.ds.Vector(Math.floor(length));
|
||||
|
||||
var segmentsTwo = new haxe.ds.Vector(Math.floor(length));
|
||||
|
||||
// set em all to array's (so no null's)
|
||||
|
||||
for(i in 0...segmentsOne.length)
|
||||
segmentsOne[i] = new Array<SmallNote>();
|
||||
for(i in 0...segmentsTwo.length)
|
||||
segmentsTwo[i] = new Array<SmallNote>();
|
||||
|
||||
// algo loop
|
||||
for(i in handOne)
|
||||
{
|
||||
var index = Std.int((((i.strumTime * 2) / 1000)));
|
||||
if (index + 1 > length)
|
||||
continue;
|
||||
segmentsOne[index].push(i);
|
||||
}
|
||||
|
||||
for(i in handTwo)
|
||||
{
|
||||
var index = Std.int((((i.strumTime * 2) / 1000)));
|
||||
if (index + 1 > length)
|
||||
continue;
|
||||
segmentsTwo[index].push(i);
|
||||
}
|
||||
|
||||
// Remove 0 intervals
|
||||
/*for(i in 0...segmentsOne.length)
|
||||
{
|
||||
if (segmentsOne[i].length == 0)
|
||||
segmentsOne[i] = null;
|
||||
}
|
||||
|
||||
for(i in 0...segmentsTwo.length)
|
||||
{
|
||||
if (segmentsTwo[i].length == 0)
|
||||
segmentsTwo[i] = null;
|
||||
}*/
|
||||
|
||||
// get nps for both hands
|
||||
|
||||
var hand_npsOne:Array<Float> = new Array<Float>();
|
||||
var hand_npsTwo:Array<Float> = new Array<Float>();
|
||||
|
||||
for(i in segmentsOne)
|
||||
{
|
||||
if (i == null)
|
||||
continue;
|
||||
hand_npsOne.push(i.length * scale * 1.6);
|
||||
}
|
||||
for(i in segmentsTwo)
|
||||
{
|
||||
if (i == null)
|
||||
continue;
|
||||
hand_npsTwo.push(i.length * scale * 1.6);
|
||||
}
|
||||
|
||||
// get the diff vector's for all of the hands
|
||||
|
||||
var hand_diffOne:Array<Float> = new Array<Float>();
|
||||
var hand_diffTwo:Array<Float> = new Array<Float>();
|
||||
|
||||
for(i in 0...segmentsOne.length)
|
||||
{
|
||||
var ve = segmentsOne[i];
|
||||
if (ve == null)
|
||||
continue;
|
||||
var fuckYouOne:Array<SmallNote> = [];
|
||||
var fuckYouTwo:Array<SmallNote> = [];
|
||||
for(note in ve)
|
||||
{
|
||||
switch(note.noteData)
|
||||
{
|
||||
case 0: // fingie 1
|
||||
fuckYouOne.push(note);
|
||||
case 1: // fingie 2
|
||||
fuckYouTwo.push(note);
|
||||
}
|
||||
}
|
||||
|
||||
var one = fingieCalc(fuckYouOne,leftHandCol);
|
||||
var two = fingieCalc(fuckYouTwo,leftMHandCol);
|
||||
|
||||
|
||||
var bigFuck = ((((one > two ? one : two) * 8) + (hand_npsOne[i] / scale) * 5) / 13) * scale;
|
||||
|
||||
//trace(bigFuck + " - hand one [" + i + "]");
|
||||
|
||||
|
||||
hand_diffOne.push(bigFuck);
|
||||
}
|
||||
|
||||
for(i in 0...segmentsTwo.length)
|
||||
{
|
||||
var ve = segmentsTwo[i];
|
||||
if (ve == null)
|
||||
continue;
|
||||
var fuckYouOne:Array<SmallNote> = [];
|
||||
var fuckYouTwo:Array<SmallNote> = [];
|
||||
for(note in ve)
|
||||
{
|
||||
switch(note.noteData)
|
||||
{
|
||||
case 2: // fingie 1
|
||||
fuckYouOne.push(note);
|
||||
case 3: // fingie 2
|
||||
fuckYouTwo.push(note);
|
||||
}
|
||||
}
|
||||
|
||||
var one = fingieCalc(fuckYouOne,rightMHandCol);
|
||||
var two = fingieCalc(fuckYouTwo,rightHandCol);
|
||||
|
||||
var bigFuck = ((((one > two ? one : two) * 8) + (hand_npsTwo[i] / scale) * 5) / 13) * scale;
|
||||
|
||||
hand_diffTwo.push(bigFuck);
|
||||
|
||||
// trace(bigFuck + " - hand two [" + i + "]");
|
||||
}
|
||||
|
||||
for (i in 0...4)
|
||||
{
|
||||
smoothBrain(hand_npsOne,0);
|
||||
smoothBrain(hand_npsTwo,0);
|
||||
|
||||
smoothBrainTwo(hand_diffOne);
|
||||
smoothBrainTwo(hand_diffTwo);
|
||||
}
|
||||
|
||||
//trace(hand_diffOne);
|
||||
//trace(hand_diffTwo);
|
||||
|
||||
//trace(hand_npsOne);
|
||||
//trace(hand_npsTwo);
|
||||
|
||||
var point_npsOne:Array<Float> = new Array<Float>();
|
||||
var point_npsTwo:Array<Float> = new Array<Float>();
|
||||
|
||||
for(i in segmentsOne)
|
||||
{
|
||||
if (i == null)
|
||||
continue;
|
||||
point_npsOne.push(i.length);
|
||||
}
|
||||
for(i in segmentsTwo)
|
||||
{
|
||||
if (i == null)
|
||||
continue;
|
||||
point_npsTwo.push(i.length);
|
||||
}
|
||||
|
||||
var maxPoints:Float = 0;
|
||||
|
||||
for(i in point_npsOne)
|
||||
maxPoints += i;
|
||||
for(i in point_npsTwo)
|
||||
maxPoints += i;
|
||||
|
||||
if (accuracy > .965)
|
||||
accuracy = .965;
|
||||
|
||||
lastDiffHandOne = hand_diffOne;
|
||||
lastDiffHandTwo = hand_diffTwo;
|
||||
|
||||
|
||||
return HelperFunctions.truncateFloat(chisel(accuracy,hand_diffOne,hand_diffTwo,point_npsOne,point_npsTwo,maxPoints),2);
|
||||
}
|
||||
|
||||
public static function chisel(scoreGoal:Float,diffOne:Array<Float>,diffTwo:Array<Float>,pointsOne:Array<Float>,pointsTwo:Array<Float>,maxPoints:Float)
|
||||
{
|
||||
var lowerBound:Float = 0;
|
||||
var upperBound:Float = 100;
|
||||
|
||||
while(upperBound - lowerBound > 0.01)
|
||||
{
|
||||
var average:Float = (upperBound + lowerBound) / 2;
|
||||
var amtOfPoints:Float = calcuate(average,diffOne,pointsOne) + calcuate(average,diffTwo,pointsTwo);
|
||||
if (amtOfPoints / maxPoints < scoreGoal)
|
||||
lowerBound = average;
|
||||
else
|
||||
upperBound = average;
|
||||
|
||||
}
|
||||
return upperBound;
|
||||
}
|
||||
|
||||
public static function calcuate(midPoint:Float,diff:Array<Float>,points:Array<Float>)
|
||||
{
|
||||
var output:Float = 0;
|
||||
|
||||
for (i in 0...diff.length)
|
||||
{
|
||||
var res = diff[i];
|
||||
if (midPoint > res)
|
||||
output += points[i];
|
||||
else
|
||||
output += points[i] * Math.pow(midPoint / res,1.2);
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
public static function findStupid(strumTime:Float, array:Array<Float>)
|
||||
{
|
||||
for(i in 0...array.length)
|
||||
if (array[i] == strumTime)
|
||||
return i;
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static function fingieCalc(floats:Array<SmallNote>, columArray:Array<Float>):Float
|
||||
{
|
||||
var sum:Float = 0;
|
||||
if (floats.length == 0)
|
||||
return 0;
|
||||
var startIndex = findStupid(floats[0].strumTime,columArray);
|
||||
if (startIndex == -1)
|
||||
return 0;
|
||||
for(i in floats)
|
||||
{
|
||||
sum += columArray[startIndex + 1] - columArray[startIndex];
|
||||
startIndex++;
|
||||
}
|
||||
|
||||
if (sum == 0)
|
||||
return 0;
|
||||
|
||||
return (1375 * (floats.length)) / sum;
|
||||
}
|
||||
|
||||
// based arrayer
|
||||
// basicily smmoth the shit
|
||||
public static function smoothBrain(npsVector:Array<Float>, weirdchamp:Float)
|
||||
{
|
||||
var floatOne = weirdchamp;
|
||||
var floatTwo = weirdchamp;
|
||||
|
||||
for (i in 0...npsVector.length)
|
||||
{
|
||||
var result = npsVector[i];
|
||||
|
||||
var chunker = floatOne;
|
||||
floatOne = floatTwo;
|
||||
floatTwo = result;
|
||||
|
||||
npsVector[i] = (chunker + floatOne + floatTwo) / 3;
|
||||
}
|
||||
}
|
||||
|
||||
// Smooth the shit but less
|
||||
public static function smoothBrainTwo(diffVector:Array<Float>)
|
||||
{
|
||||
var floatZero:Float = 0;
|
||||
|
||||
for(i in 0...diffVector.length)
|
||||
{
|
||||
var result = diffVector[i];
|
||||
|
||||
var fuck = floatZero;
|
||||
floatZero = result;
|
||||
diffVector[i] = (fuck + floatZero) / 2;
|
||||
}
|
||||
}
|
||||
}
|
506
source/DiffOverview.hx
Normal file
@ -0,0 +1,506 @@
|
||||
package;
|
||||
|
||||
import Conductor.BPMChangeEvent;
|
||||
import flixel.FlxCamera;
|
||||
import flixel.math.FlxRect;
|
||||
import Song.SwagSong;
|
||||
import Section.SwagSection;
|
||||
import flixel.system.FlxSound;
|
||||
import flixel.input.gamepad.FlxGamepad;
|
||||
import flixel.util.FlxAxes;
|
||||
import flixel.FlxSubState;
|
||||
import Options.Option;
|
||||
import flixel.input.FlxInput;
|
||||
import flixel.input.keyboard.FlxKey;
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxObject;
|
||||
import flixel.FlxSprite;
|
||||
import flixel.effects.FlxFlicker;
|
||||
import flixel.graphics.frames.FlxAtlasFrames;
|
||||
import flixel.group.FlxGroup.FlxTypedGroup;
|
||||
import flixel.text.FlxText;
|
||||
import flixel.util.FlxSort;
|
||||
import flixel.tweens.FlxEase;
|
||||
import flixel.tweens.FlxTween;
|
||||
import flixel.util.FlxColor;
|
||||
import io.newgrounds.NG;
|
||||
import lime.app.Application;
|
||||
import lime.utils.Assets;
|
||||
import flixel.math.FlxMath;
|
||||
import flixel.text.FlxText;
|
||||
import flixel.input.FlxKeyManager;
|
||||
|
||||
using StringTools;
|
||||
|
||||
class DiffOverview extends FlxSubState
|
||||
{
|
||||
var blackBox:FlxSprite;
|
||||
|
||||
var handOne:Array<Float>;
|
||||
var handTwo:Array<Float>;
|
||||
|
||||
var giantText:FlxText;
|
||||
|
||||
var SONG:SwagSong;
|
||||
var strumLine:FlxSprite;
|
||||
var camHUD:FlxCamera;
|
||||
|
||||
var offset:FlxText;
|
||||
|
||||
public static var playerStrums:FlxTypedGroup<FlxSprite> = null;
|
||||
|
||||
override function create()
|
||||
{
|
||||
Conductor.songPosition = 0;
|
||||
Conductor.lastSongPos = 0;
|
||||
|
||||
camHUD = new FlxCamera();
|
||||
camHUD.bgColor.alpha = 0;
|
||||
var camGame = new FlxCamera();
|
||||
|
||||
FlxG.cameras.add(camGame);
|
||||
|
||||
FlxG.cameras.add(camHUD);
|
||||
|
||||
FlxCamera.defaultCameras = [camGame];
|
||||
|
||||
playerStrums = new FlxTypedGroup<FlxSprite>();
|
||||
|
||||
SONG = FreeplayState.songData.get(FreeplayState.songs[FreeplayState.curSelected].songName)[FreeplayState.curDifficulty];
|
||||
|
||||
strumLine = new FlxSprite(0, (FlxG.height / 2) - 295).makeGraphic(FlxG.width, 10);
|
||||
strumLine.scrollFactor.set();
|
||||
|
||||
blackBox = new FlxSprite(0, 0).makeGraphic(FlxG.width, FlxG.height, FlxColor.BLACK);
|
||||
blackBox.alpha = 0;
|
||||
add(blackBox);
|
||||
|
||||
FreeplayState.openedPreview = true;
|
||||
|
||||
handOne = DiffCalc.lastDiffHandOne;
|
||||
handTwo = DiffCalc.lastDiffHandTwo;
|
||||
for (i in 0...4)
|
||||
{
|
||||
// FlxG.log.add(i);
|
||||
var babyArrow:FlxSprite = new FlxSprite(0, strumLine.y);
|
||||
|
||||
babyArrow.frames = Paths.getSparrowAtlas('NOTE_assets','shared');
|
||||
babyArrow.animation.addByPrefix('green', 'arrowUP');
|
||||
babyArrow.animation.addByPrefix('blue', 'arrowDOWN');
|
||||
babyArrow.animation.addByPrefix('purple', 'arrowLEFT');
|
||||
babyArrow.animation.addByPrefix('red', 'arrowRIGHT');
|
||||
if(FlxG.save.data.antialiasing)
|
||||
{
|
||||
babyArrow.antialiasing = true;
|
||||
}
|
||||
babyArrow.setGraphicSize(Std.int(babyArrow.width * 0.7));
|
||||
|
||||
switch (Math.abs(i))
|
||||
{
|
||||
case 2:
|
||||
babyArrow.x += Note.swagWidth * 2;
|
||||
babyArrow.animation.addByPrefix('static', 'arrowUP');
|
||||
babyArrow.animation.addByPrefix('pressed', 'up press', 24, false);
|
||||
babyArrow.animation.addByPrefix('confirm', 'up confirm', 24, false);
|
||||
case 3:
|
||||
babyArrow.x += Note.swagWidth * 3;
|
||||
babyArrow.animation.addByPrefix('static', 'arrowRIGHT');
|
||||
babyArrow.animation.addByPrefix('pressed', 'right press', 24, false);
|
||||
babyArrow.animation.addByPrefix('confirm', 'right confirm', 24, false);
|
||||
case 1:
|
||||
babyArrow.x += Note.swagWidth * 1;
|
||||
babyArrow.animation.addByPrefix('static', 'arrowDOWN');
|
||||
babyArrow.animation.addByPrefix('pressed', 'down press', 24, false);
|
||||
babyArrow.animation.addByPrefix('confirm', 'down confirm', 24, false);
|
||||
case 0:
|
||||
babyArrow.x += Note.swagWidth * 0;
|
||||
babyArrow.animation.addByPrefix('static', 'arrowLEFT');
|
||||
babyArrow.animation.addByPrefix('pressed', 'left press', 24, false);
|
||||
babyArrow.animation.addByPrefix('confirm', 'left confirm', 24, false);
|
||||
}
|
||||
|
||||
babyArrow.updateHitbox();
|
||||
babyArrow.scrollFactor.set();
|
||||
|
||||
babyArrow.y -= 10;
|
||||
babyArrow.alpha = 1;
|
||||
|
||||
babyArrow.ID = i;
|
||||
|
||||
playerStrums.add(babyArrow);
|
||||
|
||||
babyArrow.animation.play('static');
|
||||
babyArrow.x += 50;
|
||||
babyArrow.x += ((FlxG.width / 2));
|
||||
}
|
||||
|
||||
add(playerStrums);
|
||||
|
||||
generateSong("assItch");
|
||||
|
||||
playerStrums.cameras = [camHUD];
|
||||
notes.cameras = [camHUD];
|
||||
blackBox.cameras = [camHUD];
|
||||
|
||||
blackBox.x = playerStrums.members[0].x;
|
||||
blackBox.y = strumLine.y;
|
||||
|
||||
camHUD.zoom = 0.6;
|
||||
camHUD.alpha = 0;
|
||||
camHUD.height = 5000;
|
||||
blackBox.height = camHUD.height;
|
||||
|
||||
camHUD.x += 280;
|
||||
|
||||
blackBox.y -= 100;
|
||||
blackBox.x -= 100;
|
||||
|
||||
offset = new FlxText(10,FlxG.height - 40,0,"Offset: " + HelperFunctions.truncateFloat(FlxG.save.data.offset,0) + " (LEFT/RIGHT to decrease/increase)",16);
|
||||
offset.setBorderStyle(FlxTextBorderStyle.OUTLINE,FlxColor.BLACK,4,1);
|
||||
offset.color = FlxColor.WHITE;
|
||||
offset.scrollFactor.set();
|
||||
//add(offset);
|
||||
|
||||
FlxTween.tween(blackBox, {alpha: 0.5}, 1, {ease: FlxEase.expoInOut});
|
||||
FlxTween.tween(camHUD, {alpha: 1}, 0.5, {ease: FlxEase.expoInOut});
|
||||
FlxTween.tween(offset, {alpha: 1}, 0.5, {ease: FlxEase.expoInOut});
|
||||
|
||||
trace('pog');
|
||||
|
||||
super.create();
|
||||
}
|
||||
|
||||
function endSong()
|
||||
{
|
||||
if (stopDoingShit)
|
||||
return;
|
||||
}
|
||||
|
||||
function resyncVocals():Void
|
||||
{
|
||||
vocals.pause();
|
||||
|
||||
FlxG.sound.music.play();
|
||||
Conductor.songPosition = FlxG.sound.music.time;
|
||||
vocals.time = Conductor.songPosition;
|
||||
vocals.play();
|
||||
}
|
||||
|
||||
public var stopDoingShit = false;
|
||||
|
||||
public var currentStep = 0;
|
||||
public var oldStep = 0;
|
||||
|
||||
private function updateCurStep():Void
|
||||
{
|
||||
var lastChange:BPMChangeEvent = {
|
||||
stepTime: 0,
|
||||
songTime: 0,
|
||||
bpm: 0
|
||||
}
|
||||
for (i in 0...Conductor.bpmChangeMap.length)
|
||||
{
|
||||
if (Conductor.songPosition >= Conductor.bpmChangeMap[i].songTime)
|
||||
lastChange = Conductor.bpmChangeMap[i];
|
||||
}
|
||||
|
||||
currentStep = lastChange.stepTime + Math.floor((Conductor.songPosition - lastChange.songTime) / Conductor.stepCrochet);
|
||||
}
|
||||
|
||||
function stepHit()
|
||||
{
|
||||
if (FlxG.sound.music.time > Conductor.songPosition + 20 || FlxG.sound.music.time < Conductor.songPosition - 20)
|
||||
{
|
||||
trace("resync");
|
||||
resyncVocals();
|
||||
}
|
||||
oldStep = currentStep;
|
||||
}
|
||||
|
||||
function offsetChange()
|
||||
{
|
||||
for (i in unspawnNotes)
|
||||
i.strumTime = i.baseStrum + FlxG.save.data.offset;
|
||||
for (i in notes)
|
||||
i.strumTime = i.baseStrum + FlxG.save.data.offset;
|
||||
}
|
||||
|
||||
var frames = 0;
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
super.update(elapsed);
|
||||
|
||||
|
||||
// input
|
||||
|
||||
if (frames < 10)
|
||||
{
|
||||
frames++;
|
||||
return;
|
||||
}
|
||||
|
||||
if (stopDoingShit)
|
||||
return;
|
||||
|
||||
updateCurStep();
|
||||
|
||||
if (oldStep != currentStep && currentStep > 0)
|
||||
stepHit();
|
||||
|
||||
if (FlxG.keys.pressed.SPACE)
|
||||
{
|
||||
stopDoingShit = true;
|
||||
quit();
|
||||
}
|
||||
|
||||
var gamepad:FlxGamepad = FlxG.gamepads.lastActive;
|
||||
|
||||
if (gamepad != null)
|
||||
if (gamepad.justPressed.X)
|
||||
{
|
||||
stopDoingShit = true;
|
||||
quit();
|
||||
}
|
||||
|
||||
/*if (FlxG.keys.pressed.RIGHT)
|
||||
{
|
||||
if (FlxG.keys.pressed.SHIFT)
|
||||
{
|
||||
FlxG.save.data.offset++;
|
||||
offsetChange();
|
||||
}
|
||||
}
|
||||
if (FlxG.keys.pressed.LEFT)
|
||||
{
|
||||
if (FlxG.keys.pressed.SHIFT)
|
||||
{
|
||||
FlxG.save.data.offset--;
|
||||
offsetChange();
|
||||
}
|
||||
}
|
||||
|
||||
if (FlxG.keys.justPressed.RIGHT)
|
||||
{
|
||||
FlxG.save.data.offset++;
|
||||
offsetChange();
|
||||
}
|
||||
if (FlxG.keys.justPressed.LEFT)
|
||||
{
|
||||
FlxG.save.data.offset--;
|
||||
offsetChange();
|
||||
}
|
||||
|
||||
|
||||
offset.text = "Offset: " + HelperFunctions.truncateFloat(FlxG.save.data.offset,0) + " (LEFT/RIGHT to decrease/increase, SHIFT to go faster) - Time: " + HelperFunctions.truncateFloat(Conductor.songPosition / 1000,0) + "s - Step: " + currentStep;
|
||||
*/
|
||||
|
||||
if (vocals != null)
|
||||
if (vocals.playing)
|
||||
Conductor.songPosition += FlxG.elapsed * 1000;
|
||||
|
||||
if (unspawnNotes[0] != null)
|
||||
{
|
||||
if (unspawnNotes[0].strumTime - Conductor.songPosition < 3500)
|
||||
{
|
||||
var dunceNote:Note = unspawnNotes[0];
|
||||
notes.add(dunceNote);
|
||||
|
||||
var index:Int = unspawnNotes.indexOf(dunceNote);
|
||||
unspawnNotes.splice(index, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
notes.forEachAlive(function(daNote:Note)
|
||||
{
|
||||
// instead of doing stupid y > FlxG.height
|
||||
// we be men and actually calculate the time :)
|
||||
if (daNote.tooLate)
|
||||
{
|
||||
daNote.active = false;
|
||||
daNote.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
daNote.visible = true;
|
||||
daNote.active = true;
|
||||
}
|
||||
|
||||
daNote.y = (playerStrums.members[Math.floor(Math.abs(daNote.noteData))].y
|
||||
- 0.45 * (Conductor.songPosition - daNote.strumTime) * FlxMath.roundDecimal(SONG.speed,
|
||||
2));
|
||||
|
||||
if (daNote.isSustainNote)
|
||||
{
|
||||
daNote.y -= daNote.height / 2;
|
||||
|
||||
if ((!daNote.mustPress || daNote.wasGoodHit || daNote.prevNote.wasGoodHit && !daNote.canBeHit)
|
||||
&& daNote.y + daNote.offset.y * daNote.scale.y <= (strumLine.y + Note.swagWidth / 2))
|
||||
{
|
||||
// Clip to strumline
|
||||
var swagRect = new FlxRect(0, 0, daNote.width / daNote.scale.x, daNote.height / daNote.scale.y);
|
||||
swagRect.y = (playerStrums.members[Math.floor(Math.abs(daNote.noteData))].y + Note.swagWidth / 2 - daNote.y) / daNote.scale.y;
|
||||
swagRect.height -= swagRect.y;
|
||||
|
||||
daNote.clipRect = swagRect;
|
||||
}
|
||||
}
|
||||
|
||||
daNote.visible = playerStrums.members[Math.floor(Math.abs(daNote.noteData))].visible;
|
||||
daNote.x = playerStrums.members[Math.floor(Math.abs(daNote.noteData))].x;
|
||||
if (!daNote.isSustainNote)
|
||||
daNote.angle = playerStrums.members[Math.floor(Math.abs(daNote.noteData))].angle;
|
||||
daNote.alpha = playerStrums.members[Math.floor(Math.abs(daNote.noteData))].alpha;
|
||||
|
||||
// auto hit
|
||||
|
||||
if(daNote.y < strumLine.y)
|
||||
{
|
||||
// Force good note hit regardless if it's too late to hit it or not as a fail safe
|
||||
if(daNote.canBeHit && daNote.mustPress || daNote.tooLate && daNote.mustPress)
|
||||
{
|
||||
|
||||
daNote.wasGoodHit = true;
|
||||
vocals.volume = 1;
|
||||
|
||||
daNote.kill();
|
||||
notes.remove(daNote, true);
|
||||
daNote.destroy();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function quit()
|
||||
{
|
||||
FlxTween.tween(blackBox, {alpha: 0}, 1, {ease: FlxEase.expoInOut});
|
||||
FlxTween.tween(camHUD, {alpha: 0}, 1, {ease: FlxEase.expoInOut});
|
||||
FlxTween.tween(offset, {alpha: 0}, 1, {ease: FlxEase.expoInOut});
|
||||
|
||||
vocals.fadeOut();
|
||||
|
||||
FreeplayState.openedPreview = false;
|
||||
}
|
||||
|
||||
var vocals:FlxSound;
|
||||
|
||||
var notes:FlxTypedGroup<Note>;
|
||||
var unspawnNotes:Array<Note> = [];
|
||||
|
||||
public function generateSong(dataPath:String):Void
|
||||
{
|
||||
// FlxG.log.add(ChartParser.parse());
|
||||
|
||||
var songData = FreeplayState.songData.get(FreeplayState.songs[FreeplayState.curSelected].songName)[FreeplayState.curDifficulty];
|
||||
Conductor.changeBPM(songData.bpm);
|
||||
|
||||
if (SONG.needsVoices)
|
||||
vocals = new FlxSound().loadEmbedded(Paths.voices(SONG.song));
|
||||
else
|
||||
vocals = new FlxSound();
|
||||
|
||||
trace('loaded vocals');
|
||||
|
||||
FlxG.sound.list.add(vocals);
|
||||
|
||||
notes = new FlxTypedGroup<Note>();
|
||||
add(notes);
|
||||
|
||||
var noteData:Array<SwagSection>;
|
||||
|
||||
// NEW SHIT
|
||||
noteData = songData.notes;
|
||||
|
||||
var playerCounter:Int = 0;
|
||||
|
||||
var daBeats:Int = 0; // Not exactly representative of 'daBeats' lol, just how much it has looped
|
||||
for (section in noteData)
|
||||
{
|
||||
var coolSection:Int = Std.int(section.lengthInSteps / 4);
|
||||
|
||||
for (songNotes in section.sectionNotes)
|
||||
{
|
||||
var daStrumTime:Float = songNotes[0] + FlxG.save.data.offset;
|
||||
if (daStrumTime < 0)
|
||||
daStrumTime = 0;
|
||||
var daNoteData:Int = Std.int(songNotes[1] % 4);
|
||||
|
||||
var gottaHitNote:Bool = section.mustHitSection;
|
||||
|
||||
if (songNotes[1] > 3)
|
||||
{
|
||||
gottaHitNote = !section.mustHitSection;
|
||||
}
|
||||
|
||||
var oldNote:Note;
|
||||
if (unspawnNotes.length > 0)
|
||||
oldNote = unspawnNotes[Std.int(unspawnNotes.length - 1)];
|
||||
else
|
||||
oldNote = null;
|
||||
|
||||
var swagNote:Note = new Note(daStrumTime, daNoteData, oldNote,false, true);
|
||||
|
||||
|
||||
if (!gottaHitNote)
|
||||
continue;
|
||||
|
||||
swagNote.baseStrum = Math.round(songNotes[0]);
|
||||
|
||||
swagNote.sustainLength = songNotes[2];
|
||||
swagNote.scrollFactor.set(0, 0);
|
||||
|
||||
var susLength:Float = swagNote.sustainLength;
|
||||
|
||||
susLength = susLength / Conductor.stepCrochet;
|
||||
unspawnNotes.push(swagNote);
|
||||
|
||||
for (susNote in 0...Math.floor(susLength))
|
||||
{
|
||||
oldNote = unspawnNotes[Std.int(unspawnNotes.length - 1)];
|
||||
|
||||
var sustainNote:Note = new Note(daStrumTime + (Conductor.stepCrochet * susNote) + Conductor.stepCrochet, daNoteData, oldNote, true, true);
|
||||
sustainNote.scrollFactor.set();
|
||||
unspawnNotes.push(sustainNote);
|
||||
|
||||
sustainNote.mustPress = gottaHitNote;
|
||||
|
||||
if (sustainNote.mustPress)
|
||||
{
|
||||
sustainNote.x += FlxG.width / 2; // general offset
|
||||
}
|
||||
}
|
||||
|
||||
swagNote.mustPress = gottaHitNote;
|
||||
|
||||
if (swagNote.mustPress)
|
||||
{
|
||||
swagNote.x += FlxG.width / 2; // general offset
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
}
|
||||
daBeats += 1;
|
||||
}
|
||||
|
||||
// trace(unspawnNotes.length);
|
||||
// playerCounter += 1;
|
||||
|
||||
unspawnNotes.sort(sortByShit);
|
||||
|
||||
Conductor.mapBPMChanges(SONG);
|
||||
Conductor.changeBPM(SONG.bpm);
|
||||
|
||||
FlxG.sound.playMusic(Paths.inst(SONG.song), 1, false);
|
||||
FlxG.sound.music.onComplete = endSong;
|
||||
vocals.play();
|
||||
}
|
||||
|
||||
function sortByShit(Obj1:Note, Obj2:Note):Int
|
||||
{
|
||||
return FlxSort.byValues(FlxSort.ASCENDING, Obj1.strumTime, Obj2.strumTime);
|
||||
}
|
||||
}
|
@ -1,5 +1,13 @@
|
||||
package;
|
||||
|
||||
import openfl.utils.Future;
|
||||
import openfl.media.Sound;
|
||||
import flixel.system.FlxSound;
|
||||
#if sys
|
||||
import smTools.SMFile;
|
||||
import sys.FileSystem;
|
||||
import sys.io.File;
|
||||
#end
|
||||
import Song.SwagSong;
|
||||
import flixel.input.gamepad.FlxGamepad;
|
||||
import flash.text.TextField;
|
||||
import flixel.FlxG;
|
||||
@ -20,15 +28,17 @@ using StringTools;
|
||||
|
||||
class FreeplayState extends MusicBeatState
|
||||
{
|
||||
var songs:Array<SongMetadata> = [];
|
||||
public static var songs:Array<SongMetadata> = [];
|
||||
|
||||
var selector:FlxText;
|
||||
var curSelected:Int = 0;
|
||||
var curDifficulty:Int = 1;
|
||||
public static var curSelected:Int = 0;
|
||||
public static var curDifficulty:Int = 1;
|
||||
|
||||
var scoreText:FlxText;
|
||||
var comboText:FlxText;
|
||||
var diffText:FlxText;
|
||||
var diffCalcText:FlxText;
|
||||
var previewtext:FlxText;
|
||||
var lerpScore:Int = 0;
|
||||
var intendedScore:Int = 0;
|
||||
var combo:String = '';
|
||||
@ -38,16 +48,82 @@ class FreeplayState extends MusicBeatState
|
||||
|
||||
private var iconArray:Array<HealthIcon> = [];
|
||||
|
||||
public static var openedPreview = false;
|
||||
|
||||
public static var songData:Map<String,Array<SwagSong>> = [];
|
||||
|
||||
public static function loadDiff(diff:Int, format:String, name:String, array:Array<SwagSong>)
|
||||
{
|
||||
try
|
||||
{
|
||||
array.push(Song.loadFromJson(Highscore.formatSong(format, diff), name));
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
// do nada
|
||||
}
|
||||
}
|
||||
|
||||
override function create()
|
||||
{
|
||||
var initSonglist = CoolUtil.coolTextFile(Paths.txt('freeplaySonglist'));
|
||||
var initSonglist = CoolUtil.coolTextFile(Paths.txt('data/freeplaySonglist'));
|
||||
|
||||
//var diffList = "";
|
||||
|
||||
songData = [];
|
||||
songs = [];
|
||||
|
||||
for (i in 0...initSonglist.length)
|
||||
{
|
||||
var data:Array<String> = initSonglist[i].split(':');
|
||||
songs.push(new SongMetadata(data[0], Std.parseInt(data[2]), data[1]));
|
||||
var meta = new SongMetadata(data[0], Std.parseInt(data[2]), data[1]);
|
||||
songs.push(meta);
|
||||
var format = StringTools.replace(meta.songName, " ", "-");
|
||||
switch (format) {
|
||||
case 'Dad-Battle': format = 'Dadbattle';
|
||||
case 'Philly-Nice': format = 'Philly';
|
||||
}
|
||||
|
||||
var diffs = [];
|
||||
FreeplayState.loadDiff(0,format,meta.songName,diffs);
|
||||
FreeplayState.loadDiff(1,format,meta.songName,diffs);
|
||||
FreeplayState.loadDiff(2,format,meta.songName,diffs);
|
||||
FreeplayState.songData.set(meta.songName,diffs);
|
||||
trace('loaded diffs for ' + meta.songName);
|
||||
|
||||
}
|
||||
|
||||
trace("tryin to load sm files");
|
||||
|
||||
#if sys
|
||||
for(i in FileSystem.readDirectory("assets/sm/"))
|
||||
{
|
||||
trace(i);
|
||||
if (FileSystem.isDirectory("assets/sm/" + i))
|
||||
{
|
||||
trace("Reading SM file dir " + i);
|
||||
for (file in FileSystem.readDirectory("assets/sm/" + i))
|
||||
{
|
||||
if (file.contains(" "))
|
||||
FileSystem.rename("assets/sm/" + i + "/" + file,"assets/sm/" + i + "/" + file.replace(" ","_"));
|
||||
if (file.endsWith(".sm"))
|
||||
{
|
||||
trace("reading " + file);
|
||||
var file:SMFile = SMFile.loadFile("assets/sm/" + i + "/" + file.replace(" ","_"));
|
||||
trace("Converting " + file.header.TITLE);
|
||||
var data = file.convertToFNF("assets/sm/" + i + "/converted.json");
|
||||
var meta = new SongMetadata(file.header.TITLE, 0, "sm",file,"assets/sm/" + i);
|
||||
songs.push(meta);
|
||||
var song = Song.loadFromJsonRAW(data);
|
||||
songData.set(file.header.TITLE, [song,song,song]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#end
|
||||
|
||||
//trace("\n" + diffList);
|
||||
|
||||
/*
|
||||
if (FlxG.sound.music != null)
|
||||
{
|
||||
@ -67,11 +143,17 @@ class FreeplayState extends MusicBeatState
|
||||
isDebug = true;
|
||||
#end
|
||||
|
||||
persistentUpdate = true;
|
||||
|
||||
// LOAD MUSIC
|
||||
|
||||
// LOAD CHARACTERS
|
||||
|
||||
var bg:FlxSprite = new FlxSprite().loadGraphic(Paths.image('menuBGBlue'));
|
||||
if(FlxG.save.data.antialiasing)
|
||||
{
|
||||
bg.antialiasing = true;
|
||||
}
|
||||
add(bg);
|
||||
|
||||
grpSongs = new FlxTypedGroup<Alphabet>();
|
||||
@ -101,7 +183,7 @@ class FreeplayState extends MusicBeatState
|
||||
scoreText.setFormat(Paths.font("vcr.ttf"), 32, FlxColor.WHITE, RIGHT);
|
||||
// scoreText.alignment = RIGHT;
|
||||
|
||||
var scoreBG:FlxSprite = new FlxSprite(scoreText.x - 6, 0).makeGraphic(Std.int(FlxG.width * 0.35), 66, 0xFF000000);
|
||||
var scoreBG:FlxSprite = new FlxSprite(scoreText.x - 6, 0).makeGraphic(Std.int(FlxG.width * 0.35), 105, 0xFF000000);
|
||||
scoreBG.alpha = 0.6;
|
||||
add(scoreBG);
|
||||
|
||||
@ -109,6 +191,14 @@ class FreeplayState extends MusicBeatState
|
||||
diffText.font = scoreText.font;
|
||||
add(diffText);
|
||||
|
||||
diffCalcText = new FlxText(scoreText.x, scoreText.y + 66, 0, "", 24);
|
||||
diffCalcText.font = scoreText.font;
|
||||
add(diffCalcText);
|
||||
|
||||
previewtext = new FlxText(scoreText.x, scoreText.y + 94, 0, "" + (KeyBinds.gamepad ? "X" : "SPACE") + " to preview", 24);
|
||||
previewtext.font = scoreText.font;
|
||||
//add(previewtext);
|
||||
|
||||
comboText = new FlxText(diffText.x + 100, diffText.y, 0, "", 24);
|
||||
comboText.font = diffText.font;
|
||||
add(comboText);
|
||||
@ -185,14 +275,20 @@ class FreeplayState extends MusicBeatState
|
||||
scoreText.text = "PERSONAL BEST:" + lerpScore;
|
||||
comboText.text = combo + '\n';
|
||||
|
||||
if (FlxG.sound.music.volume > 0.8)
|
||||
{
|
||||
FlxG.sound.music.volume -= 0.5 * FlxG.elapsed;
|
||||
}
|
||||
|
||||
var upP = FlxG.keys.justPressed.UP;
|
||||
var downP = FlxG.keys.justPressed.DOWN;
|
||||
var accepted = controls.ACCEPT;
|
||||
var accepted = FlxG.keys.justPressed.ENTER;
|
||||
|
||||
var gamepad:FlxGamepad = FlxG.gamepads.lastActive;
|
||||
|
||||
if (gamepad != null)
|
||||
{
|
||||
|
||||
if (gamepad.justPressed.DPAD_UP)
|
||||
{
|
||||
changeSelection(-1);
|
||||
@ -209,6 +305,9 @@ class FreeplayState extends MusicBeatState
|
||||
{
|
||||
changeDiff(1);
|
||||
}
|
||||
|
||||
//if (gamepad.justPressed.X && !openedPreview)
|
||||
//openSubState(new DiffOverview());
|
||||
}
|
||||
|
||||
if (upP)
|
||||
@ -220,6 +319,9 @@ class FreeplayState extends MusicBeatState
|
||||
changeSelection(1);
|
||||
}
|
||||
|
||||
//if (FlxG.keys.justPressed.SPACE && !openedPreview)
|
||||
//openSubState(new DiffOverview());
|
||||
|
||||
if (FlxG.keys.justPressed.LEFT)
|
||||
changeDiff(-1);
|
||||
if (FlxG.keys.justPressed.RIGHT)
|
||||
@ -238,18 +340,36 @@ class FreeplayState extends MusicBeatState
|
||||
case 'Dad-Battle': songFormat = 'Dadbattle';
|
||||
case 'Philly-Nice': songFormat = 'Philly';
|
||||
}
|
||||
var hmm;
|
||||
try
|
||||
{
|
||||
hmm = songData.get(songs[curSelected].songName)[curDifficulty];
|
||||
if (hmm == null)
|
||||
return;
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
trace(songs[curSelected].songName);
|
||||
|
||||
var poop:String = Highscore.formatSong(songFormat, curDifficulty);
|
||||
|
||||
trace(poop);
|
||||
|
||||
PlayState.SONG = Song.loadFromJson(poop, songs[curSelected].songName);
|
||||
PlayState.SONG = hmm;
|
||||
PlayState.isStoryMode = false;
|
||||
PlayState.storyDifficulty = curDifficulty;
|
||||
PlayState.storyWeek = songs[curSelected].week;
|
||||
trace('CUR WEEK' + PlayState.storyWeek);
|
||||
#if sys
|
||||
if (songs[curSelected].songCharacter == "sm")
|
||||
{
|
||||
PlayState.isSM = true;
|
||||
PlayState.sm = songs[curSelected].sm;
|
||||
PlayState.pathToSm = songs[curSelected].path;
|
||||
}
|
||||
else
|
||||
PlayState.isSM = false;
|
||||
#else
|
||||
PlayState.isSM = false;
|
||||
#end
|
||||
LoadingState.loadAndSwitchState(new PlayState());
|
||||
}
|
||||
}
|
||||
@ -263,6 +383,7 @@ class FreeplayState extends MusicBeatState
|
||||
if (curDifficulty > 2)
|
||||
curDifficulty = 0;
|
||||
|
||||
|
||||
// adjusting the highscore song name to be compatible (changeDiff)
|
||||
var songHighscore = StringTools.replace(songs[curSelected].songName, " ", "-");
|
||||
switch (songHighscore) {
|
||||
@ -274,7 +395,7 @@ class FreeplayState extends MusicBeatState
|
||||
intendedScore = Highscore.getScore(songHighscore, curDifficulty);
|
||||
combo = Highscore.getCombo(songHighscore, curDifficulty);
|
||||
#end
|
||||
|
||||
diffCalcText.text = 'RATING: ${DiffCalc.CalculateDiff(songData.get(songs[curSelected].songName)[curDifficulty])}';
|
||||
diffText.text = CoolUtil.difficultyFromInt(curDifficulty).toUpperCase();
|
||||
}
|
||||
|
||||
@ -287,6 +408,8 @@ class FreeplayState extends MusicBeatState
|
||||
// NGio.logEvent('Fresh');
|
||||
FlxG.sound.play(Paths.sound('scrollMenu'), 0.4);
|
||||
|
||||
|
||||
|
||||
curSelected += change;
|
||||
|
||||
if (curSelected < 0)
|
||||
@ -310,10 +433,38 @@ class FreeplayState extends MusicBeatState
|
||||
// lerpScore = 0;
|
||||
#end
|
||||
|
||||
diffCalcText.text = 'RATING: ${DiffCalc.CalculateDiff(songData.get(songs[curSelected].songName)[curDifficulty])}';
|
||||
|
||||
#if PRELOAD_ALL
|
||||
if (songs[curSelected].songCharacter == "sm")
|
||||
{
|
||||
var data = songs[curSelected];
|
||||
trace("Loading " + data.path + "/" + data.sm.header.MUSIC);
|
||||
var bytes = File.getBytes(data.path + "/" + data.sm.header.MUSIC);
|
||||
var sound = new Sound();
|
||||
sound.loadCompressedDataFromByteArray(bytes.getData(), bytes.length);
|
||||
FlxG.sound.playMusic(sound);
|
||||
}
|
||||
else
|
||||
FlxG.sound.playMusic(Paths.inst(songs[curSelected].songName), 0);
|
||||
#end
|
||||
|
||||
var hmm;
|
||||
try
|
||||
{
|
||||
hmm = songData.get(songs[curSelected].songName)[curDifficulty];
|
||||
if (hmm != null)
|
||||
Conductor.changeBPM(hmm.bpm);
|
||||
}
|
||||
catch(ex)
|
||||
{}
|
||||
|
||||
if (openedPreview)
|
||||
{
|
||||
closeSubState();
|
||||
openSubState(new DiffOverview());
|
||||
}
|
||||
|
||||
var bullShit:Int = 0;
|
||||
|
||||
for (i in 0...iconArray.length)
|
||||
@ -344,12 +495,27 @@ class SongMetadata
|
||||
{
|
||||
public var songName:String = "";
|
||||
public var week:Int = 0;
|
||||
#if sys
|
||||
public var sm:SMFile;
|
||||
public var path:String;
|
||||
#end
|
||||
public var songCharacter:String = "";
|
||||
|
||||
#if sys
|
||||
public function new(song:String, week:Int, songCharacter:String, ?sm:SMFile = null, ?path:String = "")
|
||||
{
|
||||
this.songName = song;
|
||||
this.week = week;
|
||||
this.songCharacter = songCharacter;
|
||||
this.sm = sm;
|
||||
this.path = path;
|
||||
}
|
||||
#else
|
||||
public function new(song:String, week:Int, songCharacter:String)
|
||||
{
|
||||
this.songName = song;
|
||||
this.week = week;
|
||||
this.songCharacter = songCharacter;
|
||||
}
|
||||
#end
|
||||
}
|
||||
|
@ -41,7 +41,10 @@ class GameOverState extends FlxTransitionableState
|
||||
restart.setGraphicSize(Std.int(restart.width * 0.6));
|
||||
restart.updateHitbox();
|
||||
restart.alpha = 0;
|
||||
if(FlxG.save.data.antialiasing)
|
||||
{
|
||||
restart.antialiasing = true;
|
||||
}
|
||||
add(restart);
|
||||
|
||||
FlxG.sound.music.fadeOut(2, FlxG.sound.music.volume * 0.6);
|
||||
|
@ -48,6 +48,8 @@ class GameOverSubstate extends MusicBeatSubstate
|
||||
bf.playAnim('firstDeath');
|
||||
}
|
||||
|
||||
var startVibin:Bool = false;
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
super.update(elapsed);
|
||||
@ -76,6 +78,7 @@ class GameOverSubstate extends MusicBeatSubstate
|
||||
if (bf.animation.curAnim.name == 'firstDeath' && bf.animation.curAnim.finished)
|
||||
{
|
||||
FlxG.sound.playMusic(Paths.music('gameOver' + stageSuffix));
|
||||
startVibin = true;
|
||||
}
|
||||
|
||||
if (FlxG.sound.music.playing)
|
||||
@ -88,6 +91,10 @@ class GameOverSubstate extends MusicBeatSubstate
|
||||
{
|
||||
super.beatHit();
|
||||
|
||||
if (startVibin && !isEnding)
|
||||
{
|
||||
bf.playAnim('deathLoop', true);
|
||||
}
|
||||
FlxG.log.add('beat');
|
||||
}
|
||||
|
||||
@ -97,6 +104,7 @@ class GameOverSubstate extends MusicBeatSubstate
|
||||
{
|
||||
if (!isEnding)
|
||||
{
|
||||
PlayState.startTime = 0;
|
||||
isEnding = true;
|
||||
bf.playAnim('deathConfirm', true);
|
||||
FlxG.sound.music.stop();
|
||||
|
@ -33,6 +33,7 @@ class GameplayCustomizeState extends MusicBeatState
|
||||
|
||||
var bf:Boyfriend;
|
||||
var dad:Character;
|
||||
var gf:Character;
|
||||
|
||||
var strumLine:FlxSprite;
|
||||
var strumLineNotes:FlxTypedGroup<FlxSprite>;
|
||||
@ -42,7 +43,7 @@ class GameplayCustomizeState extends MusicBeatState
|
||||
public override function create() {
|
||||
#if windows
|
||||
// Updating Discord Rich Presence
|
||||
DiscordClient.changePresence("Customizing Gameplay", null);
|
||||
DiscordClient.changePresence("Customizing Gameplay Modules", null);
|
||||
#end
|
||||
|
||||
sick = new FlxSprite().loadGraphic(Paths.image('sick','shared'));
|
||||
@ -51,7 +52,7 @@ class GameplayCustomizeState extends MusicBeatState
|
||||
curt = new FlxSprite(-500, -300).loadGraphic(Paths.image('stagecurtains','shared'));
|
||||
front = new FlxSprite(-650, 600).loadGraphic(Paths.image('stagefront','shared'));
|
||||
|
||||
Conductor.changeBPM(102);
|
||||
//Conductor.changeBPM(102);
|
||||
persistentUpdate = true;
|
||||
|
||||
super.create();
|
||||
@ -74,10 +75,14 @@ class GameplayCustomizeState extends MusicBeatState
|
||||
|
||||
bf = new Boyfriend(770, 450, 'bf');
|
||||
|
||||
gf = new Character(400, 130, 'gf');
|
||||
gf.scrollFactor.set(0.95, 0.95);
|
||||
|
||||
var camPos:FlxPoint = new FlxPoint(dad.getGraphicMidpoint().x + 400, dad.getGraphicMidpoint().y);
|
||||
|
||||
camFollow.setPosition(camPos.x, camPos.y);
|
||||
|
||||
add(gf);
|
||||
add(bf);
|
||||
add(dad);
|
||||
|
||||
@ -111,7 +116,7 @@ class GameplayCustomizeState extends MusicBeatState
|
||||
generateStaticArrows(0);
|
||||
generateStaticArrows(1);
|
||||
|
||||
text = new FlxText(5, FlxG.height + 40, 0, "Drag around gameplay elements, R to reset, Escape to go back.", 12);
|
||||
text = new FlxText(5, FlxG.height + 40, 0, "Click and drag around gameplay elements to customize their positions.\nPress R to reset.\nPress Escape to go back.", 12);
|
||||
text.scrollFactor.set();
|
||||
text.setFormat("VCR OSD Mono", 16, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
|
||||
|
||||
@ -188,8 +193,9 @@ class GameplayCustomizeState extends MusicBeatState
|
||||
{
|
||||
super.beatHit();
|
||||
|
||||
bf.playAnim('idle');
|
||||
dad.dance();
|
||||
bf.playAnim('idle', true);
|
||||
dad.dance(true);
|
||||
gf.dance();
|
||||
|
||||
FlxG.camera.zoom += 0.015;
|
||||
camHUD.zoom += 0.010;
|
||||
|
@ -22,12 +22,20 @@ class GitarooPause extends MusicBeatState
|
||||
FlxG.sound.music.stop();
|
||||
|
||||
var bg:FlxSprite = new FlxSprite().loadGraphic(Paths.image('pauseAlt/pauseBG'));
|
||||
if(FlxG.save.data.antialiasing)
|
||||
{
|
||||
bg.antialiasing = true;
|
||||
}
|
||||
add(bg);
|
||||
|
||||
var bf:FlxSprite = new FlxSprite(0, 30);
|
||||
bf.frames = Paths.getSparrowAtlas('pauseAlt/bfLol');
|
||||
bf.animation.addByPrefix('lol', "funnyThing", 13);
|
||||
bf.animation.play('lol');
|
||||
if(FlxG.save.data.antialiasing)
|
||||
{
|
||||
bf.antialiasing = true;
|
||||
}
|
||||
add(bf);
|
||||
bf.screenCenter(X);
|
||||
|
||||
@ -36,6 +44,10 @@ class GitarooPause extends MusicBeatState
|
||||
replayButton.animation.addByPrefix('selected', 'bluereplay', 0, false);
|
||||
replayButton.animation.appendByPrefix('selected', 'yellowreplay');
|
||||
replayButton.animation.play('selected');
|
||||
if(FlxG.save.data.antialiasing)
|
||||
{
|
||||
replayButton.antialiasing = true;
|
||||
}
|
||||
add(replayButton);
|
||||
|
||||
cancelButton = new FlxSprite(FlxG.width * 0.58, replayButton.y);
|
||||
@ -43,6 +55,10 @@ class GitarooPause extends MusicBeatState
|
||||
cancelButton.animation.addByPrefix('selected', 'bluecancel', 0, false);
|
||||
cancelButton.animation.appendByPrefix('selected', 'cancelyellow');
|
||||
cancelButton.animation.play('selected');
|
||||
if(FlxG.save.data.antialiasing)
|
||||
{
|
||||
cancelButton.antialiasing = true;
|
||||
}
|
||||
add(cancelButton);
|
||||
|
||||
changeThing();
|
||||
|
@ -1,5 +1,6 @@
|
||||
package;
|
||||
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxSprite;
|
||||
|
||||
class HealthIcon extends FlxSprite
|
||||
@ -13,9 +14,16 @@ class HealthIcon extends FlxSprite
|
||||
{
|
||||
super();
|
||||
|
||||
loadGraphic(Paths.image('iconGrid'), true, 150, 150);
|
||||
|
||||
if(FlxG.save.data.antialiasing)
|
||||
{
|
||||
antialiasing = true;
|
||||
}
|
||||
if (char == 'sm')
|
||||
{
|
||||
loadGraphic(Paths.image("stepmania-icon"));
|
||||
return;
|
||||
}
|
||||
loadGraphic(Paths.image('iconGrid'), true, 150, 150);
|
||||
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);
|
||||
|
@ -12,4 +12,5 @@ class HelperFunctions
|
||||
public static function GCD(a, b) {
|
||||
return b == 0 ? FlxMath.absInt(a) : GCD(b, a % b);
|
||||
}
|
||||
|
||||
}
|
@ -6,12 +6,21 @@ class KadeEngineData
|
||||
{
|
||||
public static function initSave()
|
||||
{
|
||||
if (FlxG.save.data.weekUnlocked == null)
|
||||
FlxG.save.data.weekUnlocked = 7;
|
||||
|
||||
if (FlxG.save.data.newInput == null)
|
||||
FlxG.save.data.newInput = true;
|
||||
|
||||
if (FlxG.save.data.downscroll == null)
|
||||
FlxG.save.data.downscroll = false;
|
||||
|
||||
if (FlxG.save.data.antialiasing == null)
|
||||
FlxG.save.data.antialiasing = true;
|
||||
|
||||
if (FlxG.save.data.missSounds == null)
|
||||
FlxG.save.data.missSounds = true;
|
||||
|
||||
if (FlxG.save.data.dfjk == null)
|
||||
FlxG.save.data.dfjk = false;
|
||||
|
||||
@ -64,6 +73,9 @@ class KadeEngineData
|
||||
if (FlxG.save.data.distractions == null)
|
||||
FlxG.save.data.distractions = true;
|
||||
|
||||
if (FlxG.save.data.stepMania == null)
|
||||
FlxG.save.data.stepMania = false;
|
||||
|
||||
if (FlxG.save.data.flashing == null)
|
||||
FlxG.save.data.flashing = true;
|
||||
|
||||
@ -94,6 +106,9 @@ class KadeEngineData
|
||||
if (FlxG.save.data.optimize == null)
|
||||
FlxG.save.data.optimize = false;
|
||||
|
||||
if (FlxG.save.data.cacheImages == null)
|
||||
FlxG.save.data.cacheImages = false;
|
||||
|
||||
var gamepad:FlxGamepad = FlxG.gamepads.lastActive;
|
||||
|
||||
KeyBinds.gamepad = gamepad != null;
|
||||
|
@ -119,6 +119,8 @@ class KeyBindMenu extends FlxSubState
|
||||
if (frames <= 10)
|
||||
frames++;
|
||||
|
||||
infoText.text = 'Current Mode: ${KeyBinds.gamepad ? 'GAMEPAD' : 'KEYBOARD'}. Press TAB to switch\n(${KeyBinds.gamepad ? 'RIGHT Trigger' : 'Escape'} to save, ${KeyBinds.gamepad ? 'LEFT Trigger' : 'Backspace'} to leave without saving. ${KeyBinds.gamepad ? 'START To change a keybind' : ''})\n${lastKey != "" ? lastKey + " is blacklisted!" : ""}';
|
||||
|
||||
switch(state){
|
||||
|
||||
case "select":
|
||||
@ -137,7 +139,6 @@ class KeyBindMenu extends FlxSubState
|
||||
if (FlxG.keys.justPressed.TAB)
|
||||
{
|
||||
KeyBinds.gamepad = !KeyBinds.gamepad;
|
||||
infoText.text = 'Current Mode: ${KeyBinds.gamepad ? 'GAMEPAD' : 'KEYBOARD'}. Press TAB to switch\n(${KeyBinds.gamepad ? 'RIGHT Trigger' : 'Escape'} to save, ${KeyBinds.gamepad ? 'LEFT Trigger' : 'Backspace'} to leave without saving. ${KeyBinds.gamepad ? 'START To change a keybind' : ''})';
|
||||
textUpdate();
|
||||
}
|
||||
|
||||
@ -320,7 +321,7 @@ class KeyBindMenu extends FlxSubState
|
||||
|
||||
var shouldReturn:Bool = true;
|
||||
|
||||
var notAllowed:Array<String> = ["START", "RIGHT_TRIGGER", "LEFT_TRIGGER"];
|
||||
var notAllowed:Array<String> = ["START"];
|
||||
|
||||
for(x in 0...gpKeys.length)
|
||||
{
|
||||
@ -330,6 +331,7 @@ class KeyBindMenu extends FlxSubState
|
||||
if (notAllowed.contains(oK))
|
||||
{
|
||||
gpKeys[x] = null;
|
||||
lastKey = r;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -340,14 +342,13 @@ class KeyBindMenu extends FlxSubState
|
||||
}
|
||||
else{
|
||||
gpKeys[curSelected] = tempKey;
|
||||
FlxG.sound.play(Paths.sound('scrollMenu'));
|
||||
keyWarning.alpha = 1;
|
||||
warningTween.cancel();
|
||||
warningTween = FlxTween.tween(keyWarning, {alpha: 0}, 0.5, {ease: FlxEase.circOut, startDelay: 2});
|
||||
lastKey = r;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public var lastKey:String = "";
|
||||
|
||||
function addKey(r:String){
|
||||
|
||||
var shouldReturn:Bool = true;
|
||||
@ -366,6 +367,7 @@ class KeyBindMenu extends FlxSubState
|
||||
if (notAllowed.contains(oK))
|
||||
{
|
||||
keys[x] = null;
|
||||
lastKey = oK;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -373,19 +375,19 @@ class KeyBindMenu extends FlxSubState
|
||||
if (r.contains("NUMPAD"))
|
||||
{
|
||||
keys[curSelected] = null;
|
||||
lastKey = r;
|
||||
return;
|
||||
}
|
||||
|
||||
lastKey = "";
|
||||
|
||||
if(shouldReturn){
|
||||
keys[curSelected] = r;
|
||||
FlxG.sound.play(Paths.sound('scrollMenu'));
|
||||
}
|
||||
else{
|
||||
keys[curSelected] = tempKey;
|
||||
FlxG.sound.play(Paths.sound('scrollMenu'));
|
||||
keyWarning.alpha = 1;
|
||||
warningTween.cancel();
|
||||
warningTween = FlxTween.tween(keyWarning, {alpha: 0}, 0.5, {ease: FlxEase.circOut, startDelay: 2});
|
||||
lastKey = r;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,12 @@
|
||||
package;
|
||||
|
||||
import haxe.Exception;
|
||||
import lime.app.Application;
|
||||
|
||||
#if sys
|
||||
import smTools.SMFile;
|
||||
import sys.FileSystem;
|
||||
#end
|
||||
import Controls.KeyboardScheme;
|
||||
import Controls.Control;
|
||||
import flash.text.TextField;
|
||||
@ -64,7 +71,10 @@ class LoadReplayState extends MusicBeatState
|
||||
menuBG.setGraphicSize(Std.int(menuBG.width * 1.1));
|
||||
menuBG.updateHitbox();
|
||||
menuBG.screenCenter();
|
||||
if(FlxG.save.data.antialiasing)
|
||||
{
|
||||
menuBG.antialiasing = true;
|
||||
}
|
||||
add(menuBG);
|
||||
|
||||
grpControls = new FlxTypedGroup<Alphabet>();
|
||||
@ -161,9 +171,55 @@ class LoadReplayState extends MusicBeatState
|
||||
case 'philly-nice': songFormat = 'Philly';
|
||||
}
|
||||
|
||||
var poop:String = Highscore.formatSong(songFormat, PlayState.rep.replay.songDiff);
|
||||
var poop = "";
|
||||
|
||||
#if sys
|
||||
if (PlayState.rep.replay.sm)
|
||||
if (!FileSystem.exists(StringTools.replace(PlayState.rep.replay.chartPath,"converted.json","")))
|
||||
{
|
||||
Application.current.window.alert("The SM file in this replay does not exist!","SM Replays");
|
||||
return;
|
||||
}
|
||||
#end
|
||||
|
||||
PlayState.isSM = PlayState.rep.replay.sm;
|
||||
#if sys
|
||||
if (PlayState.isSM)
|
||||
PlayState.pathToSm = StringTools.replace(PlayState.rep.replay.chartPath,"converted.json","");
|
||||
#end
|
||||
|
||||
#if sys
|
||||
if (PlayState.isSM)
|
||||
{
|
||||
poop = File.getContent(PlayState.rep.replay.chartPath);
|
||||
try
|
||||
{
|
||||
PlayState.sm = SMFile.loadFile(PlayState.pathToSm + "/" + StringTools.replace(PlayState.rep.replay.songName," ", "_") + ".sm");
|
||||
}
|
||||
catch(e:Exception)
|
||||
{
|
||||
Application.current.window.alert("Make sure that the SM file is called " + PlayState.pathToSm + "/" + StringTools.replace(PlayState.rep.replay.songName," ", "_") + ".sm!\nAs I couldn't read it.","SM Replays");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
poop = Highscore.formatSong(songFormat, PlayState.rep.replay.songDiff);
|
||||
#else
|
||||
poop = Highscore.formatSong(songFormat, PlayState.rep.replay.songDiff);
|
||||
#end
|
||||
|
||||
try
|
||||
{
|
||||
if (PlayState.isSM)
|
||||
PlayState.SONG = Song.loadFromJsonRAW(poop);
|
||||
else
|
||||
PlayState.SONG = Song.loadFromJson(poop, PlayState.rep.replay.songName);
|
||||
}
|
||||
catch(e:Exception)
|
||||
{
|
||||
Application.current.window.alert("Failed to load the song! Does the JSON exist?","Replays");
|
||||
return;
|
||||
}
|
||||
PlayState.isStoryMode = false;
|
||||
PlayState.storyDifficulty = PlayState.rep.replay.songDiff;
|
||||
PlayState.storyWeek = getWeekNumbFromSong(PlayState.rep.replay.songName);
|
||||
|
@ -38,7 +38,10 @@ class LoadingState extends MusicBeatState
|
||||
{
|
||||
logo = new FlxSprite(-150, -100);
|
||||
logo.frames = Paths.getSparrowAtlas('logoBumpin');
|
||||
if(FlxG.save.data.antialiasing)
|
||||
{
|
||||
logo.antialiasing = true;
|
||||
}
|
||||
logo.animation.addByPrefix('bump', 'logo bumpin', 24);
|
||||
logo.animation.play('bump');
|
||||
logo.updateHitbox();
|
||||
@ -49,7 +52,10 @@ class LoadingState extends MusicBeatState
|
||||
gfDance.frames = Paths.getSparrowAtlas('gfDanceTitle');
|
||||
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);
|
||||
if(FlxG.save.data.antialiasing)
|
||||
{
|
||||
gfDance.antialiasing = true;
|
||||
}
|
||||
add(gfDance);
|
||||
add(logo);
|
||||
|
||||
|
@ -1,8 +1,11 @@
|
||||
package;
|
||||
|
||||
import lime.app.Application;
|
||||
#if windows
|
||||
import Discord.DiscordClient;
|
||||
#end
|
||||
import openfl.display.BlendMode;
|
||||
import openfl.text.TextFormat;
|
||||
import openfl.display.Application;
|
||||
import flixel.util.FlxColor;
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxGame;
|
||||
@ -23,7 +26,7 @@ class Main extends Sprite
|
||||
var skipSplash:Bool = true; // Whether to skip the flixel splash screen that appears in release mode.
|
||||
var startFullscreen:Bool = false; // Whether to start the game in fullscreen on desktop targets
|
||||
|
||||
public static var watermarks = true; // Whether to put Kade Engine liteartly anywhere
|
||||
public static var watermarks = true; // Whether to put Kade Engine literally anywhere
|
||||
|
||||
// You can pretty much ignore everything from here on - your code should go in your states.
|
||||
|
||||
@ -82,12 +85,19 @@ class Main extends Sprite
|
||||
game = new FlxGame(gameWidth, gameHeight, initialState, zoom, framerate, framerate, skipSplash, startFullscreen);
|
||||
#end
|
||||
addChild(game);
|
||||
#if windows
|
||||
DiscordClient.initialize();
|
||||
|
||||
Application.current.onExit.add (function (exitCode) {
|
||||
DiscordClient.shutdown();
|
||||
});
|
||||
|
||||
#end
|
||||
|
||||
#if !mobile
|
||||
fpsCounter = new FPS(10, 3, 0xFFFFFF);
|
||||
addChild(fpsCounter);
|
||||
toggleFPS(FlxG.save.data.fps);
|
||||
|
||||
#end
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ class MainMenuState extends MusicBeatState
|
||||
|
||||
public static var nightly:String = "";
|
||||
|
||||
public static var kadeEngineVer:String = "1.5.4" + nightly;
|
||||
public static var kadeEngineVer:String = "1.6" + nightly;
|
||||
public static var gameVer:String = "0.2.7.1";
|
||||
|
||||
var magenta:FlxSprite;
|
||||
@ -67,7 +67,10 @@ class MainMenuState extends MusicBeatState
|
||||
bg.setGraphicSize(Std.int(bg.width * 1.1));
|
||||
bg.updateHitbox();
|
||||
bg.screenCenter();
|
||||
if(FlxG.save.data.antialiasing)
|
||||
{
|
||||
bg.antialiasing = true;
|
||||
}
|
||||
add(bg);
|
||||
|
||||
camFollow = new FlxObject(0, 0, 1, 1);
|
||||
@ -80,7 +83,10 @@ class MainMenuState extends MusicBeatState
|
||||
magenta.updateHitbox();
|
||||
magenta.screenCenter();
|
||||
magenta.visible = false;
|
||||
if(FlxG.save.data.antialiasing)
|
||||
{
|
||||
magenta.antialiasing = true;
|
||||
}
|
||||
magenta.color = 0xFFfd719b;
|
||||
add(magenta);
|
||||
// magenta.scrollFactor.set();
|
||||
@ -101,7 +107,10 @@ class MainMenuState extends MusicBeatState
|
||||
menuItem.screenCenter(X);
|
||||
menuItems.add(menuItem);
|
||||
menuItem.scrollFactor.set();
|
||||
if(FlxG.save.data.antialiasing)
|
||||
{
|
||||
menuItem.antialiasing = true;
|
||||
}
|
||||
if (firstStart)
|
||||
FlxTween.tween(menuItem,{y: 60 + (i * 160)},1 + (i * 0.25) ,{ease: FlxEase.expoInOut, onComplete: function(flxTween:FlxTween)
|
||||
{
|
||||
|
@ -1,6 +1,7 @@
|
||||
package;
|
||||
|
||||
import flixel.FlxSprite;
|
||||
import flixel.FlxG;
|
||||
import flixel.graphics.frames.FlxAtlasFrames;
|
||||
|
||||
class CharacterSetting
|
||||
@ -33,25 +34,34 @@ class MenuCharacter extends FlxSprite
|
||||
];
|
||||
|
||||
private var flipped:Bool = false;
|
||||
//questionable variable name lmfao
|
||||
private var goesLeftNRight:Bool = false;
|
||||
private var danceLeft:Bool = false;
|
||||
private var character:String = '';
|
||||
|
||||
public function new(x:Int, y:Int, scale:Float, flipped:Bool)
|
||||
{
|
||||
super(x, y);
|
||||
this.flipped = flipped;
|
||||
|
||||
if(FlxG.save.data.antialiasing)
|
||||
{
|
||||
antialiasing = true;
|
||||
}
|
||||
|
||||
frames = Paths.getSparrowAtlas('campaign_menu_UI_characters');
|
||||
|
||||
animation.addByPrefix('bf', "BF idle dance white", 24);
|
||||
animation.addByPrefix('bf', "BF idle dance white", 24, false);
|
||||
animation.addByPrefix('bfConfirm', 'BF HEY!!', 24, false);
|
||||
animation.addByPrefix('gf', "GF Dancing Beat WHITE", 24);
|
||||
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);
|
||||
animation.addByIndices('gf-left', 'GF Dancing Beat WHITE', [30, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], "", 24, false);
|
||||
animation.addByIndices('gf-right', 'GF Dancing Beat WHITE', [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], "", 24, false);
|
||||
animation.addByPrefix('dad', "Dad idle dance BLACK LINE", 24, false);
|
||||
animation.addByIndices('spooky-left', 'spooky dance idle BLACK LINES', [0, 2, 6], "", 12, false);
|
||||
animation.addByIndices('spooky-right', 'spooky dance idle BLACK LINES', [8, 10, 12, 14], "", 12, false);
|
||||
animation.addByPrefix('pico', "Pico Idle Dance", 24, false);
|
||||
animation.addByPrefix('mom', "Mom Idle BLACK LINES", 24, false);
|
||||
animation.addByPrefix('parents-christmas', "Parent Christmas Idle", 24, false);
|
||||
animation.addByPrefix('senpai', "SENPAI idle Black Lines", 24, false);
|
||||
|
||||
setGraphicSize(Std.int(width * scale));
|
||||
updateHitbox();
|
||||
@ -59,6 +69,8 @@ class MenuCharacter extends FlxSprite
|
||||
|
||||
public function setCharacter(character:String):Void
|
||||
{
|
||||
var sameCharacter:Bool = character == this.character;
|
||||
this.character = character;
|
||||
if (character == '')
|
||||
{
|
||||
visible = false;
|
||||
@ -69,11 +81,33 @@ class MenuCharacter extends FlxSprite
|
||||
visible = true;
|
||||
}
|
||||
|
||||
animation.play(character);
|
||||
if (!sameCharacter) {
|
||||
bopHead(true);
|
||||
}
|
||||
|
||||
var setting:CharacterSetting = settings[character];
|
||||
offset.set(setting.x, setting.y);
|
||||
setGraphicSize(Std.int(width * setting.scale));
|
||||
flipX = setting.flipped != flipped;
|
||||
}
|
||||
|
||||
public function bopHead(LastFrame:Bool = false):Void
|
||||
{
|
||||
if (character == 'gf' || character == 'spooky') {
|
||||
danceLeft = !danceLeft;
|
||||
|
||||
if (danceLeft)
|
||||
animation.play(character + "-left", true);
|
||||
else
|
||||
animation.play(character + "-right", true);
|
||||
} else {
|
||||
//no spooky nor girlfriend so we do da normal animation
|
||||
if (animation.name == "bfConfirm")
|
||||
return;
|
||||
animation.play(character, true);
|
||||
}
|
||||
if (LastFrame) {
|
||||
animation.finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -250,7 +250,7 @@ class ModchartState
|
||||
PlayState.instance.removeObject(PlayState.boyfriend);
|
||||
PlayState.boyfriend = new Boyfriend(oldboyfriendx, oldboyfriendy, id);
|
||||
PlayState.instance.addObject(PlayState.boyfriend);
|
||||
PlayState.instance.iconP2.animation.play(id);
|
||||
PlayState.instance.iconP1.animation.play(id);
|
||||
}
|
||||
|
||||
function makeAnimatedLuaSprite(spritePath:String,names:Array<String>,prefixes:Array<String>,startAnim:String, id:String)
|
||||
|
@ -3,15 +3,11 @@ package;
|
||||
#if windows
|
||||
import Discord.DiscordClient;
|
||||
#end
|
||||
import flixel.tweens.FlxTween;
|
||||
import flixel.util.FlxColor;
|
||||
import openfl.Lib;
|
||||
import Conductor.BPMChangeEvent;
|
||||
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
|
||||
{
|
||||
@ -20,6 +16,7 @@ class MusicBeatState extends FlxUIState
|
||||
|
||||
private var curStep:Int = 0;
|
||||
private var curBeat:Int = 0;
|
||||
private var curDecimalBeat:Float = 0;
|
||||
private var controls(get, never):Controls;
|
||||
|
||||
inline function get_controls():Controls
|
||||
@ -27,6 +24,7 @@ class MusicBeatState extends FlxUIState
|
||||
|
||||
override function create()
|
||||
{
|
||||
TimingStruct.clearTimings();
|
||||
(cast (Lib.current.getChildAt(0), Main)).setFPSCap(FlxG.save.data.fpsCap);
|
||||
|
||||
if (transIn != null)
|
||||
@ -51,13 +49,50 @@ class MusicBeatState extends FlxUIState
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
//everyStep();
|
||||
var oldStep:Int = curStep;
|
||||
var nextStep:Int = updateCurStep();
|
||||
|
||||
updateCurStep();
|
||||
if (nextStep >= 0)
|
||||
{
|
||||
if (nextStep > curStep)
|
||||
{
|
||||
for (i in curStep...nextStep)
|
||||
{
|
||||
curStep++;
|
||||
updateBeat();
|
||||
|
||||
if (oldStep != curStep && curStep > 0)
|
||||
stepHit();
|
||||
}
|
||||
}
|
||||
else if (nextStep < curStep)
|
||||
{
|
||||
//Song reset?
|
||||
curStep = nextStep;
|
||||
updateBeat();
|
||||
stepHit();
|
||||
}
|
||||
}
|
||||
|
||||
if (Conductor.songPosition < 0)
|
||||
curDecimalBeat = 0;
|
||||
else
|
||||
{
|
||||
if (TimingStruct.AllTimings.length > 1)
|
||||
{
|
||||
var data = TimingStruct.getTimingAtTimestamp(Conductor.songPosition);
|
||||
|
||||
FlxG.watch.addQuick("Current Conductor Timing Seg", data.bpm);
|
||||
|
||||
Conductor.crochet = ((60 / data.bpm) * 1000);
|
||||
|
||||
var percent = (Conductor.songPosition - (data.startTime * 1000)) / (data.length * 1000);
|
||||
|
||||
curDecimalBeat = data.startBeat + (((Conductor.songPosition/1000) - data.startTime) * (data.bpm / 60));
|
||||
}
|
||||
else
|
||||
{
|
||||
curDecimalBeat = (Conductor.songPosition / 1000) * (Conductor.bpm/60);
|
||||
Conductor.crochet = ((60 / Conductor.bpm) * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
if (FlxG.save.data.fpsRain && skippedFrames >= 6)
|
||||
{
|
||||
@ -78,13 +113,13 @@ class MusicBeatState extends FlxUIState
|
||||
|
||||
private function updateBeat():Void
|
||||
{
|
||||
lastBeat = curStep;
|
||||
lastBeat = curBeat;
|
||||
curBeat = Math.floor(curStep / 4);
|
||||
}
|
||||
|
||||
public static var currentColor = 0;
|
||||
|
||||
private function updateCurStep():Void
|
||||
private function updateCurStep():Int
|
||||
{
|
||||
var lastChange:BPMChangeEvent = {
|
||||
stepTime: 0,
|
||||
@ -97,12 +132,11 @@ class MusicBeatState extends FlxUIState
|
||||
lastChange = Conductor.bpmChangeMap[i];
|
||||
}
|
||||
|
||||
curStep = lastChange.stepTime + Math.floor((Conductor.songPosition - lastChange.songTime) / Conductor.stepCrochet);
|
||||
return lastChange.stepTime + Math.floor((Conductor.songPosition - lastChange.songTime) / Conductor.stepCrochet);
|
||||
}
|
||||
|
||||
public function stepHit():Void
|
||||
{
|
||||
|
||||
if (curStep % 4 == 0)
|
||||
beatHit();
|
||||
}
|
||||
|
@ -24,19 +24,38 @@ class MusicBeatSubstate extends FlxSubState
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
//everyStep();
|
||||
var oldStep:Int = curStep;
|
||||
var nextStep = updateCurStep();
|
||||
|
||||
updateCurStep();
|
||||
curBeat = Math.floor(curStep / 4);
|
||||
|
||||
if (oldStep != curStep && curStep > 0)
|
||||
if (nextStep >= 0)
|
||||
{
|
||||
if (nextStep > curStep)
|
||||
{
|
||||
for (i in curStep...nextStep)
|
||||
{
|
||||
curStep++;
|
||||
updateBeat();
|
||||
stepHit();
|
||||
|
||||
}
|
||||
}
|
||||
else if (nextStep < curStep)
|
||||
{
|
||||
//Song reset?
|
||||
curStep = nextStep;
|
||||
updateBeat();
|
||||
stepHit();
|
||||
}
|
||||
}
|
||||
|
||||
super.update(elapsed);
|
||||
}
|
||||
|
||||
private function updateCurStep():Void
|
||||
private function updateBeat():Void
|
||||
{
|
||||
lastBeat = curBeat;
|
||||
curBeat = Math.floor(curStep / 4);
|
||||
}
|
||||
|
||||
private function updateCurStep():Int
|
||||
{
|
||||
var lastChange:BPMChangeEvent = {
|
||||
stepTime: 0,
|
||||
@ -49,7 +68,7 @@ class MusicBeatSubstate extends FlxSubState
|
||||
lastChange = Conductor.bpmChangeMap[i];
|
||||
}
|
||||
|
||||
curStep = lastChange.stepTime + Math.floor((Conductor.songPosition - lastChange.songTime) / Conductor.stepCrochet);
|
||||
return lastChange.stepTime + Math.floor((Conductor.songPosition - lastChange.songTime) / Conductor.stepCrochet);
|
||||
}
|
||||
|
||||
public function stepHit():Void
|
||||
|
197
source/Note.hx
@ -16,9 +16,13 @@ using StringTools;
|
||||
class Note extends FlxSprite
|
||||
{
|
||||
public var strumTime:Float = 0;
|
||||
public var baseStrum:Float = 0;
|
||||
|
||||
public var rStrumTime:Float = 0;
|
||||
|
||||
public var mustPress:Bool = false;
|
||||
public var noteData:Int = 0;
|
||||
public var rawNoteData:Int = 0;
|
||||
public var canBeHit:Bool = false;
|
||||
public var tooLate:Bool = false;
|
||||
public var wasGoodHit:Bool = false;
|
||||
@ -26,9 +30,15 @@ class Note extends FlxSprite
|
||||
public var modifiedByLua:Bool = false;
|
||||
public var sustainLength:Float = 0;
|
||||
public var isSustainNote:Bool = false;
|
||||
public var originColor:Int = 0; // The sustain note's original note's color
|
||||
public var noteSection:Int = 0;
|
||||
|
||||
public var noteCharterObject:FlxSprite;
|
||||
|
||||
public var noteScore:Float = 1;
|
||||
|
||||
public var noteYOff:Int = 0;
|
||||
|
||||
public static var swagWidth:Float = 160 * 0.7;
|
||||
public static var PURP_NOTE:Int = 0;
|
||||
public static var GREEN_NOTE:Int = 2;
|
||||
@ -37,6 +47,20 @@ class Note extends FlxSprite
|
||||
|
||||
public var rating:String = "shit";
|
||||
|
||||
public var modAngle:Float = 0; // The angle set by modcharts
|
||||
public var localAngle:Float = 0; // The angle to be edited inside Note.hx
|
||||
|
||||
public var dataColor:Array<String> = ['purple', 'blue', 'green', 'red'];
|
||||
public var quantityColor:Array<Int> = [RED_NOTE, 2, BLUE_NOTE, 2, PURP_NOTE, 2, BLUE_NOTE, 2];
|
||||
public var arrowAngles:Array<Int> = [180, 90, 270, 0];
|
||||
|
||||
public var isParent:Bool = false;
|
||||
public var parent:Note = null;
|
||||
public var spotInLine:Int = 0;
|
||||
public var sustainActive:Bool = true;
|
||||
|
||||
public var children:Array<Note> = [];
|
||||
|
||||
public function new(strumTime:Float, noteData:Int, ?prevNote:Note, ?sustainNote:Bool = false, ?inCharter:Bool = false)
|
||||
{
|
||||
super();
|
||||
@ -50,10 +74,24 @@ class Note extends FlxSprite
|
||||
x += 50;
|
||||
// MAKE SURE ITS DEFINITELY OFF SCREEN?
|
||||
y -= 2000;
|
||||
|
||||
if (inCharter)
|
||||
{
|
||||
this.strumTime = strumTime;
|
||||
rStrumTime = strumTime;
|
||||
}
|
||||
else
|
||||
this.strumTime = Math.round(strumTime);
|
||||
{
|
||||
this.strumTime = strumTime;
|
||||
rStrumTime = strumTime - (FlxG.save.data.offset + PlayState.songOffset);
|
||||
#if sys
|
||||
if (PlayState.isSM)
|
||||
{
|
||||
rStrumTime = Math.round(rStrumTime + Std.parseFloat(PlayState.sm.header.OFFSET));
|
||||
}
|
||||
#end
|
||||
}
|
||||
|
||||
|
||||
if (this.strumTime < 0 )
|
||||
this.strumTime = 0;
|
||||
@ -65,6 +103,26 @@ class Note extends FlxSprite
|
||||
//defaults if no noteStyle was found in chart
|
||||
var noteTypeCheck:String = 'normal';
|
||||
|
||||
if (inCharter)
|
||||
{
|
||||
frames = Paths.getSparrowAtlas('NOTE_assets');
|
||||
|
||||
for (i in 0...4)
|
||||
{
|
||||
animation.addByPrefix(dataColor[i] + 'Scroll', dataColor[i] + ' alone'); // Normal notes
|
||||
animation.addByPrefix(dataColor[i] + 'hold', dataColor[i] + ' hold'); // Hold
|
||||
animation.addByPrefix(dataColor[i] + 'holdend', dataColor[i] + ' tail'); // Tails
|
||||
}
|
||||
|
||||
setGraphicSize(Std.int(width * 0.7));
|
||||
updateHitbox();
|
||||
if(FlxG.save.data.antialiasing)
|
||||
{
|
||||
antialiasing = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (PlayState.SONG.noteStyle == null) {
|
||||
switch(PlayState.storyWeek) {case 6: noteTypeCheck = 'pixel';}
|
||||
} else {noteTypeCheck = PlayState.SONG.noteStyle;}
|
||||
@ -73,25 +131,14 @@ class Note extends FlxSprite
|
||||
{
|
||||
case 'pixel':
|
||||
loadGraphic(Paths.image('weeb/pixelUI/arrows-pixels', 'week6'), true, 17, 17);
|
||||
|
||||
animation.add('greenScroll', [6]);
|
||||
animation.add('redScroll', [7]);
|
||||
animation.add('blueScroll', [5]);
|
||||
animation.add('purpleScroll', [4]);
|
||||
|
||||
if (isSustainNote)
|
||||
{
|
||||
loadGraphic(Paths.image('weeb/pixelUI/arrowEnds', 'week6'), 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]);
|
||||
for (i in 0...4)
|
||||
{
|
||||
animation.add(dataColor[i] + 'Scroll', [i + 4]); // Normal notes
|
||||
animation.add(dataColor[i] + 'hold', [i]); // Holds
|
||||
animation.add(dataColor[i] + 'holdend', [i + 4]); // Tails
|
||||
}
|
||||
|
||||
setGraphicSize(Std.int(width * PlayState.daPixelZoom));
|
||||
@ -99,50 +146,55 @@ class Note extends FlxSprite
|
||||
default:
|
||||
frames = Paths.getSparrowAtlas('NOTE_assets');
|
||||
|
||||
animation.addByPrefix('greenScroll', 'green instance 1');
|
||||
animation.addByPrefix('redScroll', 'red instance 1');
|
||||
animation.addByPrefix('blueScroll', 'blue instance 1');
|
||||
animation.addByPrefix('purpleScroll', 'purple instance 1');
|
||||
|
||||
animation.addByPrefix('purpleholdend', 'pruple end hold instance 1');
|
||||
animation.addByPrefix('greenholdend', 'green hold end instance 1');
|
||||
animation.addByPrefix('redholdend', 'red hold end instance 1');
|
||||
animation.addByPrefix('blueholdend', 'blue hold end instance 1');
|
||||
|
||||
animation.addByPrefix('purplehold', 'purple hold piece instance 1');
|
||||
animation.addByPrefix('greenhold', 'green hold piece instance 1');
|
||||
animation.addByPrefix('redhold', 'red hold piece instance 1');
|
||||
animation.addByPrefix('bluehold', 'blue hold piece instance 1');
|
||||
for (i in 0...4)
|
||||
{
|
||||
animation.addByPrefix(dataColor[i] + 'Scroll', dataColor[i] + ' alone'); // Normal notes
|
||||
animation.addByPrefix(dataColor[i] + 'hold', dataColor[i] + ' hold'); // Hold
|
||||
animation.addByPrefix(dataColor[i] + 'holdend', dataColor[i] + ' tail'); // Tails
|
||||
}
|
||||
|
||||
setGraphicSize(Std.int(width * 0.7));
|
||||
updateHitbox();
|
||||
|
||||
if(FlxG.save.data.antialiasing)
|
||||
{
|
||||
antialiasing = true;
|
||||
}
|
||||
|
||||
switch (noteData)
|
||||
{
|
||||
case 0:
|
||||
x += swagWidth * 0;
|
||||
animation.play('purpleScroll');
|
||||
case 1:
|
||||
x += swagWidth * 1;
|
||||
animation.play('blueScroll');
|
||||
case 2:
|
||||
x += swagWidth * 2;
|
||||
animation.play('greenScroll');
|
||||
case 3:
|
||||
x += swagWidth * 3;
|
||||
animation.play('redScroll');
|
||||
}
|
||||
}
|
||||
|
||||
// trace(prevNote);
|
||||
x += swagWidth * noteData;
|
||||
animation.play(dataColor[noteData] + 'Scroll');
|
||||
originColor = noteData; // The note's origin color will be checked by its sustain notes
|
||||
|
||||
if (FlxG.save.data.stepMania && !isSustainNote)
|
||||
{
|
||||
var strumCheck:Float = rStrumTime;
|
||||
|
||||
// I give up on fluctuating bpms. something has to be subtracted from strumCheck to make them look right but idk what.
|
||||
// I'd use the note's section's start time but neither the note's section nor its start time are accessible by themselves
|
||||
//strumCheck -= ???
|
||||
|
||||
var ind:Int = Std.int(Math.round(strumCheck / (Conductor.stepCrochet / 2)));
|
||||
|
||||
var col:Int = 0;
|
||||
col = quantityColor[ind % 8]; // Set the color depending on the beats
|
||||
|
||||
animation.play(dataColor[col] + 'Scroll');
|
||||
localAngle -= arrowAngles[col];
|
||||
localAngle += arrowAngles[noteData];
|
||||
originColor = col;
|
||||
}
|
||||
|
||||
// we make sure its downscroll and its a SUSTAIN NOTE (aka a trail, not a note)
|
||||
// and flip it so it doesn't look weird.
|
||||
// THIS DOESN'T FUCKING FLIP THE NOTE, CONTRIBUTERS DON'T JUST COMMENT THIS OUT JESUS
|
||||
// then what is this lol
|
||||
if (FlxG.save.data.downscroll && sustainNote)
|
||||
flipY = true;
|
||||
|
||||
var stepHeight = (0.45 * Conductor.stepCrochet * FlxMath.roundDecimal(PlayStateChangeables.scrollSpeed == 1 ? PlayState.SONG.speed : PlayStateChangeables.scrollSpeed, 2));
|
||||
|
||||
if (isSustainNote && prevNote != null)
|
||||
{
|
||||
noteScore * 0.2;
|
||||
@ -150,46 +202,30 @@ class Note extends FlxSprite
|
||||
|
||||
x += width / 2;
|
||||
|
||||
switch (noteData)
|
||||
{
|
||||
case 2:
|
||||
animation.play('greenholdend');
|
||||
case 3:
|
||||
animation.play('redholdend');
|
||||
case 1:
|
||||
animation.play('blueholdend');
|
||||
case 0:
|
||||
animation.play('purpleholdend');
|
||||
}
|
||||
originColor = prevNote.originColor;
|
||||
|
||||
animation.play(dataColor[originColor] + 'holdend'); // This works both for normal colors and quantization colors
|
||||
updateHitbox();
|
||||
|
||||
x -= width / 2;
|
||||
|
||||
if (PlayState.curStage.startsWith('school'))
|
||||
//if (noteTypeCheck == 'pixel')
|
||||
// x += 30;
|
||||
if (inCharter)
|
||||
x += 30;
|
||||
|
||||
if (prevNote.isSustainNote)
|
||||
{
|
||||
switch (prevNote.noteData)
|
||||
{
|
||||
case 0:
|
||||
prevNote.animation.play('purplehold');
|
||||
case 1:
|
||||
prevNote.animation.play('bluehold');
|
||||
case 2:
|
||||
prevNote.animation.play('greenhold');
|
||||
case 3:
|
||||
prevNote.animation.play('redhold');
|
||||
}
|
||||
|
||||
|
||||
if(FlxG.save.data.scrollSpeed != 1)
|
||||
prevNote.scale.y *= Conductor.stepCrochet / 100 * 1.5 * FlxG.save.data.scrollSpeed;
|
||||
else
|
||||
prevNote.scale.y *= Conductor.stepCrochet / 100 * 1.5 * PlayState.SONG.speed;
|
||||
prevNote.animation.play(dataColor[prevNote.originColor] + 'hold');
|
||||
prevNote.updateHitbox();
|
||||
|
||||
prevNote.scale.y *= (stepHeight + 1) / prevNote.height; // + 1 so that there's no odd gaps as the notes scroll
|
||||
prevNote.updateHitbox();
|
||||
prevNote.noteYOff = Math.round(-prevNote.offset.y);
|
||||
|
||||
// prevNote.setGraphicSize();
|
||||
|
||||
noteYOff = Math.round(-offset.y);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -197,6 +233,15 @@ class Note extends FlxSprite
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
super.update(elapsed);
|
||||
angle = modAngle + localAngle;
|
||||
|
||||
if (!modifiedByLua)
|
||||
{
|
||||
if (!sustainActive)
|
||||
{
|
||||
alpha = 0.3;
|
||||
}
|
||||
}
|
||||
|
||||
if (mustPress)
|
||||
{
|
||||
|
30
source/OFLWaveform.hx
Normal file
@ -0,0 +1,30 @@
|
||||
import lime.media.AudioSource;
|
||||
import lime.media.AudioBuffer;
|
||||
import openfl.media.Sound;
|
||||
import openfl.display.Graphics;
|
||||
import openfl.display.Sprite;
|
||||
|
||||
class OFLWaveform extends Sprite
|
||||
{
|
||||
public var musicLength = 0;
|
||||
public var _x = 0;
|
||||
public var _y = 0;
|
||||
|
||||
public var _sound:String;
|
||||
|
||||
function new(x,y,musicLength, data:String)
|
||||
{
|
||||
super();
|
||||
|
||||
_x = x;
|
||||
_y = y;
|
||||
_sound = data;
|
||||
this.musicLength = musicLength;
|
||||
}
|
||||
|
||||
public function drawWaveform()
|
||||
{
|
||||
var gfx:Graphics = graphics;
|
||||
gfx.clear();
|
||||
}
|
||||
}
|
@ -119,6 +119,29 @@ class CpuStrums extends Option
|
||||
|
||||
}
|
||||
|
||||
class GraphicLoading extends Option
|
||||
{
|
||||
public function new(desc:String)
|
||||
{
|
||||
super();
|
||||
description = desc;
|
||||
}
|
||||
|
||||
public override function press():Bool
|
||||
{
|
||||
FlxG.save.data.cacheImages = !FlxG.save.data.cacheImages;
|
||||
|
||||
display = updateDisplay();
|
||||
return true;
|
||||
}
|
||||
|
||||
private override function updateDisplay():String
|
||||
{
|
||||
return FlxG.save.data.cacheImages ? "Preload Characters" : "Do not Preload Characters";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class DownscrollOption extends Option
|
||||
{
|
||||
public function new(desc:String)
|
||||
@ -221,6 +244,26 @@ class DistractionsAndEffectsOption extends Option
|
||||
}
|
||||
}
|
||||
|
||||
class StepManiaOption extends Option
|
||||
{
|
||||
public function new(desc:String)
|
||||
{
|
||||
super();
|
||||
description = desc;
|
||||
}
|
||||
public override function press():Bool
|
||||
{
|
||||
FlxG.save.data.stepMania = !FlxG.save.data.stepMania;
|
||||
display = updateDisplay();
|
||||
return true;
|
||||
}
|
||||
|
||||
private override function updateDisplay():String
|
||||
{
|
||||
return "Colors by quantization " + (!FlxG.save.data.stepMania ? "off" : "on");
|
||||
}
|
||||
}
|
||||
|
||||
class ResetButtonOption extends Option
|
||||
{
|
||||
public function new(desc:String)
|
||||
@ -261,6 +304,46 @@ class FlashingLightsOption extends Option
|
||||
}
|
||||
}
|
||||
|
||||
class AntialiasingOption extends Option
|
||||
{
|
||||
public function new(desc:String)
|
||||
{
|
||||
super();
|
||||
description = desc;
|
||||
}
|
||||
public override function press():Bool
|
||||
{
|
||||
FlxG.save.data.antialiasing = !FlxG.save.data.antialiasing;
|
||||
display = updateDisplay();
|
||||
return true;
|
||||
}
|
||||
|
||||
private override function updateDisplay():String
|
||||
{
|
||||
return "Antialiasing " + (!FlxG.save.data.antialiasing ? "off" : "on");
|
||||
}
|
||||
}
|
||||
|
||||
class MissSoundsOption extends Option
|
||||
{
|
||||
public function new(desc:String)
|
||||
{
|
||||
super();
|
||||
description = desc;
|
||||
}
|
||||
public override function press():Bool
|
||||
{
|
||||
FlxG.save.data.missSounds = !FlxG.save.data.missSounds;
|
||||
display = updateDisplay();
|
||||
return true;
|
||||
}
|
||||
|
||||
private override function updateDisplay():String
|
||||
{
|
||||
return "Miss Sounds " + (!FlxG.save.data.missSounds ? "off" : "on");
|
||||
}
|
||||
}
|
||||
|
||||
class ShowInput extends Option
|
||||
{
|
||||
public function new(desc:String)
|
||||
@ -698,3 +781,128 @@ class CamZoomOption extends Option
|
||||
return "Camera Zoom " + (!FlxG.save.data.camzoom ? "off" : "on");
|
||||
}
|
||||
}
|
||||
|
||||
class LockWeeksOption extends Option
|
||||
{
|
||||
var confirm:Bool = false;
|
||||
|
||||
public function new(desc:String)
|
||||
{
|
||||
super();
|
||||
description = desc;
|
||||
}
|
||||
public override function press():Bool
|
||||
{
|
||||
if(!confirm)
|
||||
{
|
||||
confirm = true;
|
||||
display = updateDisplay();
|
||||
return true;
|
||||
}
|
||||
FlxG.save.data.weekUnlocked = 1;
|
||||
StoryMenuState.weekUnlocked = [true, true];
|
||||
trace('Weeks Locked');
|
||||
display = updateDisplay();
|
||||
return true;
|
||||
}
|
||||
|
||||
private override function updateDisplay():String
|
||||
{
|
||||
return confirm ? "Confirm Story Reset" : "Reset Story Progress";
|
||||
}
|
||||
}
|
||||
|
||||
class ResetScoreOption extends Option
|
||||
{
|
||||
var confirm:Bool = false;
|
||||
|
||||
public function new(desc:String)
|
||||
{
|
||||
super();
|
||||
description = desc;
|
||||
}
|
||||
public override function press():Bool
|
||||
{
|
||||
if(!confirm)
|
||||
{
|
||||
confirm = true;
|
||||
display = updateDisplay();
|
||||
return true;
|
||||
}
|
||||
FlxG.save.data.songScores = null;
|
||||
for(key in Highscore.songScores.keys())
|
||||
{
|
||||
Highscore.songScores[key] = 0;
|
||||
}
|
||||
FlxG.save.data.songCombos = null;
|
||||
for(key in Highscore.songCombos.keys())
|
||||
{
|
||||
Highscore.songCombos[key] = '';
|
||||
}
|
||||
confirm = false;
|
||||
trace('Highscores Wiped');
|
||||
display = updateDisplay();
|
||||
return true;
|
||||
}
|
||||
|
||||
private override function updateDisplay():String
|
||||
{
|
||||
return confirm ? "Confirm Score Reset" : "Reset Score";
|
||||
}
|
||||
}
|
||||
|
||||
class ResetSettings extends Option
|
||||
{
|
||||
var confirm:Bool = false;
|
||||
|
||||
public function new(desc:String)
|
||||
{
|
||||
super();
|
||||
description = desc;
|
||||
}
|
||||
public override function press():Bool
|
||||
{
|
||||
if(!confirm)
|
||||
{
|
||||
confirm = true;
|
||||
display = updateDisplay();
|
||||
return true;
|
||||
}
|
||||
FlxG.save.data.weekUnlocked = null;
|
||||
FlxG.save.data.newInput = null;
|
||||
FlxG.save.data.downscroll = null;
|
||||
FlxG.save.data.dfjk = null;
|
||||
FlxG.save.data.accuracyDisplay = null;
|
||||
FlxG.save.data.offset = null;
|
||||
FlxG.save.data.songPosition = null;
|
||||
FlxG.save.data.fps = null;
|
||||
FlxG.save.data.changedHit = null;
|
||||
FlxG.save.data.fpsRain = null;
|
||||
FlxG.save.data.fpsCap = null;
|
||||
FlxG.save.data.scrollSpeed = null;
|
||||
FlxG.save.data.npsDisplay = null;
|
||||
FlxG.save.data.frames = null;
|
||||
FlxG.save.data.accuracyMod = null;
|
||||
FlxG.save.data.watermark = null;
|
||||
FlxG.save.data.ghost = null;
|
||||
FlxG.save.data.distractions = null;
|
||||
FlxG.save.data.flashing = null;
|
||||
FlxG.save.data.resetButton = null;
|
||||
FlxG.save.data.botplay = null;
|
||||
FlxG.save.data.cpuStrums = null;
|
||||
FlxG.save.data.strumline = null;
|
||||
FlxG.save.data.customStrumLine = null;
|
||||
FlxG.save.data.camzoom = null;
|
||||
FlxG.save.data.stepMania = null;
|
||||
KadeEngineData.initSave();
|
||||
confirm = false;
|
||||
trace('All settings have been reset');
|
||||
display = updateDisplay();
|
||||
return true;
|
||||
}
|
||||
|
||||
private override function updateDisplay():String
|
||||
{
|
||||
return confirm ? "Confirm Settings Reset" : "Reset Settings";
|
||||
}
|
||||
}
|
||||
|
@ -27,41 +27,49 @@ class OptionsMenu extends MusicBeatState
|
||||
var options:Array<OptionCategory> = [
|
||||
new OptionCategory("Gameplay", [
|
||||
new DFJKOption(controls),
|
||||
new DownscrollOption("Change the layout of the strumline."),
|
||||
new GhostTapOption("Ghost Tapping is when you tap a direction and it doesn't give you a miss."),
|
||||
new Judgement("Customize your Hit Timings (LEFT or RIGHT)"),
|
||||
new DownscrollOption("Toggle making the notes scroll down rather than up."),
|
||||
new GhostTapOption("Toggle counting pressing a directional input when no arrow is there as a miss."),
|
||||
new Judgement("Customize your Hit Timings. (LEFT or RIGHT)"),
|
||||
#if desktop
|
||||
new FPSCapOption("Cap your FPS"),
|
||||
new FPSCapOption("Change your FPS Cap."),
|
||||
#end
|
||||
new ScrollSpeedOption("Change your scroll speed (1 = Chart dependent)"),
|
||||
new ScrollSpeedOption("Change your scroll speed. (1 = Chart dependent)"),
|
||||
new AccuracyDOption("Change how accuracy is calculated. (Accurate = Simple, Complex = Milisecond Based)"),
|
||||
new ResetButtonOption("Toggle pressing R to gameover."),
|
||||
// new OffsetMenu("Get a note offset based off of your inputs!"),
|
||||
new CustomizeGameplay("Drag'n'Drop Gameplay Modules around to your preference")
|
||||
new CustomizeGameplay("Drag and drop gameplay modules to your prefered positions!")
|
||||
]),
|
||||
new OptionCategory("Appearance", [
|
||||
new DistractionsAndEffectsOption("Toggle stage distractions that can hinder your gameplay."),
|
||||
new CamZoomOption("Toggle the camera zoom in-game."),
|
||||
#if desktop
|
||||
new RainbowFPSOption("Make the FPS Counter Rainbow"),
|
||||
new AccuracyOption("Display accuracy information."),
|
||||
new NPSDisplayOption("Shows your current Notes Per Second."),
|
||||
new SongPositionOption("Show the songs current position (as a bar)"),
|
||||
new CpuStrums("CPU's strumline lights up when a note hits it."),
|
||||
#end
|
||||
new StepManiaOption("Sets the colors of the arrows depending on quantization instead of direction."),
|
||||
new AccuracyOption("Display accuracy information on the info bar."),
|
||||
new SongPositionOption("Show the song's current position as a scrolling bar."),
|
||||
new NPSDisplayOption("Shows your current Notes Per Second on the info bar."),
|
||||
new RainbowFPSOption("Make the FPS Counter flicker through rainbow colors."),
|
||||
new CpuStrums("Toggle the CPU's strumline lighting up when it hits a note."),
|
||||
]),
|
||||
|
||||
new OptionCategory("Misc", [
|
||||
#if desktop
|
||||
new FPSOption("Toggle the FPS Counter"),
|
||||
new ReplayOption("View replays"),
|
||||
#end
|
||||
new FlashingLightsOption("Toggle flashing lights that can cause epileptic seizures and strain."),
|
||||
new WatermarkOption("Enable and disable all watermarks from the engine."),
|
||||
new AntialiasingOption("Toggle antialiasing, improving graphics quality at a slight performance penalty."),
|
||||
new MissSoundsOption("Toggle miss sounds playing when you don't hit a note."),
|
||||
new ScoreScreen("Show the score screen after the end of a song"),
|
||||
new ShowInput("Display every single input in the score screen."),
|
||||
new Optimization("No backgrounds, no characters, centered notes, no player 2."),
|
||||
new BotPlay("Showcase your charts and mods with autoplay."),
|
||||
new ShowInput("Display every single input on the score screen."),
|
||||
new Optimization("No characters or backgrounds. Just a usual rhythm game layout."),
|
||||
new GraphicLoading("On startup, cache every character. Significantly decrease load times. (HIGH MEMORY)"),
|
||||
new BotPlay("Showcase your charts and mods with autoplay.")
|
||||
]),
|
||||
|
||||
new OptionCategory("Saves and Data", [
|
||||
#if desktop
|
||||
new ReplayOption("View saved song replays."),
|
||||
#end
|
||||
new ResetScoreOption("Reset your score on all songs and weeks. This is irreversible!"),
|
||||
new LockWeeksOption("Reset your story mode progress. This is irreversible!"),
|
||||
new ResetSettings("Reset ALL your settings. This is irreversible!")
|
||||
])
|
||||
|
||||
];
|
||||
@ -83,7 +91,10 @@ class OptionsMenu extends MusicBeatState
|
||||
menuBG.setGraphicSize(Std.int(menuBG.width * 1.1));
|
||||
menuBG.updateHitbox();
|
||||
menuBG.screenCenter();
|
||||
if(FlxG.save.data.antialiasing)
|
||||
{
|
||||
menuBG.antialiasing = true;
|
||||
}
|
||||
add(menuBG);
|
||||
|
||||
grpControls = new FlxTypedGroup<Alphabet>();
|
||||
|
@ -32,6 +32,10 @@ class OutdatedSubState extends MusicBeatState
|
||||
bg.scale.x *= 1.55;
|
||||
bg.scale.y *= 1.55;
|
||||
bg.screenCenter();
|
||||
if(FlxG.save.data.antialiasing)
|
||||
{
|
||||
bg.antialiasing = true;
|
||||
}
|
||||
add(bg);
|
||||
|
||||
var kadeLogo:FlxSprite = new FlxSprite(FlxG.width, 0).loadGraphic(Paths.image('KadeEngineLogo'));
|
||||
@ -40,6 +44,10 @@ class OutdatedSubState extends MusicBeatState
|
||||
kadeLogo.x -= kadeLogo.frameHeight;
|
||||
kadeLogo.y -= 180;
|
||||
kadeLogo.alpha = 0.8;
|
||||
if(FlxG.save.data.antialiasing)
|
||||
{
|
||||
kadeLogo.antialiasing = true;
|
||||
}
|
||||
add(kadeLogo);
|
||||
|
||||
var txt:FlxText = new FlxText(0, 0, FlxG.width,
|
||||
@ -52,6 +60,13 @@ class OutdatedSubState extends MusicBeatState
|
||||
+ "\n\nPress Space to view the full changelog and update\nor ESCAPE to ignore this",
|
||||
32);
|
||||
|
||||
if (MainMenuState.nightly != "")
|
||||
txt.text =
|
||||
"You are on\n"
|
||||
+ MainMenuState.kadeEngineVer
|
||||
+ "\nWhich is a PRE-RELEASE BUILD!"
|
||||
+ "\n\nReport all bugs to the author of the pre-release.\nSpace/Escape ignores this.";
|
||||
|
||||
txt.setFormat("VCR OSD Mono", 32, FlxColor.fromRGB(200, 200, 200), CENTER);
|
||||
txt.borderColor = FlxColor.BLACK;
|
||||
txt.borderSize = 3;
|
||||
@ -84,10 +99,15 @@ class OutdatedSubState extends MusicBeatState
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
if (controls.ACCEPT)
|
||||
if (controls.ACCEPT && MainMenuState.nightly == "")
|
||||
{
|
||||
fancyOpenURL("https://kadedev.github.io/Kade-Engine/changelogs/changelog-" + needVer);
|
||||
}
|
||||
else if (controls.ACCEPT)
|
||||
{
|
||||
leftState = true;
|
||||
FlxG.switchState(new MainMenuState());
|
||||
}
|
||||
if (controls.BACK)
|
||||
{
|
||||
leftState = true;
|
||||
|
@ -1,5 +1,8 @@
|
||||
package;
|
||||
|
||||
import openfl.utils.Assets;
|
||||
import flixel.graphics.FlxGraphic;
|
||||
import flixel.system.FlxAssets.FlxGraphicAsset;
|
||||
import flixel.FlxG;
|
||||
import flixel.graphics.frames.FlxAtlasFrames;
|
||||
import openfl.utils.AssetType;
|
||||
@ -50,7 +53,7 @@ class Paths
|
||||
return 'assets/$file';
|
||||
}
|
||||
|
||||
inline static public function file(file:String, type:AssetType = TEXT, ?library:String)
|
||||
inline static public function file(file:String, ?library:String, type:AssetType = TEXT)
|
||||
{
|
||||
return getPath(file, type, library);
|
||||
}
|
||||
@ -67,7 +70,7 @@ class Paths
|
||||
|
||||
inline static public function txt(key:String, ?library:String)
|
||||
{
|
||||
return getPath('data/$key.txt', TEXT, library);
|
||||
return getPath('$key.txt', TEXT, library);
|
||||
}
|
||||
|
||||
inline static public function xml(key:String, ?library:String)
|
||||
@ -125,13 +128,48 @@ class Paths
|
||||
return 'assets/fonts/$key';
|
||||
}
|
||||
|
||||
inline static public function getSparrowAtlas(key:String, ?library:String)
|
||||
inline static public function getSparrowAtlas(key:String, ?library:String, ?isCharacter:Bool = false)
|
||||
{
|
||||
var usecahce = FlxG.save.data.cacheImages;
|
||||
#if !cpp
|
||||
usecahce = false;
|
||||
#end
|
||||
if (isCharacter)
|
||||
if (usecahce)
|
||||
#if cpp
|
||||
return FlxAtlasFrames.fromSparrow(imageCached(key), file('images/characters/$key.xml', library));
|
||||
#else
|
||||
return null;
|
||||
#end
|
||||
else
|
||||
return FlxAtlasFrames.fromSparrow(image('characters/$key', library), file('images/characters/$key.xml', library));
|
||||
return FlxAtlasFrames.fromSparrow(image(key, library), file('images/$key.xml', library));
|
||||
}
|
||||
|
||||
inline static public function getPackerAtlas(key:String, ?library:String)
|
||||
#if cpp
|
||||
inline static public function imageCached(key:String):FlxGraphic
|
||||
{
|
||||
var data = Caching.bitmapData.get(key);
|
||||
trace('finding ${key} - ${data.bitmap}');
|
||||
return data;
|
||||
}
|
||||
#end
|
||||
|
||||
inline static public function getPackerAtlas(key:String, ?library:String, ?isCharacter:Bool = false)
|
||||
{
|
||||
var usecahce = FlxG.save.data.cacheImages;
|
||||
#if !cpp
|
||||
usecahce = false;
|
||||
#end
|
||||
if (isCharacter)
|
||||
if (usecahce)
|
||||
#if cpp
|
||||
return FlxAtlasFrames.fromSpriteSheetPacker(imageCached(key), file('images/$key.txt', library));
|
||||
#else
|
||||
return null;
|
||||
#end
|
||||
else
|
||||
return FlxAtlasFrames.fromSpriteSheetPacker(image('characters/$key'), file('images/characters/$key.txt', library));
|
||||
return FlxAtlasFrames.fromSpriteSheetPacker(image(key, library), file('images/$key.txt', library));
|
||||
}
|
||||
}
|
||||
|
@ -133,6 +133,11 @@ class PauseSubState extends MusicBeatSubstate
|
||||
}
|
||||
var songPath = 'assets/data/' + songLowercase + '/';
|
||||
|
||||
#if sys
|
||||
if (PlayState.isSM && !PlayState.isStoryMode)
|
||||
songPath = PlayState.pathToSm;
|
||||
#end
|
||||
|
||||
if (controls.UP_P || upPcontroller)
|
||||
{
|
||||
changeSelection(-1);
|
||||
@ -209,6 +214,7 @@ class PauseSubState extends MusicBeatSubstate
|
||||
case "Resume":
|
||||
close();
|
||||
case "Restart Song":
|
||||
PlayState.startTime = 0;
|
||||
if (PlayState.instance.useVideo)
|
||||
{
|
||||
GlobalVideo.get().stop();
|
||||
@ -217,6 +223,7 @@ class PauseSubState extends MusicBeatSubstate
|
||||
}
|
||||
FlxG.resetState();
|
||||
case "Exit to menu":
|
||||
PlayState.startTime = 0;
|
||||
if (PlayState.instance.useVideo)
|
||||
{
|
||||
GlobalVideo.get().stop();
|
||||
@ -240,7 +247,10 @@ class PauseSubState extends MusicBeatSubstate
|
||||
if (FlxG.save.data.fpsCap > 290)
|
||||
(cast (Lib.current.getChildAt(0), Main)).setFPSCap(290);
|
||||
|
||||
FlxG.switchState(new MainMenuState());
|
||||
if (PlayState.isStoryMode)
|
||||
FlxG.switchState(new StoryMenuState());
|
||||
else
|
||||
FlxG.switchState(new FreeplayState());
|
||||
}
|
||||
}
|
||||
|
||||
@ -262,6 +272,8 @@ class PauseSubState extends MusicBeatSubstate
|
||||
{
|
||||
curSelected += change;
|
||||
|
||||
FlxG.sound.play(Paths.sound('scrollMenu'), 0.4);
|
||||
|
||||
if (curSelected < 0)
|
||||
curSelected = menuItems.length - 1;
|
||||
if (curSelected >= menuItems.length)
|
||||
|
1404
source/PlayState.hx
@ -45,8 +45,10 @@ typedef ReplayJSON =
|
||||
public var songNotes:Array<Dynamic>;
|
||||
public var songJudgements:Array<String>;
|
||||
public var noteSpeed:Float;
|
||||
public var chartPath:String;
|
||||
public var isDownscroll:Bool;
|
||||
public var sf:Int;
|
||||
public var sm:Bool;
|
||||
public var ana:Analysis;
|
||||
}
|
||||
|
||||
@ -66,6 +68,8 @@ class Replay
|
||||
isDownscroll: false,
|
||||
songNotes: [],
|
||||
replayGameVer: version,
|
||||
chartPath: "",
|
||||
sm: false,
|
||||
timestamp: Date.now(),
|
||||
sf: Conductor.safeFrames,
|
||||
ana: new Analysis(),
|
||||
@ -86,20 +90,28 @@ class Replay
|
||||
|
||||
public function SaveReplay(notearray:Array<Dynamic>, judge:Array<String>, ana:Analysis)
|
||||
{
|
||||
#if sys
|
||||
var chartPath = PlayState.isSM ? PlayState.pathToSm + "/converted.json" : "";
|
||||
#else
|
||||
var chartPath = "";
|
||||
#end
|
||||
|
||||
var json = {
|
||||
"songName": PlayState.SONG.song,
|
||||
"songDiff": PlayState.storyDifficulty,
|
||||
"chartPath": chartPath,
|
||||
"sm": PlayState.isSM,
|
||||
"timestamp": Date.now(),
|
||||
"replayGameVer": version,
|
||||
"sf": Conductor.safeFrames,
|
||||
"noteSpeed": (FlxG.save.data.scrollSpeed > 1 ? FlxG.save.data.scrollSpeed : PlayState.SONG.speed),
|
||||
"isDownscroll": FlxG.save.data.downscroll,
|
||||
"songNotes": notearray,
|
||||
"songJudgements": judge,
|
||||
"timestamp": Date.now(),
|
||||
"replayGameVer": version,
|
||||
"sf": Conductor.safeFrames,
|
||||
"ana": ana
|
||||
};
|
||||
|
||||
var data:String = Json.stringify(json);
|
||||
var data:String = Json.stringify(json, null, "");
|
||||
|
||||
var time = Date.now().getTime();
|
||||
|
||||
|
@ -1,5 +1,10 @@
|
||||
package;
|
||||
|
||||
import haxe.Exception;
|
||||
#if sys
|
||||
import smTools.SMFile;
|
||||
import sys.FileSystem;
|
||||
import sys.io.File;
|
||||
#end
|
||||
import openfl.geom.Matrix;
|
||||
import openfl.display.BitmapData;
|
||||
import flixel.system.FlxSound;
|
||||
@ -54,9 +59,13 @@ class ResultsScreen extends FlxSubState
|
||||
background.scrollFactor.set();
|
||||
add(background);
|
||||
|
||||
if (!PlayState.inResults)
|
||||
{
|
||||
music = new FlxSound().loadEmbedded(Paths.music('breakfast'), true, true);
|
||||
music.volume = 0;
|
||||
music.play(false, FlxG.random.int(0, Std.int(music.length / 2)));
|
||||
FlxG.sound.list.add(music);
|
||||
}
|
||||
|
||||
background.alpha = 0;
|
||||
|
||||
@ -74,7 +83,7 @@ class ResultsScreen extends FlxSubState
|
||||
text.text = "Week Cleared!";
|
||||
}
|
||||
|
||||
comboText = new FlxText(20,-75,0,'Judgements:\nSicks - ${PlayState.sicks}\nGoods - ${PlayState.goods}\nBads - ${PlayState.bads}\n\nCombo Breaks: ${(PlayState.isStoryMode ? PlayState.campaignMisses : PlayState.misses)}\nHighest Combo: ${PlayState.highestCombo + 1}\n\nScore: ${PlayState.instance.songScore}\nAccuracy: ${HelperFunctions.truncateFloat(PlayState.instance.accuracy,2)}%\n\n${Ratings.GenerateLetterRank(PlayState.instance.accuracy)}\n\nF1 - View replay\nF2 - Replay song
|
||||
comboText = new FlxText(20,-75,0,'Judgements:\nSicks - ${PlayState.sicks}\nGoods - ${PlayState.goods}\nBads - ${PlayState.bads}\n\nCombo Breaks: ${(PlayState.isStoryMode ? PlayState.campaignMisses : PlayState.misses)}\nHighest Combo: ${PlayState.highestCombo + 1}\nScore: ${PlayState.instance.songScore}\nAccuracy: ${HelperFunctions.truncateFloat(PlayState.instance.accuracy,2)}%\n\n${Ratings.GenerateLetterRank(PlayState.instance.accuracy)}\n\n${!PlayState.loadRep ? "F1 - View replay\nF2 - Replay song" : ""}
|
||||
');
|
||||
comboText.size = 28;
|
||||
comboText.setBorderStyle(FlxTextBorderStyle.OUTLINE,FlxColor.BLACK,4,1);
|
||||
@ -130,6 +139,7 @@ class ResultsScreen extends FlxSubState
|
||||
|
||||
var diff = obj[3];
|
||||
var judge = obj2;
|
||||
if (diff != (166 * Math.floor((PlayState.rep.replay.sf / 60) * 1000) / 166))
|
||||
mean += diff;
|
||||
if (obj[1] != -1)
|
||||
graph.addToHistory(diff, judge, obj3);
|
||||
@ -167,7 +177,7 @@ class ResultsScreen extends FlxSubState
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
if (music.volume < 0.5)
|
||||
if (music != null && music.volume < 0.5)
|
||||
music.volume += 0.01 * elapsed;
|
||||
|
||||
// keybinds
|
||||
@ -193,18 +203,20 @@ class ResultsScreen extends FlxSubState
|
||||
if (PlayState.isStoryMode)
|
||||
{
|
||||
FlxG.sound.playMusic(Paths.music('freakyMenu'));
|
||||
Conductor.changeBPM(102);
|
||||
FlxG.switchState(new MainMenuState());
|
||||
}
|
||||
else
|
||||
FlxG.switchState(new FreeplayState());
|
||||
}
|
||||
|
||||
if (FlxG.keys.justPressed.F1)
|
||||
if (FlxG.keys.justPressed.F1 && !PlayState.loadRep)
|
||||
{
|
||||
trace(PlayState.rep.path);
|
||||
PlayState.rep = Replay.LoadReplay(PlayState.rep.path);
|
||||
|
||||
PlayState.loadRep = true;
|
||||
PlayState.isSM = PlayState.rep.replay.sm;
|
||||
|
||||
var songFormat = StringTools.replace(PlayState.rep.replay.songName, " ", "-");
|
||||
switch (songFormat) {
|
||||
@ -226,18 +238,49 @@ class ResultsScreen extends FlxSubState
|
||||
Highscore.saveCombo(songHighscore, Ratings.GenerateLetterRank(PlayState.instance.accuracy),PlayState.storyDifficulty);
|
||||
#end
|
||||
|
||||
var poop:String = Highscore.formatSong(songFormat, PlayState.rep.replay.songDiff);
|
||||
#if sys
|
||||
if (PlayState.rep.replay.sm)
|
||||
if (!FileSystem.exists(StringTools.replace(PlayState.rep.replay.chartPath,"converted.json","")))
|
||||
{
|
||||
Application.current.window.alert("The SM file in this replay does not exist!","SM Replays");
|
||||
return;
|
||||
}
|
||||
#end
|
||||
|
||||
var poop = "";
|
||||
|
||||
#if sys
|
||||
if (PlayState.isSM)
|
||||
{
|
||||
poop = File.getContent(PlayState.rep.replay.chartPath);
|
||||
try
|
||||
{
|
||||
PlayState.sm = SMFile.loadFile(PlayState.pathToSm + "/" + StringTools.replace(PlayState.rep.replay.songName," ", "_") + ".sm");
|
||||
}
|
||||
catch(e:Exception)
|
||||
{
|
||||
Application.current.window.alert("Make sure that the SM file is called " + PlayState.pathToSm + "/" + StringTools.replace(PlayState.rep.replay.songName," ", "_") + ".sm!\nAs I couldn't read it.","SM Replays");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
poop = Highscore.formatSong(songFormat, PlayState.rep.replay.songDiff);
|
||||
#else
|
||||
poop = Highscore.formatSong(PlayState.rep.replay.songName, PlayState.rep.replay.songDiff);
|
||||
#end
|
||||
|
||||
music.fadeOut(0.3);
|
||||
|
||||
if (PlayState.isSM)
|
||||
PlayState.SONG = Song.loadFromJsonRAW(poop);
|
||||
else
|
||||
PlayState.SONG = Song.loadFromJson(poop, PlayState.rep.replay.songName);
|
||||
PlayState.isStoryMode = false;
|
||||
PlayState.storyDifficulty = PlayState.rep.replay.songDiff;
|
||||
PlayState.storyWeek = 0;
|
||||
LoadingState.loadAndSwitchState(new PlayState());
|
||||
}
|
||||
|
||||
if (FlxG.keys.justPressed.F2 )
|
||||
if (FlxG.keys.justPressed.F2 && !PlayState.loadRep)
|
||||
{
|
||||
PlayState.rep = null;
|
||||
|
||||
@ -264,12 +307,12 @@ class ResultsScreen extends FlxSubState
|
||||
|
||||
var poop:String = Highscore.formatSong(songFormat, PlayState.storyDifficulty);
|
||||
|
||||
if (music != null)
|
||||
music.fadeOut(0.3);
|
||||
|
||||
PlayState.SONG = Song.loadFromJson(poop, PlayState.SONG.song);
|
||||
PlayState.isStoryMode = false;
|
||||
PlayState.storyDifficulty = PlayState.storyDifficulty;
|
||||
PlayState.storyWeek = 0;
|
||||
LoadingState.loadAndSwitchState(new PlayState());
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,9 @@ package;
|
||||
|
||||
typedef SwagSection =
|
||||
{
|
||||
var sectionNotes:Array<Dynamic>;
|
||||
var startTime:Float;
|
||||
var endTime:Float;
|
||||
var sectionNotes:Array<Array<Dynamic>>;
|
||||
var lengthInSteps:Int;
|
||||
var typeOfSection:Int;
|
||||
var mustHitSection:Bool;
|
||||
@ -13,7 +15,9 @@ typedef SwagSection =
|
||||
|
||||
class Section
|
||||
{
|
||||
public var sectionNotes:Array<Dynamic> = [];
|
||||
public var startTime:Float = 0;
|
||||
public var endTime:Float = 0;
|
||||
public var sectionNotes:Array<Array<Dynamic>> = [];
|
||||
|
||||
public var lengthInSteps:Int = 16;
|
||||
public var typeOfSection:Int = 0;
|
||||
|
32
source/SectionRender.hx
Normal file
@ -0,0 +1,32 @@
|
||||
import flixel.FlxG;
|
||||
import flixel.util.FlxColor;
|
||||
import flixel.group.FlxGroup.FlxTypedGroup;
|
||||
import Section.SwagSection;
|
||||
import flixel.addons.display.FlxGridOverlay;
|
||||
import flixel.FlxSprite;
|
||||
|
||||
class SectionRender extends FlxSprite
|
||||
{
|
||||
public var section:SwagSection;
|
||||
public var icon:FlxSprite;
|
||||
public var lastUpdated:Bool;
|
||||
|
||||
public function new(x:Float,y:Float,GRID_SIZE:Int, ?Height:Int = 16)
|
||||
{
|
||||
super(x,y);
|
||||
|
||||
makeGraphic(GRID_SIZE * 8, GRID_SIZE * Height,FlxColor.BLACK);
|
||||
|
||||
var h = GRID_SIZE;
|
||||
if (Math.floor(h) != h)
|
||||
h = GRID_SIZE;
|
||||
|
||||
FlxGridOverlay.overlay(this,GRID_SIZE, Std.int(h), GRID_SIZE * 8,GRID_SIZE * Height);
|
||||
}
|
||||
|
||||
|
||||
|
||||
override function update(elapsed)
|
||||
{
|
||||
}
|
||||
}
|
@ -7,10 +7,28 @@ import lime.utils.Assets;
|
||||
|
||||
using StringTools;
|
||||
|
||||
class Event
|
||||
{
|
||||
public var name:String;
|
||||
public var position:Float;
|
||||
public var value:Dynamic;
|
||||
public var type:String;
|
||||
|
||||
public function new(name:String,pos:Float,value:Dynamic,type:String)
|
||||
{
|
||||
this.name = name;
|
||||
this.position = pos;
|
||||
this.value = value;
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
|
||||
typedef SwagSong =
|
||||
{
|
||||
var chartVersion:String;
|
||||
var song:String;
|
||||
var notes:Array<SwagSection>;
|
||||
var eventObjects:Array<Event>;
|
||||
var bpm:Float;
|
||||
var needsVoices:Bool;
|
||||
var speed:Float;
|
||||
@ -25,10 +43,12 @@ typedef SwagSong =
|
||||
|
||||
class Song
|
||||
{
|
||||
public var chartVersion:String;
|
||||
public var song:String;
|
||||
public var notes:Array<SwagSection>;
|
||||
public var bpm:Float;
|
||||
public var needsVoices:Bool = true;
|
||||
public var eventObjects:Array<Event>;
|
||||
public var speed:Float = 1;
|
||||
|
||||
public var player1:String = 'bf';
|
||||
@ -44,10 +64,19 @@ class Song
|
||||
this.bpm = bpm;
|
||||
}
|
||||
|
||||
public static function loadFromJsonRAW(rawJson:String)
|
||||
{
|
||||
while (!rawJson.endsWith("}"))
|
||||
{
|
||||
rawJson = rawJson.substr(0, rawJson.length - 1);
|
||||
// LOL GOING THROUGH THE BULLSHIT TO CLEAN IDK WHATS STRANGE
|
||||
}
|
||||
|
||||
return parseJSONshit(rawJson);
|
||||
}
|
||||
|
||||
public static function loadFromJson(jsonInput:String, ?folder:String):SwagSong
|
||||
{
|
||||
trace(jsonInput);
|
||||
|
||||
// pre lowercasing the folder name
|
||||
var folderLowercase = StringTools.replace(folder, " ", "-").toLowerCase();
|
||||
switch (folderLowercase) {
|
||||
|
@ -24,7 +24,9 @@ class StoryMenuState extends MusicBeatState
|
||||
{
|
||||
var scoreText:FlxText;
|
||||
|
||||
var weekData:Array<Dynamic> = [
|
||||
static function weekData():Array<Dynamic>
|
||||
{
|
||||
return [
|
||||
['Tutorial'],
|
||||
['Bopeebo', 'Fresh', 'Dad Battle'],
|
||||
['Spookeez', 'South', "Monster"],
|
||||
@ -33,9 +35,10 @@ class StoryMenuState extends MusicBeatState
|
||||
['Cocoa', 'Eggnog', 'Winter Horrorland'],
|
||||
['Senpai', 'Roses', 'Thorns']
|
||||
];
|
||||
}
|
||||
var curDifficulty:Int = 1;
|
||||
|
||||
public static var weekUnlocked:Array<Bool> = [true, true, true, true, true, true, true];
|
||||
public static var weekUnlocked:Array<Bool> = [];
|
||||
|
||||
var weekCharacters:Array<Dynamic> = [
|
||||
['', 'bf', 'gf'],
|
||||
@ -47,15 +50,7 @@ class StoryMenuState extends MusicBeatState
|
||||
['senpai', 'bf', 'gf']
|
||||
];
|
||||
|
||||
var weekNames:Array<String> = [
|
||||
"",
|
||||
"Daddy Dearest",
|
||||
"Spooky Month",
|
||||
"PICO",
|
||||
"MOMMY MUST MURDER",
|
||||
"RED SNOW",
|
||||
"Hating Simulator ft. Moawling"
|
||||
];
|
||||
var weekNames:Array<String> = CoolUtil.coolTextFile(Paths.txt('data/weekNames'));
|
||||
|
||||
var txtWeekTitle:FlxText;
|
||||
|
||||
@ -73,8 +68,28 @@ class StoryMenuState extends MusicBeatState
|
||||
var leftArrow:FlxSprite;
|
||||
var rightArrow:FlxSprite;
|
||||
|
||||
function unlockWeeks():Array<Bool>
|
||||
{
|
||||
var weeks:Array<Bool> = [];
|
||||
#if debug
|
||||
for(i in 0...weekNames.length)
|
||||
weeks.push(true);
|
||||
return weeks;
|
||||
#end
|
||||
|
||||
weeks.push(true);
|
||||
|
||||
for(i in 0...FlxG.save.data.weekUnlocked)
|
||||
{
|
||||
weeks.push(true);
|
||||
}
|
||||
return weeks;
|
||||
}
|
||||
|
||||
override function create()
|
||||
{
|
||||
weekUnlocked = unlockWeeks();
|
||||
|
||||
#if windows
|
||||
// Updating Discord Rich Presence
|
||||
DiscordClient.changePresence("In the Story Mode Menu", null);
|
||||
@ -86,7 +101,10 @@ class StoryMenuState extends MusicBeatState
|
||||
if (FlxG.sound.music != null)
|
||||
{
|
||||
if (!FlxG.sound.music.playing)
|
||||
{
|
||||
FlxG.sound.playMusic(Paths.music('freakyMenu'));
|
||||
Conductor.changeBPM(102);
|
||||
}
|
||||
}
|
||||
|
||||
persistentUpdate = persistentDraw = true;
|
||||
@ -110,17 +128,17 @@ class StoryMenuState extends MusicBeatState
|
||||
grpWeekText = new FlxTypedGroup<MenuItem>();
|
||||
add(grpWeekText);
|
||||
|
||||
grpLocks = new FlxTypedGroup<FlxSprite>();
|
||||
add(grpLocks);
|
||||
|
||||
var blackBarThingie:FlxSprite = new FlxSprite().makeGraphic(FlxG.width, 56, FlxColor.BLACK);
|
||||
add(blackBarThingie);
|
||||
|
||||
grpWeekCharacters = new FlxTypedGroup<MenuCharacter>();
|
||||
|
||||
grpLocks = new FlxTypedGroup<FlxSprite>();
|
||||
add(grpLocks);
|
||||
|
||||
trace("Line 70");
|
||||
|
||||
for (i in 0...weekData.length)
|
||||
for (i in 0...weekData().length)
|
||||
{
|
||||
var weekThing:MenuItem = new MenuItem(0, yellowBG.y + yellowBG.height + 10, i);
|
||||
weekThing.y += ((weekThing.height + 20) * i);
|
||||
@ -128,18 +146,25 @@ class StoryMenuState extends MusicBeatState
|
||||
grpWeekText.add(weekThing);
|
||||
|
||||
weekThing.screenCenter(X);
|
||||
if(FlxG.save.data.antialiasing)
|
||||
{
|
||||
weekThing.antialiasing = true;
|
||||
}
|
||||
// weekThing.updateHitbox();
|
||||
|
||||
// Needs an offset thingie
|
||||
if (!weekUnlocked[i])
|
||||
{
|
||||
trace('locking week ' + i);
|
||||
var lock:FlxSprite = new FlxSprite(weekThing.width + 10 + weekThing.x);
|
||||
lock.frames = ui_tex;
|
||||
lock.animation.addByPrefix('lock', 'lock');
|
||||
lock.animation.play('lock');
|
||||
lock.ID = i;
|
||||
if(FlxG.save.data.antialiasing)
|
||||
{
|
||||
lock.antialiasing = true;
|
||||
}
|
||||
grpLocks.add(lock);
|
||||
}
|
||||
}
|
||||
@ -195,6 +220,19 @@ class StoryMenuState extends MusicBeatState
|
||||
|
||||
updateText();
|
||||
|
||||
|
||||
var bullShit:Int = 0;
|
||||
|
||||
for (item in grpWeekText.members)
|
||||
{
|
||||
item.targetY = bullShit - curWeek;
|
||||
if (item.targetY == Std.int(0) && weekUnlocked[curWeek])
|
||||
item.alpha = 1;
|
||||
else
|
||||
item.alpha = 0.6;
|
||||
bullShit++;
|
||||
}
|
||||
|
||||
trace("Line 165");
|
||||
|
||||
super.create();
|
||||
@ -294,6 +332,9 @@ class StoryMenuState extends MusicBeatState
|
||||
FlxG.switchState(new MainMenuState());
|
||||
}
|
||||
|
||||
if (FlxG.sound.music != null)
|
||||
Conductor.songPosition = FlxG.sound.music.time;
|
||||
|
||||
super.update(elapsed);
|
||||
}
|
||||
|
||||
@ -314,7 +355,7 @@ class StoryMenuState extends MusicBeatState
|
||||
stopspamming = true;
|
||||
}
|
||||
|
||||
PlayState.storyPlaylist = weekData[curWeek];
|
||||
PlayState.storyPlaylist = weekData()[curWeek];
|
||||
PlayState.isStoryMode = true;
|
||||
selectedWeek = true;
|
||||
|
||||
@ -388,10 +429,10 @@ class StoryMenuState extends MusicBeatState
|
||||
{
|
||||
curWeek += change;
|
||||
|
||||
if (curWeek >= weekData.length)
|
||||
if (curWeek >= weekData().length)
|
||||
curWeek = 0;
|
||||
if (curWeek < 0)
|
||||
curWeek = weekData.length - 1;
|
||||
curWeek = weekData().length - 1;
|
||||
|
||||
var bullShit:Int = 0;
|
||||
|
||||
@ -417,7 +458,7 @@ class StoryMenuState extends MusicBeatState
|
||||
grpWeekCharacters.members[2].setCharacter(weekCharacters[curWeek][2]);
|
||||
|
||||
txtTracklist.text = "Tracks\n";
|
||||
var stringThing:Array<String> = weekData[curWeek];
|
||||
var stringThing:Array<String> = weekData()[curWeek];
|
||||
|
||||
for (i in stringThing)
|
||||
txtTracklist.text += "\n" + i;
|
||||
@ -433,4 +474,25 @@ class StoryMenuState extends MusicBeatState
|
||||
intendedScore = Highscore.getWeekScore(curWeek, curDifficulty);
|
||||
#end
|
||||
}
|
||||
|
||||
public static function unlockNextWeek(week:Int):Void
|
||||
{
|
||||
if(week <= weekData().length - 1 && FlxG.save.data.weekUnlocked == week)
|
||||
{
|
||||
weekUnlocked.push(true);
|
||||
trace('Week ' + week + ' beat (Week ' + (week + 1) + ' unlocked)');
|
||||
}
|
||||
|
||||
FlxG.save.data.weekUnlocked = weekUnlocked.length - 1;
|
||||
FlxG.save.flush();
|
||||
}
|
||||
|
||||
override function beatHit()
|
||||
{
|
||||
super.beatHit();
|
||||
|
||||
grpWeekCharacters.members[0].bopHead();
|
||||
grpWeekCharacters.members[1].bopHead();
|
||||
grpWeekCharacters.members[2].bopHead();
|
||||
}
|
||||
}
|
||||
|