mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2025-03-23 05:15:14 -04:00
Merge branch 'master' into scoreoutline
This commit is contained in:
commit
1506dc001a
42 changed files with 1456 additions and 736 deletions
.github
CHANGELOG.mdProject.xmlREADME.mdsource
Alphabet.hxBackgroundDancer.hxBackgroundGirls.hxCharacter.hxChartParser.hxChartingState.hxConductor.hxControlsSubState.hxDialogueBox.hxFreeplayState.hxGameOverState.hxGameOverSubstate.hxGitarooPause.hxHealthIcon.hxLatencyState.hxLoadingState.hxMain.hxMainMenuState.hxMenuCharacter.hxMenuItem.hxMusicBeatState.hxMusicBeatSubstate.hxNGio.hxNote.hxOptions.hxOptionsMenu.hxOptionsSubState.hxPaths.hxPauseSubState.hxPlayState.hxSong.hxStoryMenuState.hxTitleState.hximport.hx
27
.github/ISSUE_TEMPLATE/bug.md
vendored
27
.github/ISSUE_TEMPLATE/bug.md
vendored
|
@ -4,29 +4,18 @@ about: Report a bug or critical performance issue
|
|||
title: 'Bug Report: '
|
||||
labels: bug
|
||||
---
|
||||
#### Please check for duplicates or similar issues, as well performing simple troubleshooting steps (such as clearing cookies, clearing AppData, trying another browser) before submitting an issue.
|
||||
### If you are playing the game in a browser, what site are you playing it from?
|
||||
[Newgrounds](https://www.newgrounds.com/portal/view/770371) or [Itch.io](https://ninja-muffin24.itch.io/funkin)? Specify below.
|
||||
|
||||
# Please check for duplicates or similar issues, as well performing simple troubleshooting steps (such as clearing cookies, clearing AppData, trying another browser) before submitting an issue.
|
||||
### If you are playing the game in a browser, what browser are you using?
|
||||
Chrome (or a Chromium based browser, i.e. Edge, Opera, etc.), Firefox, or Safari? Specify blow.
|
||||
|
||||
## Where are you playing the game?
|
||||
|
||||
### Web
|
||||
- [ ] [Newgrounds](https://www.newgrounds.com/portal/view/770371)
|
||||
- [ ] [Itch.io](https://ninja-muffin24.itch.io/funkin)
|
||||
|
||||
#### If you are using a web build, what browser are you using?
|
||||
- [ ] Chrome, or a Chromium based broswer (Edge, Opera, etc.)
|
||||
- [ ] Firefox, or a Gecko based broswer
|
||||
- [ ] Safari
|
||||
- [ ] Other, please specify:
|
||||
|
||||
### Local
|
||||
- [ ] Windows x86
|
||||
- [ ] Windows x86_64
|
||||
- [ ] Linux
|
||||
- [ ] macOS
|
||||
### If you are playing a downloaded version of the game, what operating system are you using?
|
||||
Windows (`x86`), Windows (`x86_64`), Linux, or macOS? Specify below.
|
||||
|
||||
## What version of the game are you using? Look in the bottom left corner of the main menu.
|
||||
|
||||
## Have you identified any steps to reproduce the bug? If so, please describe them below. Use images if possible.
|
||||
|
||||
## Please describe your issue. Provide extensive detail and images if possibe.
|
||||
## Please describe your issue. Provide extensive detail and images if possible.
|
||||
|
|
4
.github/ISSUE_TEMPLATE/enhancement.md
vendored
4
.github/ISSUE_TEMPLATE/enhancement.md
vendored
|
@ -4,7 +4,5 @@ about: Suggest a new feature
|
|||
title: 'Enhancement: '
|
||||
labels: enhancement
|
||||
---
|
||||
|
||||
# Please check for duplicates or similar issues before creating this issue.
|
||||
|
||||
#### Please check for duplicates or similar issues before creating this issue.
|
||||
## What is your suggestion, and why should it be implemented?
|
||||
|
|
4
.github/ISSUE_TEMPLATE/question.md
vendored
4
.github/ISSUE_TEMPLATE/question.md
vendored
|
@ -4,7 +4,5 @@ about: Ask a general question
|
|||
title: 'Question: '
|
||||
labels: question
|
||||
---
|
||||
|
||||
# Please check for duplicates or similar issues before asking your question.
|
||||
|
||||
#### Please check for duplicates or similar issues before asking your question.
|
||||
## What is your question?
|
||||
|
|
6
.github/PULL_REQUEST_TEMPLATE/bug.md
vendored
6
.github/PULL_REQUEST_TEMPLATE/bug.md
vendored
|
@ -4,9 +4,7 @@ about: Fix a bug or critical performance issue
|
|||
title: 'Bug Fix: '
|
||||
labels: bug
|
||||
---
|
||||
|
||||
# Please check for duplicates or similar PRs before creating this issue.
|
||||
|
||||
#### Please check for duplicates or similar PRs before creating this issue.
|
||||
## Does this PR close any issue(s)? If so, link them below.
|
||||
|
||||
## Breifly describe the issue(s) fixed.
|
||||
## Briefly describe the issue(s) fixed.
|
||||
|
|
4
.github/PULL_REQUEST_TEMPLATE/enhancement.md
vendored
4
.github/PULL_REQUEST_TEMPLATE/enhancement.md
vendored
|
@ -4,9 +4,7 @@ about: Add a new feature
|
|||
title: 'Enhancement: '
|
||||
labels: enhancement
|
||||
---
|
||||
|
||||
# Please check for duplicates or similar PRs before creating this issue.
|
||||
|
||||
#### Please check for duplicates or similar PRs before creating this issue.
|
||||
## Does this PR close any issue(s)? If so, link them below.
|
||||
|
||||
## What do your change(s) add, and why should they be implemented?
|
||||
|
|
24
CHANGELOG.md
24
CHANGELOG.md
|
@ -4,6 +4,30 @@ All notable changes will be documented in this file.
|
|||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
### Changed
|
||||
- ASSET LOADING OVERHAUL, WAY FASTER LOAD TIMES ON WEB!!! (THANKS TO GEOKURELI WOKE KING)
|
||||
### Fixed
|
||||
- That one random note on Bopeebo
|
||||
|
||||
## [0.2.7.1] - 2021-02-14
|
||||
### Added
|
||||
- Easter eggs
|
||||
- readme's in desktop versions of the game
|
||||
### Changed
|
||||
|
||||
- New icons, old one was placeholder since October woops!
|
||||
- Made the transitions between the story mode levels more seamless.
|
||||
- Offset of the Newgrounds logo on boot screen.
|
||||
- Made the changelog txt so it can be opened easier by normal people who don't have a markdown reader (most normal people);
|
||||
### Fixed
|
||||
- Fixed crashes on Week 6 story mode dialogue if spam too fast ([Thanks to Lotusotho for the Pull Request!](https://github.com/ninjamuffin99/Funkin/pull/357))
|
||||
- Should show intro credits on desktop versions of the game more consistently
|
||||
- Layering on Week 4 songs with GF and the LIMO LOL HOW TF I MISS THIS
|
||||
- Chart's and chart editor now support changeBPM, GOD BLESS MTH FOR THIS ONE I BEEN STRUGGLIN WIT THAT SINCE OCTOBER LMAO ([GOD BLESS MTH](https://github.com/ninjamuffin99/Funkin/pull/382))
|
||||
- Fixed sustain note trails ALSO THANKS TO MTH U A REAL ONE ([MTH VERY POWERFUL](https://github.com/ninjamuffin99/Funkin/pull/415))
|
||||
- Antialiasing on the skyscraper lights
|
||||
|
||||
## [0.2.7] - 2021-02-02
|
||||
### Added
|
||||
- PIXEL DAY UPDATE LOL 1 WEEK LATER
|
||||
|
|
81
Project.xml
81
Project.xml
|
@ -2,7 +2,7 @@
|
|||
<project>
|
||||
<!-- _________________________ Application Settings _________________________ -->
|
||||
|
||||
<app title="Friday Night Funkin'" file="Funkin" packageName="com.ninjamuffin99.funkin" main="Main" version="0.2.7" company="ninjamuffin99" />
|
||||
<app title="Friday Night Funkin'" file="Funkin" packageName="com.ninjamuffin99.funkin" package="com.ninjamuffin99.funkin" main="Main" version="0.2.7.1" company="ninjamuffin99" />
|
||||
|
||||
<!--Switch Export with Unique ApplicationID and Icon-->
|
||||
<set name="APP_ID" value="0x0100f6c013bbc000" />
|
||||
|
@ -18,7 +18,7 @@
|
|||
<!-- ____________________________ Window Settings ___________________________ -->
|
||||
|
||||
<!--These window settings apply to all targets-->
|
||||
<window width="1280" height="720" fps="60" background="#000000" hardware="true" vsync="false" />
|
||||
<window width="1280" height="720" fps="" background="#000000" hardware="true" vsync="false" />
|
||||
|
||||
<!--HTML5-specific-->
|
||||
<window if="html5" resizable="true" />
|
||||
|
@ -27,7 +27,7 @@
|
|||
<window if="desktop" orientation="landscape" fullscreen="false" resizable="true" vsync="false"/>
|
||||
|
||||
<!--Mobile-specific-->
|
||||
<window if="mobile" orientation="landscape" fullscreen="true" width="0" height="0" />
|
||||
<window if="mobile" orientation="landscape" fullscreen="true" width="0" height="0" resizable="false"/>
|
||||
|
||||
<!--Switch-specific-->
|
||||
<window if="switch" orientation="landscape" fullscreen="true" width="0" height="0" resizable="true" />
|
||||
|
@ -40,19 +40,61 @@
|
|||
|
||||
<classpath name="source" />
|
||||
|
||||
<assets path="assets/images" />
|
||||
<assets path="assets/data" />
|
||||
<assets path="assets/preload" rename="assets" exclude="*.ogg" if="web"/>
|
||||
<assets path="assets/preload" rename="assets" exclude="*.mp3" unless="web"/>
|
||||
|
||||
<!-- <define name="PRELOAD_ALL" /> -->
|
||||
<define name="PRELOAD_ALL" unless="web" />
|
||||
<define name="NO_PRELOAD_ALL" unless="PRELOAD_ALL"/>
|
||||
|
||||
<section if="PRELOAD_ALL">
|
||||
<library name="songs" preload="true" />
|
||||
<library name="shared" preload="true" />
|
||||
<library name="tutorial" preload="true" />
|
||||
<library name="week1" preload="true" />
|
||||
<library name="week2" preload="true" />
|
||||
<library name="week3" preload="true" />
|
||||
<library name="week4" preload="true" />
|
||||
<library name="week5" preload="true" />
|
||||
<library name="week6" preload="true" />
|
||||
</section>
|
||||
|
||||
<section if="NO_PRELOAD_ALL">
|
||||
<library name="songs" preload="false" />
|
||||
<library name="shared" preload="false" />
|
||||
<library name="tutorial" preload="false" />
|
||||
<library name="week1" preload="false" />
|
||||
<library name="week2" preload="false" />
|
||||
<library name="week3" preload="false" />
|
||||
<library name="week4" preload="false" />
|
||||
<library name="week5" preload="false" />
|
||||
<library name="week6" preload="false" />
|
||||
</section>
|
||||
|
||||
<assets path="assets/songs" library="songs" exclude="*.ogg" if="web"/>
|
||||
<assets path="assets/songs" library="songs" exclude="*.mp3" unless="web"/>
|
||||
<assets path="assets/shared" library="shared" exclude="*.ogg" if="web"/>
|
||||
<assets path="assets/shared" library="shared" exclude="*.mp3" unless="web"/>
|
||||
<assets path="assets/tutorial" library="tutorial" exclude="*.ogg" if="web"/>
|
||||
<assets path="assets/tutorial" library="tutorial" exclude="*.mp3" unless="web"/>
|
||||
<assets path="assets/week1" library="week1" exclude="*.ogg" if="web"/>
|
||||
<assets path="assets/week1" library="week1" exclude="*.mp3" unless="web"/>
|
||||
<assets path="assets/week2" library="week2" exclude="*.ogg" if="web"/>
|
||||
<assets path="assets/week2" library="week2" exclude="*.mp3" unless="web"/>
|
||||
<assets path="assets/week3" library="week3" exclude="*.ogg" if="web"/>
|
||||
<assets path="assets/week3" library="week3" exclude="*.mp3" unless="web"/>
|
||||
<assets path="assets/week4" library="week4" exclude="*.ogg" if="web"/>
|
||||
<assets path="assets/week4" library="week4" exclude="*.mp3" unless="web"/>
|
||||
<assets path="assets/week5" library="week5" exclude="*.ogg" if="web"/>
|
||||
<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='example_mods' rename='mods' embed='false'/>
|
||||
<assets path='art/readme.txt' rename='do NOT readme.txt' />
|
||||
<!-- <template path='mods' /> -->
|
||||
|
||||
<!-- <library name="noPreload" preload='false'/> -->
|
||||
<!-- <library name="noPreload"/> -->
|
||||
<assets path="assets/music" include="*.mp3" if="web"/>
|
||||
<assets path="assets/music" include="*.ogg" unless="web"/>
|
||||
<assets path="assets/sounds" include="*.mp3" if="web" />
|
||||
<assets path="assets/sounds" include="*.ogg" unless="web" />
|
||||
|
||||
<assets path="CHANGELOG.md"/>
|
||||
<assets path="CHANGELOG.md" rename='changelog.txt'/>
|
||||
|
||||
<!-- NOTE FOR FUTURE SELF SINCE FONTS ARE ALWAYS FUCKY
|
||||
TO FIX ONE OF THEM, I CONVERTED IT TO OTF. DUNNO IF YOU NEED TO
|
||||
|
@ -74,6 +116,7 @@
|
|||
<haxelib name="newgrounds"/>
|
||||
<haxelib name="faxe" if='switch'/>
|
||||
<haxelib name="polymod"/>
|
||||
<!-- <haxelib name="hxcpp-debug-server" if="desktop"/> -->
|
||||
|
||||
<!-- <haxelib name="markdown" /> -->
|
||||
<!-- <haxelib name="HtmlParser" /> -->
|
||||
|
@ -93,9 +136,9 @@
|
|||
<!--<haxedef name="FLX_NO_NATIVE_CURSOR" />-->
|
||||
|
||||
<!--Optimise inputs, be careful you will get null errors if you don't use conditionals in your game-->
|
||||
<haxedef name="FLX_NO_MOUSE" if="mobile" />
|
||||
<haxedef name="FLX_NO_KEYBOARD" if="mobile" />
|
||||
<haxedef name="FLX_NO_TOUCH" if="desktop" />
|
||||
<!-- <haxedef name="FLX_NO_MOUSE" if="mobile" /> -->
|
||||
<!-- <haxedef name="FLX_NO_KEYBOARD" if="mobile" /> -->
|
||||
<!-- <haxedef name="FLX_NO_TOUCH" if="desktop" /> -->
|
||||
<!--<haxedef name="FLX_NO_GAMEPAD" />-->
|
||||
|
||||
<!--Disable the Flixel core sound tray-->
|
||||
|
@ -116,7 +159,11 @@
|
|||
<!-- _________________________________ Custom _______________________________ -->
|
||||
|
||||
<!--Place custom nodes like icons here (higher priority to override the HaxeFlixel icon)-->
|
||||
<icon path="art/icon.png" />
|
||||
|
||||
<icon path="art/icon16.png" size='16'/>
|
||||
<icon path="art/icon32.png" size='32'/>
|
||||
<icon path="art/icon64.png" size='64'/>
|
||||
<icon path="art/iconOG.png" />
|
||||
|
||||
|
||||
<!-- <haxedef name="SKIP_TO_PLAYSTATE" if="debug" /> -->
|
||||
|
|
186
README.md
186
README.md
|
@ -1,92 +1,94 @@
|
|||
# Friday Night Funkin
|
||||
|
||||
This is the repository for Friday Night Funkin, a game originally made for Ludum Dare 47 "Stuck In a Loop".
|
||||
|
||||
Play the Ludum Dare prototype here: https://ninja-muffin24.itch.io/friday-night-funkin
|
||||
Play the Newgrounds one here: https://www.newgrounds.com/portal/view/770371
|
||||
Support the project on the itch.io page: https://ninja-muffin24.itch.io/funkin
|
||||
|
||||
## Credits / shoutouts
|
||||
|
||||
- [ninjamuffin99 (me!)](https://twitter.com/ninja_muffin99) - Programmer
|
||||
- [PhantomArcade3K](https://twitter.com/phantomarcade3k) and [Evilsk8r](https://twitter.com/evilsk8r) - Art
|
||||
- [Kawaisprite](https://twitter.com/kawaisprite) - Musician
|
||||
|
||||
This game was made with love to Newgrounds and it's community. Extra love to Tom Fulp.
|
||||
|
||||
## Build instructions
|
||||
|
||||
THESE INSTRUCTIONS ARE FOR COMPILING THE GAME'S SOURCE CODE!!!
|
||||
|
||||
IF YOU WANT TO JUST DOWNLOAD AND INSTALL AND PLAY THE GAME NORMALLY, GO TO ITCH.IO TO DOWNLOAD THE GAME FOR PC, MAC, AND LINUX!!
|
||||
|
||||
https://ninja-muffin24.itch.io/friday-night-funkin
|
||||
|
||||
IF YOU WANT TO COMPILE THE GAME YOURSELF, CONTINUE READING!!!
|
||||
|
||||
### Installing shit
|
||||
|
||||
First you need to install Haxe and HaxeFlixel. I'm too lazy to write and keep updated with that setup (which is pretty simple).
|
||||
The link to that is on the [HaxeFlixel website](https://haxeflixel.com/documentation/getting-started/)
|
||||
|
||||
Other installations you'd need is the additional libraries, a fully updated list will be in `Project.xml` in the project root, but here are the one's I'm using as of writing.
|
||||
|
||||
```
|
||||
hscript
|
||||
flixel-ui
|
||||
newgrounds
|
||||
```
|
||||
|
||||
So for each of those type `haxelib install [library]` so shit like `haxelib install newgrounds`
|
||||
|
||||
You'll also need to install polymod. Do this with
|
||||
|
||||
```
|
||||
haxelib git polymod https://github.com/larsiusprime/polymod.git
|
||||
```
|
||||
|
||||
### Ignored files
|
||||
|
||||
I gitignore the API keys for the game, so that no one can nab them and post fake highscores on the leaderboards. But because of that the game
|
||||
doesn't compile without it.
|
||||
|
||||
Just make a file in `/source` and call it `APIStuff.hx`, and copy paste this into it
|
||||
|
||||
```haxe
|
||||
package;
|
||||
|
||||
class APIStuff
|
||||
{
|
||||
public static var API:String = "";
|
||||
public static var EncKey:String = "";
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
and you should be good to go there.
|
||||
|
||||
### Compiling game
|
||||
|
||||
Once you have all those installed, it's pretty easy to compile the game. You just need to run 'lime test html5 -debug' in the root of the project to build and run the HTML5 version. (command prompt navigation guide can be found here: [https://ninjamuffin99.newgrounds.com/news/post/1090480](https://ninjamuffin99.newgrounds.com/news/post/1090480))
|
||||
|
||||
To run it from your desktop (Windows, Mac, Linux) it can be a bit more involved. For Linux, you only need to open a terminal in the project directory and run 'lime test linux -debug' and then run the executible file in export/release/linux/bin. For Windows, you need to install Visual Studio Community 2019. While installing VSC, don't click on any of the options to install workloads. Instead, go to the individual components tab and choose the following:
|
||||
* MSVC v142 - VS 2019 C++ x64/x86 build tools
|
||||
* Windows SDK (10.0.17763.0)
|
||||
* C++ Profiling tools
|
||||
* C++ CMake tools for windows
|
||||
* C++ ATL for v142 build tools (x86 & x64)
|
||||
* C++ MFC for v142 build tools (x86 & x64)
|
||||
* C++/CLI support for v142 build tools (14.21)
|
||||
* C++ Modules for v142 build tools (x64/x86)
|
||||
* Clang Compiler for Windows
|
||||
* Windows 10 SDK (10.0.17134.0)
|
||||
* Windows 10 SDK (10.0.16299.0)
|
||||
* MSVC v141 - VS 2017 C++ x64/x86 build tools
|
||||
* MSVC v140 - VS 2015 C++ build tools (v14.00)
|
||||
|
||||
This will install about 22GB of crap, but once that is done you can open up a command line in the project's directory and run `lime test windows -debug`. Once that command finishes (it takes forever even on a higher end PC), you can run FNF from the .exe file under export\release\windows\bin
|
||||
As for Mac, 'lime test mac -debug' should work, if not the internet surely has a guide on how to compile Haxe stuff for Mac.
|
||||
|
||||
### Additional guides
|
||||
|
||||
- [Command line basics](https://ninjamuffin99.newgrounds.com/news/post/1090480)
|
||||
# Friday Night Funkin
|
||||
|
||||
This is the repository for Friday Night Funkin, a game originally made for Ludum Dare 47 "Stuck In a Loop".
|
||||
|
||||
Play the Ludum Dare prototype here: https://ninja-muffin24.itch.io/friday-night-funkin
|
||||
Play the Newgrounds one here: https://www.newgrounds.com/portal/view/770371
|
||||
Support the project on the itch.io page: https://ninja-muffin24.itch.io/funkin
|
||||
|
||||
## Credits / shoutouts
|
||||
|
||||
- [ninjamuffin99 (me!)](https://twitter.com/ninja_muffin99) - Programmer
|
||||
- [PhantomArcade3K](https://twitter.com/phantomarcade3k) and [Evilsk8r](https://twitter.com/evilsk8r) - Art
|
||||
- [Kawaisprite](https://twitter.com/kawaisprite) - Musician
|
||||
|
||||
This game was made with love to Newgrounds and it's community. Extra love to Tom Fulp.
|
||||
|
||||
## Build instructions
|
||||
|
||||
THESE INSTRUCTIONS ARE FOR COMPILING THE GAME'S SOURCE CODE!!!
|
||||
|
||||
IF YOU WANT TO JUST DOWNLOAD AND INSTALL AND PLAY THE GAME NORMALLY, GO TO ITCH.IO TO DOWNLOAD THE GAME FOR PC, MAC, AND LINUX!!
|
||||
|
||||
https://ninja-muffin24.itch.io/friday-night-funkin
|
||||
|
||||
IF YOU WANT TO COMPILE THE GAME YOURSELF, CONTINUE READING!!!
|
||||
|
||||
### Installing the Required Programs
|
||||
|
||||
First you need to install Haxe and HaxeFlixel. I'm too lazy to write and keep updated with that setup (which is pretty simple).
|
||||
1. [Install Haxe 4.1.5](https://haxe.org/download/version/4.1.5/) (Download 4.1.5 instead of 4.2.0 because 4.2.0 is broken and is not working with gits properly...)
|
||||
2. [Install HaxeFlixel](https://haxeflixel.com/documentation/install-haxeflixel/) after downloading Haxe
|
||||
|
||||
Other installations you'd need is the additional libraries, a fully updated list will be in `Project.xml` in the project root. Currently, these are all of the things you need to install:
|
||||
```
|
||||
flixel
|
||||
flixel-addons
|
||||
flixel-ui
|
||||
hscript
|
||||
newgrounds
|
||||
```
|
||||
So for each of those type `haxelib install [library]` so shit like `haxelib install newgrounds`
|
||||
|
||||
You'll also need to install polymod. To do this, you need to do a few things first.
|
||||
1. Download [git-scm](https://git-scm.com/downloads). Works for Windows, Mac, and Linux, just select your build.
|
||||
2. Follow instructions to install the application properly.
|
||||
3. Run `haxelib git polymod https://github.com/larsiusprime/polymod.git` in terminal/command-prompt after your git program is installed.
|
||||
|
||||
You should have everything ready for compiling the game! Follow the guide below to continue!
|
||||
|
||||
### Ignored files
|
||||
|
||||
I gitignore the API keys for the game, so that no one can nab them and post fake highscores on the leaderboards. But because of that the game
|
||||
doesn't compile without it.
|
||||
|
||||
Just make a file in `/source` and call it `APIStuff.hx`, and copy paste this into it
|
||||
|
||||
```haxe
|
||||
package;
|
||||
|
||||
class APIStuff
|
||||
{
|
||||
public static var API:String = "";
|
||||
public static var EncKey:String = "";
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
and you should be good to go there.
|
||||
|
||||
### Compiling game
|
||||
|
||||
Once you have all those installed, it's pretty easy to compile the game. You just need to run 'lime test html5 -debug' in the root of the project to build and run the HTML5 version. (command prompt navigation guide can be found here: [https://ninjamuffin99.newgrounds.com/news/post/1090480](https://ninjamuffin99.newgrounds.com/news/post/1090480))
|
||||
|
||||
To run it from your desktop (Windows, Mac, Linux) it can be a bit more involved. For Linux, you only need to open a terminal in the project directory and run 'lime test linux -debug' and then run the executible file in export/release/linux/bin. For Windows, you need to install Visual Studio Community 2019. While installing VSC, don't click on any of the options to install workloads. Instead, go to the individual components tab and choose the following:
|
||||
* MSVC v142 - VS 2019 C++ x64/x86 build tools
|
||||
* Windows SDK (10.0.17763.0)
|
||||
* C++ Profiling tools
|
||||
* C++ CMake tools for windows
|
||||
* C++ ATL for v142 build tools (x86 & x64)
|
||||
* C++ MFC for v142 build tools (x86 & x64)
|
||||
* C++/CLI support for v142 build tools (14.21)
|
||||
* C++ Modules for v142 build tools (x64/x86)
|
||||
* Clang Compiler for Windows
|
||||
* Windows 10 SDK (10.0.17134.0)
|
||||
* Windows 10 SDK (10.0.16299.0)
|
||||
* MSVC v141 - VS 2017 C++ x64/x86 build tools
|
||||
* MSVC v140 - VS 2015 C++ build tools (v14.00)
|
||||
|
||||
This will install about 22GB of crap, but once that is done you can open up a command line in the project's directory and run `lime test windows -debug`. Once that command finishes (it takes forever even on a higher end PC), you can run FNF from the .exe file under export\release\windows\bin
|
||||
As for Mac, 'lime test mac -debug' should work, if not the internet surely has a guide on how to compile Haxe stuff for Mac.
|
||||
|
||||
### Additional guides
|
||||
|
||||
- [Command line basics](https://ninjamuffin99.newgrounds.com/news/post/1090480)
|
||||
|
|
|
@ -204,7 +204,7 @@ class Alphabet extends FlxSpriteGroup
|
|||
if (FlxG.random.bool(40))
|
||||
{
|
||||
var daSound:String = "GF_";
|
||||
FlxG.sound.play('assets/sounds/' + daSound + FlxG.random.int(1, 4) + TitleState.soundExt, 0.4);
|
||||
FlxG.sound.play(Paths.soundRandom(daSound, 1, 4));
|
||||
}
|
||||
|
||||
add(letter);
|
||||
|
@ -245,7 +245,7 @@ class AlphaCharacter extends FlxSprite
|
|||
public function new(x:Float, y:Float)
|
||||
{
|
||||
super(x, y);
|
||||
var tex = FlxAtlasFrames.fromSparrow('assets/images/alphabet.png', 'assets/images/alphabet.xml');
|
||||
var tex = Paths.getSparrowAtlas('alphabet');
|
||||
frames = tex;
|
||||
|
||||
antialiasing = true;
|
||||
|
|
|
@ -9,7 +9,7 @@ class BackgroundDancer extends FlxSprite
|
|||
{
|
||||
super(x, y);
|
||||
|
||||
frames = FlxAtlasFrames.fromSparrow("assets/images/limo/limoDancer.png", "assets/images/limo/limoDancer.xml");
|
||||
frames = Paths.getSparrowAtlas("limo/limoDancer");
|
||||
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');
|
||||
|
|
|
@ -10,7 +10,7 @@ class BackgroundGirls extends FlxSprite
|
|||
super(x, y);
|
||||
|
||||
// BG fangirls dissuaded
|
||||
frames = FlxAtlasFrames.fromSparrow('assets/images/weeb/bgFreaks.png', 'assets/images/weeb/bgFreaks.xml');
|
||||
frames = Paths.getSparrowAtlas('weeb/bgFreaks');
|
||||
|
||||
animation.addByIndices('danceLeft', 'BG girls group', CoolUtil.numberArray(14), "", 24, false);
|
||||
animation.addByIndices('danceRight', 'BG girls group', CoolUtil.numberArray(30, 15), "", 24, false);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package;
|
||||
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxSprite;
|
||||
import flixel.animation.FlxBaseAnimation;
|
||||
import flixel.graphics.frames.FlxAtlasFrames;
|
||||
|
@ -18,9 +19,9 @@ class Character extends FlxSprite
|
|||
|
||||
public function new(x:Float, y:Float, ?character:String = "bf", ?isPlayer:Bool = false)
|
||||
{
|
||||
animOffsets = new Map<String, Array<Dynamic>>();
|
||||
super(x, y);
|
||||
|
||||
animOffsets = new Map<String, Array<Dynamic>>();
|
||||
curCharacter = character;
|
||||
this.isPlayer = isPlayer;
|
||||
|
||||
|
@ -31,7 +32,7 @@ class Character extends FlxSprite
|
|||
{
|
||||
case 'gf':
|
||||
// GIRLFRIEND CODE
|
||||
tex = FlxAtlasFrames.fromSparrow('assets/images/GF_assets.png', 'assets/images/GF_assets.xml');
|
||||
tex = Paths.getSparrowAtlas('GF_assets');
|
||||
frames = tex;
|
||||
animation.addByPrefix('cheer', 'GF Cheer', 24, false);
|
||||
animation.addByPrefix('singLEFT', 'GF left note', 24, false);
|
||||
|
@ -62,7 +63,7 @@ class Character extends FlxSprite
|
|||
playAnim('danceRight');
|
||||
|
||||
case 'gf-christmas':
|
||||
tex = FlxAtlasFrames.fromSparrow('assets/images/christmas/gfChristmas.png', 'assets/images/christmas/gfChristmas.xml');
|
||||
tex = Paths.getSparrowAtlas('christmas/gfChristmas');
|
||||
frames = tex;
|
||||
animation.addByPrefix('cheer', 'GF Cheer', 24, false);
|
||||
animation.addByPrefix('singLEFT', 'GF left note', 24, false);
|
||||
|
@ -93,7 +94,7 @@ class Character extends FlxSprite
|
|||
playAnim('danceRight');
|
||||
|
||||
case 'gf-car':
|
||||
tex = FlxAtlasFrames.fromSparrow('assets/images/gfCar.png', 'assets/images/gfCar.xml');
|
||||
tex = Paths.getSparrowAtlas('gfCar');
|
||||
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);
|
||||
|
@ -106,7 +107,7 @@ class Character extends FlxSprite
|
|||
playAnim('danceRight');
|
||||
|
||||
case 'gf-pixel':
|
||||
tex = FlxAtlasFrames.fromSparrow('assets/images/weeb/gfPixel.png', 'assets/images/weeb/gfPixel.xml');
|
||||
tex = Paths.getSparrowAtlas('weeb/gfPixel');
|
||||
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);
|
||||
|
@ -123,7 +124,7 @@ class Character extends FlxSprite
|
|||
|
||||
case 'dad':
|
||||
// DAD ANIMATION LOADING CODE
|
||||
tex = FlxAtlasFrames.fromSparrow('assets/images/DADDY_DEAREST.png', 'assets/images/DADDY_DEAREST.xml');
|
||||
tex = Paths.getSparrowAtlas('DADDY_DEAREST');
|
||||
frames = tex;
|
||||
animation.addByPrefix('idle', 'Dad idle dance', 24);
|
||||
animation.addByPrefix('singUP', 'Dad Sing Note UP', 24);
|
||||
|
@ -139,7 +140,7 @@ class Character extends FlxSprite
|
|||
|
||||
playAnim('idle');
|
||||
case 'spooky':
|
||||
tex = FlxAtlasFrames.fromSparrow('assets/images/spooky_kids_assets.png', 'assets/images/spooky_kids_assets.xml');
|
||||
tex = Paths.getSparrowAtlas('spooky_kids_assets');
|
||||
frames = tex;
|
||||
animation.addByPrefix('singUP', 'spooky UP NOTE', 24, false);
|
||||
animation.addByPrefix('singDOWN', 'spooky DOWN note', 24, false);
|
||||
|
@ -158,7 +159,7 @@ class Character extends FlxSprite
|
|||
|
||||
playAnim('danceRight');
|
||||
case 'mom':
|
||||
tex = FlxAtlasFrames.fromSparrow('assets/images/Mom_Assets.png', 'assets/images/Mom_Assets.xml');
|
||||
tex = Paths.getSparrowAtlas('Mom_Assets');
|
||||
frames = tex;
|
||||
|
||||
animation.addByPrefix('idle', "Mom Idle", 24, false);
|
||||
|
@ -178,7 +179,7 @@ class Character extends FlxSprite
|
|||
playAnim('idle');
|
||||
|
||||
case 'mom-car':
|
||||
tex = FlxAtlasFrames.fromSparrow('assets/images/momCar.png', 'assets/images/momCar.xml');
|
||||
tex = Paths.getSparrowAtlas('momCar');
|
||||
frames = tex;
|
||||
|
||||
animation.addByPrefix('idle', "Mom Idle", 24, false);
|
||||
|
@ -197,7 +198,7 @@ class Character extends FlxSprite
|
|||
|
||||
playAnim('idle');
|
||||
case 'monster':
|
||||
tex = FlxAtlasFrames.fromSparrow('assets/images/Monster_Assets.png', 'assets/images/Monster_Assets.xml');
|
||||
tex = Paths.getSparrowAtlas('Monster_Assets');
|
||||
frames = tex;
|
||||
animation.addByPrefix('idle', 'monster idle', 24, false);
|
||||
animation.addByPrefix('singUP', 'monster up note', 24, false);
|
||||
|
@ -212,7 +213,7 @@ class Character extends FlxSprite
|
|||
addOffset("singDOWN", -30, -40);
|
||||
playAnim('idle');
|
||||
case 'monster-christmas':
|
||||
tex = FlxAtlasFrames.fromSparrow('assets/images/christmas/monsterChristmas.png', 'assets/images/christmas/monsterChristmas.xml');
|
||||
tex = Paths.getSparrowAtlas('christmas/monsterChristmas');
|
||||
frames = tex;
|
||||
animation.addByPrefix('idle', 'monster idle', 24, false);
|
||||
animation.addByPrefix('singUP', 'monster up note', 24, false);
|
||||
|
@ -227,7 +228,7 @@ class Character extends FlxSprite
|
|||
addOffset("singDOWN", -40, -94);
|
||||
playAnim('idle');
|
||||
case 'pico':
|
||||
tex = FlxAtlasFrames.fromSparrow('assets/images/Pico_FNF_assetss.png', 'assets/images/Pico_FNF_assetss.xml');
|
||||
tex = Paths.getSparrowAtlas('Pico_FNF_assetss');
|
||||
frames = tex;
|
||||
animation.addByPrefix('idle', "Pico Idle Dance", 24);
|
||||
animation.addByPrefix('singUP', 'pico Up note0', 24, false);
|
||||
|
@ -266,7 +267,7 @@ class Character extends FlxSprite
|
|||
flipX = true;
|
||||
|
||||
case 'bf':
|
||||
var tex = FlxAtlasFrames.fromSparrow('assets/images/BOYFRIEND.png', 'assets/images/BOYFRIEND.xml');
|
||||
var tex = Paths.getSparrowAtlas('BOYFRIEND');
|
||||
frames = tex;
|
||||
animation.addByPrefix('idle', 'BF idle dance', 24, false);
|
||||
animation.addByPrefix('singUP', 'BF NOTE UP0', 24, false);
|
||||
|
@ -305,7 +306,7 @@ class Character extends FlxSprite
|
|||
flipX = true;
|
||||
|
||||
case 'bf-christmas':
|
||||
var tex = FlxAtlasFrames.fromSparrow('assets/images/christmas/bfChristmas.png', 'assets/images/christmas/bfChristmas.xml');
|
||||
var tex = Paths.getSparrowAtlas('christmas/bfChristmas');
|
||||
frames = tex;
|
||||
animation.addByPrefix('idle', 'BF idle dance', 24, false);
|
||||
animation.addByPrefix('singUP', 'BF NOTE UP0', 24, false);
|
||||
|
@ -333,7 +334,7 @@ class Character extends FlxSprite
|
|||
|
||||
flipX = true;
|
||||
case 'bf-car':
|
||||
var tex = FlxAtlasFrames.fromSparrow('assets/images/bfCar.png', 'assets/images/bfCar.xml');
|
||||
var tex = Paths.getSparrowAtlas('bfCar');
|
||||
frames = tex;
|
||||
animation.addByPrefix('idle', 'BF idle dance', 24, false);
|
||||
animation.addByPrefix('singUP', 'BF NOTE UP0', 24, false);
|
||||
|
@ -358,7 +359,7 @@ class Character extends FlxSprite
|
|||
|
||||
flipX = true;
|
||||
case 'bf-pixel':
|
||||
frames = FlxAtlasFrames.fromSparrow('assets/images/weeb/bfPixel.png', 'assets/images/weeb/bfPixel.xml');
|
||||
frames = Paths.getSparrowAtlas('weeb/bfPixel');
|
||||
animation.addByPrefix('idle', 'BF IDLE', 24, false);
|
||||
animation.addByPrefix('singUP', 'BF UP NOTE', 24, false);
|
||||
animation.addByPrefix('singLEFT', 'BF LEFT NOTE', 24, false);
|
||||
|
@ -391,7 +392,7 @@ class Character extends FlxSprite
|
|||
|
||||
flipX = true;
|
||||
case 'bf-pixel-dead':
|
||||
frames = FlxAtlasFrames.fromSparrow('assets/images/weeb/bfPixelsDEAD.png', 'assets/images/weeb/bfPixelsDEAD.xml');
|
||||
frames = Paths.getSparrowAtlas('weeb/bfPixelsDEAD');
|
||||
animation.addByPrefix('singUP', "BF Dies pixel", 24, false);
|
||||
animation.addByPrefix('firstDeath', "BF Dies pixel", 24, false);
|
||||
animation.addByPrefix('deathLoop', "Retry Loop", 24, true);
|
||||
|
@ -409,7 +410,7 @@ class Character extends FlxSprite
|
|||
flipX = true;
|
||||
|
||||
case 'senpai':
|
||||
frames = FlxAtlasFrames.fromSparrow('assets/images/weeb/senpai.png', 'assets/images/weeb/senpai.xml');
|
||||
frames = Paths.getSparrowAtlas('weeb/senpai');
|
||||
animation.addByPrefix('idle', 'Senpai Idle', 24, false);
|
||||
animation.addByPrefix('singUP', 'SENPAI UP NOTE', 24, false);
|
||||
animation.addByPrefix('singLEFT', 'SENPAI LEFT NOTE', 24, false);
|
||||
|
@ -429,7 +430,7 @@ class Character extends FlxSprite
|
|||
|
||||
antialiasing = false;
|
||||
case 'senpai-angry':
|
||||
frames = FlxAtlasFrames.fromSparrow('assets/images/weeb/senpai.png', 'assets/images/weeb/senpai.xml');
|
||||
frames = Paths.getSparrowAtlas('weeb/senpai');
|
||||
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);
|
||||
|
@ -449,7 +450,7 @@ class Character extends FlxSprite
|
|||
antialiasing = false;
|
||||
|
||||
case 'spirit':
|
||||
frames = FlxAtlasFrames.fromSpriteSheetPacker('assets/images/weeb/spirit.png', 'assets/images/weeb/spirit.txt');
|
||||
frames = Paths.getPackerAtlas('weeb/spirit');
|
||||
animation.addByPrefix('idle', "idle spirit_", 24, false);
|
||||
animation.addByPrefix('singUP', "up_", 24, false);
|
||||
animation.addByPrefix('singRIGHT', "right_", 24, false);
|
||||
|
@ -470,8 +471,7 @@ class Character extends FlxSprite
|
|||
antialiasing = false;
|
||||
|
||||
case 'parents-christmas':
|
||||
frames = FlxAtlasFrames.fromSparrow('assets/images/christmas/mom_dad_christmas_assets.png',
|
||||
'assets/images/christmas/mom_dad_christmas_assets.xml');
|
||||
frames = Paths.getSparrowAtlas('christmas/mom_dad_christmas_assets');
|
||||
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);
|
||||
|
@ -623,8 +623,8 @@ class Character extends FlxSprite
|
|||
{
|
||||
animation.play(AnimName, Force, Reversed, Frame);
|
||||
|
||||
var daOffset = animOffsets.get(animation.curAnim.name);
|
||||
if (animOffsets.exists(animation.curAnim.name))
|
||||
var daOffset = animOffsets.get(AnimName);
|
||||
if (animOffsets.exists(AnimName))
|
||||
{
|
||||
offset.set(daOffset[0], daOffset[1]);
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ class ChartParser
|
|||
var IMG_WIDTH:Int = 8;
|
||||
var regex:EReg = new EReg("[ \t]*((\r\n)|\r|\n)[ \t]*", "g");
|
||||
|
||||
var csvData = FlxStringUtil.imageToCSV('assets/data/' + songName + '/' + songName + '_section' + section + '.png');
|
||||
var csvData = FlxStringUtil.imageToCSV(Paths.file('data/' + songName + '/' + songName + '_section' + section + '.png'));
|
||||
|
||||
var lines:Array<String> = regex.split(csvData);
|
||||
var rows:Array<String> = lines.filter(function(line) return line != "");
|
||||
|
|
|
@ -2,6 +2,7 @@ package;
|
|||
|
||||
import Section.SwagSection;
|
||||
import Song.SwagSong;
|
||||
import Conductor.BPMChangeEvent;
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxSprite;
|
||||
import flixel.addons.display.FlxGridOverlay;
|
||||
|
@ -117,11 +118,9 @@ class ChartingState extends MusicBeatState
|
|||
song: 'Test',
|
||||
notes: [],
|
||||
bpm: 150,
|
||||
sections: 0,
|
||||
needsVoices: true,
|
||||
player1: 'bf',
|
||||
player2: 'dad',
|
||||
sectionLengths: [],
|
||||
speed: 1,
|
||||
validScore: false
|
||||
};
|
||||
|
@ -140,6 +139,7 @@ class ChartingState extends MusicBeatState
|
|||
|
||||
loadSong(_song.song);
|
||||
Conductor.changeBPM(_song.bpm);
|
||||
Conductor.mapBPMChanges(_song);
|
||||
|
||||
bpmTxt = new FlxText(1000, 50, 0, "", 16);
|
||||
bpmTxt.scrollFactor.set();
|
||||
|
@ -225,7 +225,7 @@ class ChartingState extends MusicBeatState
|
|||
stepperBPM.value = Conductor.bpm;
|
||||
stepperBPM.name = 'song_bpm';
|
||||
|
||||
var characters:Array<String> = CoolUtil.coolTextFile('assets/data/characterList.txt');
|
||||
var characters:Array<String> = CoolUtil.coolTextFile(Paths.txt('characterList'));
|
||||
|
||||
var player1DropDown = new FlxUIDropDownMenu(10, 100, FlxUIDropDownMenu.makeStrIdLabelArray(characters, true), function(character:String)
|
||||
{
|
||||
|
@ -351,10 +351,10 @@ class ChartingState extends MusicBeatState
|
|||
// vocals.stop();
|
||||
}
|
||||
|
||||
FlxG.sound.playMusic('assets/music/' + daSong + "_Inst" + TitleState.soundExt, 0.6);
|
||||
FlxG.sound.playMusic(Paths.inst(daSong), 0.6);
|
||||
|
||||
// WONT WORK FOR TUTORIAL OR TEST SONG!!! REDO LATER
|
||||
vocals = new FlxSound().loadEmbedded("assets/music/" + daSong + "_Voices" + TitleState.soundExt);
|
||||
vocals = new FlxSound().loadEmbedded(Paths.voices(daSong));
|
||||
FlxG.sound.list.add(vocals);
|
||||
|
||||
FlxG.sound.music.pause();
|
||||
|
@ -366,6 +366,7 @@ class ChartingState extends MusicBeatState
|
|||
vocals.time = 0;
|
||||
FlxG.sound.music.pause();
|
||||
FlxG.sound.music.time = 0;
|
||||
changeSection();
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -425,6 +426,7 @@ class ChartingState extends MusicBeatState
|
|||
else if (wname == 'song_bpm')
|
||||
{
|
||||
tempBpm = Std.int(nums.value);
|
||||
Conductor.mapBPMChanges(_song);
|
||||
Conductor.changeBPM(Std.int(nums.value));
|
||||
}
|
||||
else if (wname == 'note_susLength')
|
||||
|
@ -444,12 +446,27 @@ class ChartingState extends MusicBeatState
|
|||
|
||||
var updatedSection:Bool = false;
|
||||
|
||||
/* this function got owned LOL
|
||||
function lengthBpmBullshit():Float
|
||||
{
|
||||
if (_song.notes[curSection].changeBPM)
|
||||
return _song.notes[curSection].lengthInSteps * (_song.notes[curSection].bpm / _song.bpm);
|
||||
else
|
||||
return _song.notes[curSection].lengthInSteps;
|
||||
}*/
|
||||
|
||||
function sectionStartTime():Float
|
||||
{
|
||||
var daBPM:Int = _song.bpm;
|
||||
var daPos:Float = 0;
|
||||
for (i in 0...curSection)
|
||||
{
|
||||
if (_song.notes[i].changeBPM) {
|
||||
daBPM = _song.notes[i].bpm;
|
||||
}
|
||||
daPos += 4 * (1000 * 60 / daBPM);
|
||||
}
|
||||
return daPos;
|
||||
}
|
||||
|
||||
override function update(elapsed:Float)
|
||||
|
@ -459,23 +476,20 @@ class ChartingState extends MusicBeatState
|
|||
Conductor.songPosition = FlxG.sound.music.time;
|
||||
_song.song = typingShit.text;
|
||||
|
||||
strumLine.y = getYfromStrum(Conductor.songPosition % (Conductor.stepCrochet * lengthBpmBullshit()));
|
||||
strumLine.y = getYfromStrum((Conductor.songPosition - sectionStartTime()) % (Conductor.stepCrochet * _song.notes[curSection].lengthInSteps));
|
||||
|
||||
if (curBeat % 4 == 0)
|
||||
if (curBeat % 4 == 0 && curStep >= 16 * (curSection + 1))
|
||||
{
|
||||
if (curStep > 16 * (curSection + 1))
|
||||
trace(curStep);
|
||||
trace((_song.notes[curSection].lengthInSteps) * (curSection + 1));
|
||||
trace('DUMBSHIT');
|
||||
|
||||
if (_song.notes[curSection + 1] == null)
|
||||
{
|
||||
trace(curStep);
|
||||
trace((_song.notes[curSection].lengthInSteps) * (curSection + 1));
|
||||
trace('DUMBSHIT');
|
||||
|
||||
if (_song.notes[curSection + 1] == null)
|
||||
{
|
||||
addSection();
|
||||
}
|
||||
|
||||
changeSection(curSection + 1, false);
|
||||
addSection();
|
||||
}
|
||||
|
||||
changeSection(curSection + 1, false);
|
||||
}
|
||||
|
||||
FlxG.watch.addQuick('daBeat', curBeat);
|
||||
|
@ -674,21 +688,18 @@ class ChartingState extends MusicBeatState
|
|||
|
||||
function recalculateSteps():Int
|
||||
{
|
||||
var steps:Int = 0;
|
||||
var timeShit:Float = 0;
|
||||
|
||||
for (i in 0...curSection)
|
||||
var lastChange:BPMChangeEvent = {
|
||||
stepTime: 0,
|
||||
songTime: 0,
|
||||
bpm: 0
|
||||
}
|
||||
for (i in 0...Conductor.bpmChangeMap.length)
|
||||
{
|
||||
steps += 16;
|
||||
|
||||
if (_song.notes[i].changeBPM)
|
||||
timeShit += (((60 / _song.notes[i].bpm) * 1000) / 4) * 16;
|
||||
else
|
||||
timeShit += (((60 / _song.bpm) * 1000) / 4) * 16;
|
||||
if (FlxG.sound.music.time > Conductor.bpmChangeMap[i].songTime)
|
||||
lastChange = Conductor.bpmChangeMap[i];
|
||||
}
|
||||
|
||||
steps += Math.floor((FlxG.sound.music.time - timeShit) / Conductor.stepCrochet);
|
||||
curStep = steps;
|
||||
curStep = lastChange.stepTime + Math.floor((FlxG.sound.music.time - lastChange.songTime) / Conductor.stepCrochet);
|
||||
updateBeat();
|
||||
|
||||
return curStep;
|
||||
|
@ -702,7 +713,7 @@ class ChartingState extends MusicBeatState
|
|||
vocals.pause();
|
||||
|
||||
// Basically old shit from changeSection???
|
||||
FlxG.sound.music.time = lengthBpmBullshit() * Conductor.stepCrochet * curSection;
|
||||
FlxG.sound.music.time = sectionStartTime();
|
||||
|
||||
if (songBeginning)
|
||||
{
|
||||
|
@ -732,15 +743,15 @@ class ChartingState extends MusicBeatState
|
|||
FlxG.sound.music.pause();
|
||||
vocals.pause();
|
||||
|
||||
var daNum:Int = 0;
|
||||
/*var daNum:Int = 0;
|
||||
var daLength:Float = 0;
|
||||
while (daNum <= sec)
|
||||
{
|
||||
daLength += lengthBpmBullshit();
|
||||
daNum++;
|
||||
}
|
||||
}*/
|
||||
|
||||
FlxG.sound.music.time = (daLength - lengthBpmBullshit()) * Conductor.stepCrochet;
|
||||
FlxG.sound.music.time = sectionStartTime();
|
||||
vocals.time = FlxG.sound.music.time;
|
||||
updateCurStep();
|
||||
}
|
||||
|
@ -815,10 +826,16 @@ class ChartingState extends MusicBeatState
|
|||
if (_song.notes[curSection].changeBPM && _song.notes[curSection].bpm > 0)
|
||||
{
|
||||
Conductor.changeBPM(_song.notes[curSection].bpm);
|
||||
FlxG.log.add('CHANGED BPM!');
|
||||
}
|
||||
else
|
||||
{
|
||||
Conductor.changeBPM(tempBpm);
|
||||
//get last bpm
|
||||
var daBPM:Int = _song.bpm;
|
||||
for (i in 0...curSection)
|
||||
if (_song.notes[i].changeBPM)
|
||||
daBPM = _song.notes[i].bpm;
|
||||
Conductor.changeBPM(daBPM);
|
||||
}
|
||||
|
||||
/* // PORT BULLSHIT, INCASE THERE'S NO SUSTAIN DATA FOR A NOTE
|
||||
|
@ -846,7 +863,7 @@ class ChartingState extends MusicBeatState
|
|||
note.setGraphicSize(GRID_SIZE, GRID_SIZE);
|
||||
note.updateHitbox();
|
||||
note.x = Math.floor(daNoteInfo * GRID_SIZE);
|
||||
note.y = Math.floor(getYfromStrum(daStrumTime)) % gridBG.height;
|
||||
note.y = Math.floor(getYfromStrum((daStrumTime - sectionStartTime()) % (Conductor.stepCrochet * _song.notes[curSection].lengthInSteps)));
|
||||
|
||||
curRenderedNotes.add(note);
|
||||
|
||||
|
@ -925,7 +942,7 @@ class ChartingState extends MusicBeatState
|
|||
|
||||
private function addNote():Void
|
||||
{
|
||||
var noteStrum = getStrumTime(dummyArrow.y) + (curSection * (Conductor.stepCrochet * 16));
|
||||
var noteStrum = getStrumTime(dummyArrow.y) + sectionStartTime();
|
||||
var noteData = Math.floor(FlxG.mouse.x / GRID_SIZE);
|
||||
var noteSus = 0;
|
||||
|
||||
|
@ -938,7 +955,7 @@ class ChartingState extends MusicBeatState
|
|||
_song.notes[curSection].sectionNotes.push([noteStrum, (noteData + 4) % 8, noteSus]);
|
||||
}
|
||||
|
||||
trace(getStrumTime(dummyArrow.y) + (curSection * (Conductor.stepCrochet * lengthBpmBullshit())));
|
||||
trace(noteStrum);
|
||||
trace(curSection);
|
||||
|
||||
updateGrid();
|
||||
|
@ -957,6 +974,7 @@ class ChartingState extends MusicBeatState
|
|||
return FlxMath.remapToRange(strumTime, 0, 16 * Conductor.stepCrochet, gridBG.y, gridBG.y + gridBG.height);
|
||||
}
|
||||
|
||||
/*
|
||||
function calculateSectionLengths(?sec:SwagSection):Int
|
||||
{
|
||||
var daLength:Int = 0;
|
||||
|
@ -978,7 +996,7 @@ class ChartingState extends MusicBeatState
|
|||
}
|
||||
|
||||
return daLength;
|
||||
}
|
||||
}*/
|
||||
|
||||
private var daSpacing:Float = 0.3;
|
||||
|
||||
|
@ -1014,10 +1032,7 @@ class ChartingState extends MusicBeatState
|
|||
function autosaveSong():Void
|
||||
{
|
||||
FlxG.save.data.autosave = Json.stringify({
|
||||
"song": _song,
|
||||
"bpm": Conductor.bpm,
|
||||
"sections": _song.notes.length,
|
||||
'notes': _song.notes
|
||||
"song": _song
|
||||
});
|
||||
FlxG.save.flush();
|
||||
}
|
||||
|
@ -1025,10 +1040,7 @@ class ChartingState extends MusicBeatState
|
|||
private function saveLevel()
|
||||
{
|
||||
var json = {
|
||||
"song": _song,
|
||||
"bpm": Conductor.bpm,
|
||||
"sections": _song.notes.length,
|
||||
'notes': _song.notes
|
||||
"song": _song
|
||||
};
|
||||
|
||||
var data:String = Json.stringify(json);
|
||||
|
|
|
@ -1,9 +1,19 @@
|
|||
package;
|
||||
|
||||
import Song.SwagSong;
|
||||
|
||||
/**
|
||||
* ...
|
||||
* @author
|
||||
*/
|
||||
|
||||
typedef BPMChangeEvent =
|
||||
{
|
||||
var stepTime:Int;
|
||||
var songTime:Float;
|
||||
var bpm:Int;
|
||||
}
|
||||
|
||||
class Conductor
|
||||
{
|
||||
public static var bpm:Int = 100;
|
||||
|
@ -16,10 +26,39 @@ class Conductor
|
|||
public static var safeFrames:Int = 10;
|
||||
public static var safeZoneOffset:Float = (safeFrames / 60) * 1000; // is calculated in create(), is safeFrames in milliseconds
|
||||
|
||||
public static var bpmChangeMap:Array<BPMChangeEvent> = [];
|
||||
|
||||
public function new()
|
||||
{
|
||||
}
|
||||
|
||||
public static function mapBPMChanges(song:SwagSong)
|
||||
{
|
||||
bpmChangeMap = [];
|
||||
|
||||
var curBPM:Int = song.bpm;
|
||||
var totalSteps:Int = 0;
|
||||
var totalPos:Float = 0;
|
||||
for (i in 0...song.notes.length)
|
||||
{
|
||||
if(song.notes[i].changeBPM && song.notes[i].bpm != curBPM)
|
||||
{
|
||||
curBPM = song.notes[i].bpm;
|
||||
var event:BPMChangeEvent = {
|
||||
stepTime: totalSteps,
|
||||
songTime: totalPos,
|
||||
bpm: curBPM
|
||||
};
|
||||
bpmChangeMap.push(event);
|
||||
}
|
||||
|
||||
var deltaSteps:Int = song.notes[i].lengthInSteps;
|
||||
totalSteps += deltaSteps;
|
||||
totalPos += ((60 / curBPM) * 1000 / 4) * deltaSteps;
|
||||
}
|
||||
trace("new BPM map BUDDY " + bpmChangeMap);
|
||||
}
|
||||
|
||||
public static function changeBPM(newBpm:Int)
|
||||
{
|
||||
bpm = newBpm;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package;
|
||||
|
||||
import flixel.FlxSprite;
|
||||
import flixel.FlxSubState;
|
||||
|
||||
class ControlsSubState extends FlxSubState
|
||||
|
|
|
@ -41,10 +41,10 @@ class DialogueBox extends FlxSpriteGroup
|
|||
switch (PlayState.SONG.song.toLowerCase())
|
||||
{
|
||||
case 'senpai':
|
||||
FlxG.sound.playMusic('assets/music/Lunchbox' + TitleState.soundExt, 0);
|
||||
FlxG.sound.playMusic(Paths.music('Lunchbox'), 0);
|
||||
FlxG.sound.music.fadeIn(1, 0, 0.8);
|
||||
case 'thorns':
|
||||
FlxG.sound.playMusic('assets/music/LunchboxScary' + TitleState.soundExt, 0);
|
||||
FlxG.sound.playMusic(Paths.music('LunchboxScary'), 0);
|
||||
FlxG.sound.music.fadeIn(1, 0, 0.8);
|
||||
}
|
||||
|
||||
|
@ -60,8 +60,42 @@ class DialogueBox extends FlxSpriteGroup
|
|||
bgFade.alpha = 0.7;
|
||||
}, 5);
|
||||
|
||||
box = new FlxSprite(-20, 45);
|
||||
|
||||
var hasDialog = false;
|
||||
switch (PlayState.SONG.song.toLowerCase())
|
||||
{
|
||||
case 'senpai':
|
||||
hasDialog = true;
|
||||
box.frames = Paths.getSparrowAtlas('weeb/pixelUI/dialogueBox-pixel');
|
||||
box.animation.addByPrefix('normalOpen', 'Text Box Appear', 24, false);
|
||||
box.animation.addByIndices('normal', 'Text Box Appear', [4], "", 24);
|
||||
case 'roses':
|
||||
hasDialog = true;
|
||||
FlxG.sound.play(Paths.sound('ANGRY_TEXT_BOX'));
|
||||
|
||||
box.frames = Paths.getSparrowAtlas('weeb/pixelUI/dialogueBox-senpaiMad');
|
||||
box.animation.addByPrefix('normalOpen', 'SENPAI ANGRY IMPACT SPEECH', 24, false);
|
||||
box.animation.addByIndices('normal', 'SENPAI ANGRY IMPACT SPEECH', [4], "", 24);
|
||||
|
||||
case 'thorns':
|
||||
hasDialog = true;
|
||||
box.frames = Paths.getSparrowAtlas('weeb/pixelUI/dialogueBox-evil');
|
||||
box.animation.addByPrefix('normalOpen', 'Spirit Textbox spawn', 24, false);
|
||||
box.animation.addByIndices('normal', 'Spirit Textbox spawn', [11], "", 24);
|
||||
|
||||
var face:FlxSprite = new FlxSprite(320, 170).loadGraphic(Paths.image('weeb/spiritFaceForward'));
|
||||
face.setGraphicSize(Std.int(face.width * 6));
|
||||
add(face);
|
||||
}
|
||||
|
||||
this.dialogueList = dialogueList;
|
||||
|
||||
if (!hasDialog)
|
||||
return;
|
||||
|
||||
portraitLeft = new FlxSprite(-20, 40);
|
||||
portraitLeft.frames = FlxAtlasFrames.fromSparrow('assets/images/weeb/senpaiPortrait.png', 'assets/images/weeb/senpaiPortrait.xml');
|
||||
portraitLeft.frames = Paths.getSparrowAtlas('weeb/senpaiPortrait');
|
||||
portraitLeft.animation.addByPrefix('enter', 'Senpai Portrait Enter', 24, false);
|
||||
portraitLeft.setGraphicSize(Std.int(portraitLeft.width * PlayState.daPixelZoom * 0.9));
|
||||
portraitLeft.updateHitbox();
|
||||
|
@ -70,52 +104,26 @@ class DialogueBox extends FlxSpriteGroup
|
|||
portraitLeft.visible = false;
|
||||
|
||||
portraitRight = new FlxSprite(0, 40);
|
||||
portraitRight.frames = FlxAtlasFrames.fromSparrow('assets/images/weeb/bfPortrait.png', 'assets/images/weeb/bfPortrait.xml');
|
||||
portraitRight.frames = Paths.getSparrowAtlas('weeb/bfPortrait');
|
||||
portraitRight.animation.addByPrefix('enter', 'Boyfriend portrait enter', 24, false);
|
||||
portraitRight.setGraphicSize(Std.int(portraitRight.width * PlayState.daPixelZoom * 0.9));
|
||||
portraitRight.updateHitbox();
|
||||
portraitRight.scrollFactor.set();
|
||||
add(portraitRight);
|
||||
portraitRight.visible = false;
|
||||
|
||||
box = new FlxSprite(-20, 45);
|
||||
|
||||
switch (PlayState.SONG.song.toLowerCase())
|
||||
{
|
||||
case 'senpai':
|
||||
box.frames = FlxAtlasFrames.fromSparrow('assets/images/weeb/pixelUI/dialogueBox-pixel.png',
|
||||
'assets/images/weeb/pixelUI/dialogueBox-pixel.xml');
|
||||
box.animation.addByPrefix('normalOpen', 'Text Box Appear', 24, false);
|
||||
box.animation.addByIndices('normal', 'Text Box Appear', [4], "", 24);
|
||||
case 'roses':
|
||||
FlxG.sound.play('assets/sounds/ANGRY_TEXT_BOX' + TitleState.soundExt);
|
||||
|
||||
box.frames = FlxAtlasFrames.fromSparrow('assets/images/weeb/pixelUI/dialogueBox-senpaiMad.png',
|
||||
'assets/images/weeb/pixelUI/dialogueBox-senpaiMad.xml');
|
||||
box.animation.addByPrefix('normalOpen', 'SENPAI ANGRY IMPACT SPEECH', 24, false);
|
||||
box.animation.addByIndices('normal', 'SENPAI ANGRY IMPACT SPEECH', [4], "", 24);
|
||||
|
||||
case 'thorns':
|
||||
box.frames = FlxAtlasFrames.fromSparrow('assets/images/weeb/pixelUI/dialogueBox-evil.png', 'assets/images/weeb/pixelUI/dialogueBox-evil.xml');
|
||||
box.animation.addByPrefix('normalOpen', 'Spirit Textbox spawn', 24, false);
|
||||
box.animation.addByIndices('normal', 'Spirit Textbox spawn', [11], "", 24);
|
||||
|
||||
var face:FlxSprite = new FlxSprite(320, 170).loadGraphic('assets/images/weeb/spiritFaceForward.png');
|
||||
face.setGraphicSize(Std.int(face.width * 6));
|
||||
add(face);
|
||||
}
|
||||
|
||||
|
||||
box.animation.play('normalOpen');
|
||||
box.setGraphicSize(Std.int(box.width * PlayState.daPixelZoom * 0.9));
|
||||
box.updateHitbox();
|
||||
add(box);
|
||||
|
||||
handSelect = new FlxSprite(FlxG.width * 0.9, FlxG.height * 0.9).loadGraphic('assets/images/weeb/pixelUI/hand_textbox.png');
|
||||
add(handSelect);
|
||||
|
||||
box.screenCenter(X);
|
||||
portraitLeft.screenCenter(X);
|
||||
|
||||
handSelect = new FlxSprite(FlxG.width * 0.9, FlxG.height * 0.9).loadGraphic(Paths.image('weeb/pixelUI/hand_textbox'));
|
||||
add(handSelect);
|
||||
|
||||
|
||||
if (!talkingRight)
|
||||
{
|
||||
// box.flipX = true;
|
||||
|
@ -129,14 +137,12 @@ class DialogueBox extends FlxSpriteGroup
|
|||
swagDialogue = new FlxTypeText(240, 500, Std.int(FlxG.width * 0.6), "", 32);
|
||||
swagDialogue.font = 'Pixel Arial 11 Bold';
|
||||
swagDialogue.color = 0xFF3F2021;
|
||||
swagDialogue.sounds = [FlxG.sound.load('assets/sounds/pixelText' + TitleState.soundExt, 0.6)];
|
||||
swagDialogue.sounds = [FlxG.sound.load(Paths.sound('pixelText'), 0.6)];
|
||||
add(swagDialogue);
|
||||
|
||||
dialogue = new Alphabet(0, 80, "", false, true);
|
||||
// dialogue.x = 90;
|
||||
// add(dialogue);
|
||||
|
||||
this.dialogueList = dialogueList;
|
||||
}
|
||||
|
||||
var dialogueOpened:Bool = false;
|
||||
|
@ -171,13 +177,13 @@ class DialogueBox extends FlxSpriteGroup
|
|||
dialogueStarted = true;
|
||||
}
|
||||
|
||||
if (FlxG.keys.justPressed.ANY)
|
||||
if (FlxG.keys.justPressed.ANY && dialogueStarted == true)
|
||||
{
|
||||
remove(dialogue);
|
||||
|
||||
FlxG.sound.play(Paths.sound('clickText'), 0.8);
|
||||
|
||||
FlxG.sound.play('assets/sounds/clickText' + TitleState.soundExt, 0.8);
|
||||
|
||||
if (dialogueList[1] == null)
|
||||
if (dialogueList[1] == null && dialogueList[0] != null)
|
||||
{
|
||||
if (!isEnding)
|
||||
{
|
||||
|
@ -209,7 +215,7 @@ class DialogueBox extends FlxSpriteGroup
|
|||
startDialogue();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
super.update(elapsed);
|
||||
}
|
||||
|
||||
|
@ -218,7 +224,6 @@ class DialogueBox extends FlxSpriteGroup
|
|||
function startDialogue():Void
|
||||
{
|
||||
cleanDialog();
|
||||
|
||||
// var theDialog:Alphabet = new Alphabet(0, 70, dialogueList[0], false, true);
|
||||
// dialogue = theDialog;
|
||||
// add(theDialog);
|
||||
|
|
|
@ -14,7 +14,7 @@ using StringTools;
|
|||
|
||||
class FreeplayState extends MusicBeatState
|
||||
{
|
||||
var songs:Array<String> = [];
|
||||
var songs:Array<SongMetadata> = [];
|
||||
|
||||
var selector:FlxText;
|
||||
var curSelected:Int = 0;
|
||||
|
@ -30,13 +30,18 @@ class FreeplayState extends MusicBeatState
|
|||
|
||||
override function create()
|
||||
{
|
||||
songs = CoolUtil.coolTextFile('assets/data/freeplaySonglist.txt');
|
||||
var initSonglist = CoolUtil.coolTextFile(Paths.txt('freeplaySonglist'));
|
||||
|
||||
for (i in 0...initSonglist.length)
|
||||
{
|
||||
songs.push(new SongMetadata(initSonglist[i], 1));
|
||||
}
|
||||
|
||||
/*
|
||||
if (FlxG.sound.music != null)
|
||||
{
|
||||
if (!FlxG.sound.music.playing)
|
||||
FlxG.sound.playMusic('assets/music/freakyMenu' + TitleState.soundExt);
|
||||
FlxG.sound.playMusic(Paths.music('freakyMenu'));
|
||||
}
|
||||
*/
|
||||
|
||||
|
@ -47,45 +52,25 @@ class FreeplayState extends MusicBeatState
|
|||
#end
|
||||
|
||||
if (StoryMenuState.weekUnlocked[2] || isDebug)
|
||||
{
|
||||
songs.push('Spookeez');
|
||||
songs.push('South');
|
||||
}
|
||||
addWeek(['Spookeez', 'South', 'Monster'], 2);
|
||||
|
||||
if (StoryMenuState.weekUnlocked[3] || isDebug)
|
||||
{
|
||||
songs.push('Pico');
|
||||
songs.push('Philly');
|
||||
songs.push('Blammed');
|
||||
}
|
||||
addWeek(['Pico', 'Philly', 'Blammed'], 3);
|
||||
|
||||
if (StoryMenuState.weekUnlocked[4] || isDebug)
|
||||
{
|
||||
songs.push('Satin-Panties');
|
||||
songs.push('High');
|
||||
songs.push('Milf');
|
||||
}
|
||||
addWeek(['Satin-Panties', 'High', 'Milf'], 4);
|
||||
|
||||
if (StoryMenuState.weekUnlocked[5] || isDebug)
|
||||
{
|
||||
songs.push('Cocoa');
|
||||
songs.push('Eggnog');
|
||||
songs.push('Winter-Horrorland');
|
||||
}
|
||||
addWeek(['Cocoa', 'Eggnog', 'Winter-Horrorland'], 5);
|
||||
|
||||
if (StoryMenuState.weekUnlocked[6] || isDebug)
|
||||
{
|
||||
songs.push('Senpai');
|
||||
songs.push('Roses');
|
||||
songs.push('Thorns');
|
||||
// songs.push('Winter-Horrorland');
|
||||
}
|
||||
addWeek(['Senpai', 'Roses', 'Thorns'], 6);
|
||||
|
||||
// LOAD MUSIC
|
||||
|
||||
// LOAD CHARACTERS
|
||||
|
||||
var bg:FlxSprite = new FlxSprite().loadGraphic('assets/images/menuBGBlue.png');
|
||||
var bg:FlxSprite = new FlxSprite().loadGraphic(Paths.image('menuBGBlue'));
|
||||
add(bg);
|
||||
|
||||
grpSongs = new FlxTypedGroup<Alphabet>();
|
||||
|
@ -93,7 +78,7 @@ class FreeplayState extends MusicBeatState
|
|||
|
||||
for (i in 0...songs.length)
|
||||
{
|
||||
var songText:Alphabet = new Alphabet(0, (70 * i) + 30, songs[i], true, false);
|
||||
var songText:Alphabet = new Alphabet(0, (70 * i) + 30, songs[i].songName, true, false);
|
||||
songText.isMenuItem = true;
|
||||
songText.targetY = i;
|
||||
grpSongs.add(songText);
|
||||
|
@ -104,7 +89,7 @@ class FreeplayState extends MusicBeatState
|
|||
|
||||
scoreText = new FlxText(FlxG.width * 0.7, 5, 0, "", 32);
|
||||
// scoreText.autoSize = false;
|
||||
scoreText.setFormat("assets/fonts/vcr.ttf", 32, FlxColor.WHITE, RIGHT);
|
||||
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);
|
||||
|
@ -120,7 +105,7 @@ class FreeplayState extends MusicBeatState
|
|||
changeSelection();
|
||||
changeDiff();
|
||||
|
||||
// FlxG.sound.playMusic('assets/music/title' + TitleState.soundExt, 0);
|
||||
// FlxG.sound.playMusic(Paths.music('title'), 0);
|
||||
// FlxG.sound.music.fadeIn(2, 0, 0.8);
|
||||
selector = new FlxText();
|
||||
|
||||
|
@ -150,6 +135,19 @@ class FreeplayState extends MusicBeatState
|
|||
super.create();
|
||||
}
|
||||
|
||||
public function addSong(songName:String, weekNum:Int)
|
||||
{
|
||||
songs.push(new SongMetadata(songName, weekNum));
|
||||
}
|
||||
|
||||
public function addWeek(songs:Array<String>, weekNum:Int)
|
||||
{
|
||||
for (song in songs)
|
||||
{
|
||||
addSong(song, weekNum);
|
||||
}
|
||||
}
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
super.update(elapsed);
|
||||
|
@ -191,16 +189,17 @@ class FreeplayState extends MusicBeatState
|
|||
|
||||
if (accepted)
|
||||
{
|
||||
var poop:String = Highscore.formatSong(songs[curSelected].toLowerCase(), curDifficulty);
|
||||
var poop:String = Highscore.formatSong(songs[curSelected].songName.toLowerCase(), curDifficulty);
|
||||
|
||||
trace(poop);
|
||||
|
||||
PlayState.SONG = Song.loadFromJson(poop, songs[curSelected].toLowerCase());
|
||||
PlayState.SONG = Song.loadFromJson(poop, songs[curSelected].songName.toLowerCase());
|
||||
PlayState.isStoryMode = false;
|
||||
PlayState.storyDifficulty = curDifficulty;
|
||||
FlxG.switchState(new PlayState());
|
||||
if (FlxG.sound.music != null)
|
||||
FlxG.sound.music.stop();
|
||||
|
||||
PlayState.storyWeek = songs[curSelected].week;
|
||||
trace('CUR WEEK' + PlayState.storyWeek);
|
||||
LoadingState.loadAndSwitchState(new PlayState());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -214,7 +213,7 @@ class FreeplayState extends MusicBeatState
|
|||
curDifficulty = 0;
|
||||
|
||||
#if !switch
|
||||
intendedScore = Highscore.getScore(songs[curSelected], curDifficulty);
|
||||
intendedScore = Highscore.getScore(songs[curSelected].songName, curDifficulty);
|
||||
#end
|
||||
|
||||
switch (curDifficulty)
|
||||
|
@ -235,7 +234,7 @@ class FreeplayState extends MusicBeatState
|
|||
#end
|
||||
|
||||
// NGio.logEvent('Fresh');
|
||||
FlxG.sound.play('assets/sounds/scrollMenu' + TitleState.soundExt, 0.4);
|
||||
FlxG.sound.play(Paths.sound('scrollMenu'), 0.4);
|
||||
|
||||
curSelected += change;
|
||||
|
||||
|
@ -247,11 +246,13 @@ class FreeplayState extends MusicBeatState
|
|||
// selector.y = (70 * curSelected) + 30;
|
||||
|
||||
#if !switch
|
||||
intendedScore = Highscore.getScore(songs[curSelected], curDifficulty);
|
||||
intendedScore = Highscore.getScore(songs[curSelected].songName, curDifficulty);
|
||||
// lerpScore = 0;
|
||||
#end
|
||||
|
||||
FlxG.sound.playMusic('assets/music/' + songs[curSelected] + "_Inst" + TitleState.soundExt, 0);
|
||||
#if PRELOAD_ALL
|
||||
FlxG.sound.playMusic(Paths.inst(songs[curSelected].songName), 0);
|
||||
#end
|
||||
|
||||
var bullShit:Int = 0;
|
||||
|
||||
|
@ -271,3 +272,15 @@ class FreeplayState extends MusicBeatState
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
class SongMetadata
|
||||
{
|
||||
public var songName:String = "";
|
||||
public var week:Int = 0;
|
||||
|
||||
public function new(song:String, week:Int)
|
||||
{
|
||||
this.songName = song;
|
||||
this.week = week;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ class GameOverState extends FlxTransitionableState
|
|||
FlxG.sound.music.fadeOut(0.5, 0, function(twn:FlxTween)
|
||||
{
|
||||
FlxG.sound.music.stop();
|
||||
FlxG.switchState(new PlayState());
|
||||
LoadingState.loadAndSwitchState(new PlayState());
|
||||
});
|
||||
}
|
||||
super.update(elapsed);
|
||||
|
|
|
@ -40,7 +40,7 @@ class GameOverSubstate extends MusicBeatSubstate
|
|||
camFollow = new FlxObject(bf.getGraphicMidpoint().x, bf.getGraphicMidpoint().y, 1, 1);
|
||||
add(camFollow);
|
||||
|
||||
FlxG.sound.play('assets/sounds/fnf_loss_sfx' + stageSuffix + TitleState.soundExt);
|
||||
FlxG.sound.play(Paths.sound('fnf_loss_sfx' + stageSuffix));
|
||||
Conductor.changeBPM(100);
|
||||
|
||||
// FlxG.camera.followLerp = 1;
|
||||
|
@ -77,7 +77,7 @@ class GameOverSubstate extends MusicBeatSubstate
|
|||
|
||||
if (bf.animation.curAnim.name == 'firstDeath' && bf.animation.curAnim.finished)
|
||||
{
|
||||
FlxG.sound.playMusic('assets/music/gameOver' + stageSuffix + TitleState.soundExt);
|
||||
FlxG.sound.playMusic(Paths.music('gameOver' + stageSuffix));
|
||||
}
|
||||
|
||||
if (FlxG.sound.music.playing)
|
||||
|
@ -102,12 +102,12 @@ class GameOverSubstate extends MusicBeatSubstate
|
|||
isEnding = true;
|
||||
bf.playAnim('deathConfirm', true);
|
||||
FlxG.sound.music.stop();
|
||||
FlxG.sound.play('assets/music/gameOverEnd' + stageSuffix + TitleState.soundExt);
|
||||
FlxG.sound.play(Paths.music('gameOverEnd' + stageSuffix));
|
||||
new FlxTimer().start(0.7, function(tmr:FlxTimer)
|
||||
{
|
||||
FlxG.camera.fade(FlxColor.BLACK, 2, false, function()
|
||||
{
|
||||
FlxG.switchState(new PlayState());
|
||||
LoadingState.loadAndSwitchState(new PlayState());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
88
source/GitarooPause.hx
Normal file
88
source/GitarooPause.hx
Normal file
|
@ -0,0 +1,88 @@
|
|||
package;
|
||||
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxSprite;
|
||||
import flixel.graphics.frames.FlxAtlasFrames;
|
||||
|
||||
class GitarooPause extends MusicBeatState
|
||||
{
|
||||
var replayButton:FlxSprite;
|
||||
var cancelButton:FlxSprite;
|
||||
|
||||
var replaySelect:Bool = false;
|
||||
|
||||
public function new():Void
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override function create()
|
||||
{
|
||||
if (FlxG.sound.music != null)
|
||||
FlxG.sound.music.stop();
|
||||
|
||||
var bg:FlxSprite = new FlxSprite().loadGraphic(Paths.image('pauseAlt/pauseBG'));
|
||||
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');
|
||||
add(bf);
|
||||
bf.screenCenter(X);
|
||||
|
||||
replayButton = new FlxSprite(FlxG.width * 0.28, FlxG.height * 0.7);
|
||||
replayButton.frames = Paths.getSparrowAtlas('pauseAlt/pauseUI');
|
||||
replayButton.animation.addByPrefix('selected', 'bluereplay', 0, false);
|
||||
replayButton.animation.appendByPrefix('selected', 'yellowreplay');
|
||||
replayButton.animation.play('selected');
|
||||
add(replayButton);
|
||||
|
||||
cancelButton = new FlxSprite(FlxG.width * 0.58, replayButton.y);
|
||||
cancelButton.frames = Paths.getSparrowAtlas('pauseAlt/pauseUI');
|
||||
cancelButton.animation.addByPrefix('selected', 'bluecancel', 0, false);
|
||||
cancelButton.animation.appendByPrefix('selected', 'cancelyellow');
|
||||
cancelButton.animation.play('selected');
|
||||
add(cancelButton);
|
||||
|
||||
changeThing();
|
||||
|
||||
super.create();
|
||||
}
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
if (controls.LEFT_P || controls.RIGHT_P)
|
||||
changeThing();
|
||||
|
||||
if (controls.ACCEPT)
|
||||
{
|
||||
if (replaySelect)
|
||||
{
|
||||
FlxG.switchState(new PlayState());
|
||||
}
|
||||
else
|
||||
{
|
||||
FlxG.switchState(new MainMenuState());
|
||||
}
|
||||
}
|
||||
|
||||
super.update(elapsed);
|
||||
}
|
||||
|
||||
function changeThing():Void
|
||||
{
|
||||
replaySelect = !replaySelect;
|
||||
|
||||
if (replaySelect)
|
||||
{
|
||||
cancelButton.animation.curAnim.curFrame = 0;
|
||||
replayButton.animation.curAnim.curFrame = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
cancelButton.animation.curAnim.curFrame = 1;
|
||||
replayButton.animation.curAnim.curFrame = 0;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -7,7 +7,7 @@ class HealthIcon extends FlxSprite
|
|||
public function new(char:String = 'bf', isPlayer:Bool = false)
|
||||
{
|
||||
super();
|
||||
loadGraphic('assets/images/iconGrid.png', true, 150, 150);
|
||||
loadGraphic(Paths.image('iconGrid'), true, 150, 150);
|
||||
|
||||
antialiasing = true;
|
||||
animation.add('bf', [0, 1], 0, false, isPlayer);
|
||||
|
|
|
@ -14,7 +14,7 @@ class LatencyState extends FlxState
|
|||
|
||||
override function create()
|
||||
{
|
||||
FlxG.sound.playMusic('assets/sounds/soundTest' + TitleState.soundExt);
|
||||
FlxG.sound.playMusic(Paths.sound('soundTest'));
|
||||
|
||||
noteGrp = new FlxTypedGroup<Note>();
|
||||
add(noteGrp);
|
||||
|
|
310
source/LoadingState.hx
Normal file
310
source/LoadingState.hx
Normal file
|
@ -0,0 +1,310 @@
|
|||
package;
|
||||
|
||||
import lime.app.Promise;
|
||||
import lime.app.Future;
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxState;
|
||||
import flixel.FlxSprite;
|
||||
import flixel.graphics.frames.FlxAtlasFrames;
|
||||
import flixel.util.FlxTimer;
|
||||
|
||||
import openfl.utils.Assets;
|
||||
import lime.utils.Assets as LimeAssets;
|
||||
import lime.utils.AssetLibrary;
|
||||
import lime.utils.AssetManifest;
|
||||
|
||||
import haxe.io.Path;
|
||||
|
||||
class LoadingState extends MusicBeatState
|
||||
{
|
||||
inline static var MIN_TIME = 1.0;
|
||||
|
||||
var target:FlxState;
|
||||
var stopMusic = false;
|
||||
var callbacks:MultiCallback;
|
||||
|
||||
var logo:FlxSprite;
|
||||
var gfDance:FlxSprite;
|
||||
var danceLeft = false;
|
||||
|
||||
function new(target:FlxState, stopMusic:Bool)
|
||||
{
|
||||
super();
|
||||
this.target = target;
|
||||
this.stopMusic = stopMusic;
|
||||
}
|
||||
|
||||
override function create()
|
||||
{
|
||||
logo = new FlxSprite(-150, -100);
|
||||
logo.frames = Paths.getSparrowAtlas('logoBumpin');
|
||||
logo.antialiasing = true;
|
||||
logo.animation.addByPrefix('bump', 'logo bumpin', 24);
|
||||
logo.animation.play('bump');
|
||||
logo.updateHitbox();
|
||||
// logoBl.screenCenter();
|
||||
// logoBl.color = FlxColor.BLACK;
|
||||
|
||||
gfDance = new FlxSprite(FlxG.width * 0.4, FlxG.height * 0.07);
|
||||
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);
|
||||
gfDance.antialiasing = true;
|
||||
add(gfDance);
|
||||
add(logo);
|
||||
|
||||
initSongsManifest().onComplete
|
||||
(
|
||||
function (lib)
|
||||
{
|
||||
callbacks = new MultiCallback(onLoad);
|
||||
var introComplete = callbacks.add("introComplete");
|
||||
checkLoadSong(getSongPath());
|
||||
if (PlayState.SONG.needsVoices)
|
||||
checkLoadSong(getVocalPath());
|
||||
checkLibrary("shared");
|
||||
if (PlayState.storyWeek > 0)
|
||||
checkLibrary("week" + PlayState.storyWeek);
|
||||
else
|
||||
checkLibrary("tutorial");
|
||||
|
||||
var fadeTime = 0.5;
|
||||
FlxG.camera.fade(FlxG.camera.bgColor, fadeTime, true);
|
||||
new FlxTimer().start(fadeTime + MIN_TIME, function(_) introComplete());
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function checkLoadSong(path:String)
|
||||
{
|
||||
if (!Assets.cache.hasSound(path))
|
||||
{
|
||||
var library = Assets.getLibrary("songs");
|
||||
final symbolPath = path.split(":").pop();
|
||||
// @:privateAccess
|
||||
// library.types.set(symbolPath, SOUND);
|
||||
// @:privateAccess
|
||||
// library.pathGroups.set(symbolPath, [library.__cacheBreak(symbolPath)]);
|
||||
var callback = callbacks.add("song:" + path);
|
||||
Assets.loadSound(path).onComplete(function (_) { callback(); });
|
||||
}
|
||||
}
|
||||
|
||||
function checkLibrary(library:String)
|
||||
{
|
||||
trace(Assets.hasLibrary(library));
|
||||
if (Assets.getLibrary(library) == null)
|
||||
{
|
||||
@:privateAccess
|
||||
if (!LimeAssets.libraryPaths.exists(library))
|
||||
throw "Missing library: " + library;
|
||||
|
||||
var callback = callbacks.add("library:" + library);
|
||||
Assets.loadLibrary(library).onComplete(function (_) { callback(); });
|
||||
}
|
||||
}
|
||||
|
||||
override function beatHit()
|
||||
{
|
||||
super.beatHit();
|
||||
|
||||
logo.animation.play('bump');
|
||||
danceLeft = !danceLeft;
|
||||
|
||||
if (danceLeft)
|
||||
gfDance.animation.play('danceRight');
|
||||
else
|
||||
gfDance.animation.play('danceLeft');
|
||||
}
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
super.update(elapsed);
|
||||
#if debug
|
||||
if (FlxG.keys.justPressed.SPACE)
|
||||
trace('fired: ' + callbacks.getFired() + " unfired:" + callbacks.getUnfired());
|
||||
#end
|
||||
}
|
||||
|
||||
function onLoad()
|
||||
{
|
||||
if (stopMusic && FlxG.sound.music != null)
|
||||
FlxG.sound.music.stop();
|
||||
|
||||
FlxG.switchState(target);
|
||||
}
|
||||
|
||||
static function getSongPath()
|
||||
{
|
||||
return Paths.inst(PlayState.SONG.song);
|
||||
}
|
||||
|
||||
static function getVocalPath()
|
||||
{
|
||||
return Paths.voices(PlayState.SONG.song);
|
||||
}
|
||||
|
||||
inline static public function loadAndSwitchState(target:FlxState, stopMusic = false)
|
||||
{
|
||||
FlxG.switchState(getNextState(target, stopMusic));
|
||||
}
|
||||
|
||||
static function getNextState(target:FlxState, stopMusic = false):FlxState
|
||||
{
|
||||
Paths.setCurrentLevel("week" + PlayState.storyWeek);
|
||||
#if NO_PRELOAD_ALL
|
||||
var loaded = isSoundLoaded(getSongPath())
|
||||
&& (!PlayState.SONG.needsVoices || isSoundLoaded(getVocalPath()))
|
||||
&& isLibraryLoaded("shared");
|
||||
|
||||
if (!loaded)
|
||||
return new LoadingState(target, stopMusic);
|
||||
#end
|
||||
if (stopMusic && FlxG.sound.music != null)
|
||||
FlxG.sound.music.stop();
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
#if NO_PRELOAD_ALL
|
||||
static function isSoundLoaded(path:String):Bool
|
||||
{
|
||||
return Assets.cache.hasSound(path);
|
||||
}
|
||||
|
||||
static function isLibraryLoaded(library:String):Bool
|
||||
{
|
||||
return Assets.getLibrary(library) != null;
|
||||
}
|
||||
#end
|
||||
|
||||
override function destroy()
|
||||
{
|
||||
super.destroy();
|
||||
|
||||
callbacks = null;
|
||||
}
|
||||
|
||||
static function initSongsManifest()
|
||||
{
|
||||
var id = "songs";
|
||||
var promise = new Promise<AssetLibrary>();
|
||||
|
||||
var library = LimeAssets.getLibrary(id);
|
||||
|
||||
if (library != null)
|
||||
{
|
||||
return Future.withValue(library);
|
||||
}
|
||||
|
||||
var path = id;
|
||||
var rootPath = null;
|
||||
|
||||
@:privateAccess
|
||||
var libraryPaths = LimeAssets.libraryPaths;
|
||||
if (libraryPaths.exists(id))
|
||||
{
|
||||
path = libraryPaths[id];
|
||||
rootPath = Path.directory(path);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (StringTools.endsWith(path, ".bundle"))
|
||||
{
|
||||
rootPath = path;
|
||||
path += "/library.json";
|
||||
}
|
||||
else
|
||||
{
|
||||
rootPath = Path.directory(path);
|
||||
}
|
||||
@:privateAccess
|
||||
path = LimeAssets.__cacheBreak(path);
|
||||
}
|
||||
|
||||
AssetManifest.loadFromFile(path, rootPath).onComplete(function(manifest)
|
||||
{
|
||||
if (manifest == null)
|
||||
{
|
||||
promise.error("Cannot parse asset manifest for library \"" + id + "\"");
|
||||
return;
|
||||
}
|
||||
|
||||
var library = AssetLibrary.fromManifest(manifest);
|
||||
|
||||
if (library == null)
|
||||
{
|
||||
promise.error("Cannot open library \"" + id + "\"");
|
||||
}
|
||||
else
|
||||
{
|
||||
@:privateAccess
|
||||
LimeAssets.libraries.set(id, library);
|
||||
library.onChange.add(LimeAssets.onChange.dispatch);
|
||||
promise.completeWith(Future.withValue(library));
|
||||
}
|
||||
}).onError(function(_)
|
||||
{
|
||||
promise.error("There is no asset library with an ID of \"" + id + "\"");
|
||||
});
|
||||
|
||||
return promise.future;
|
||||
}
|
||||
}
|
||||
|
||||
class MultiCallback
|
||||
{
|
||||
public var callback:Void->Void;
|
||||
public var logId:String = null;
|
||||
public var length(default, null) = 0;
|
||||
public var numRemaining(default, null) = 0;
|
||||
|
||||
var unfired = new Map<String, Void->Void>();
|
||||
var fired = new Array<String>();
|
||||
|
||||
public function new (callback:Void->Void, logId:String = null)
|
||||
{
|
||||
this.callback = callback;
|
||||
this.logId = logId;
|
||||
}
|
||||
|
||||
public function add(id = "untitled")
|
||||
{
|
||||
id = '$length:$id';
|
||||
length++;
|
||||
numRemaining++;
|
||||
var func:Void->Void = null;
|
||||
func = function ()
|
||||
{
|
||||
if (unfired.exists(id))
|
||||
{
|
||||
unfired.remove(id);
|
||||
fired.push(id);
|
||||
numRemaining--;
|
||||
|
||||
if (logId != null)
|
||||
log('fired $id, $numRemaining remaining');
|
||||
|
||||
if (numRemaining == 0)
|
||||
{
|
||||
if (logId != null)
|
||||
log('all callbacks fired');
|
||||
callback();
|
||||
}
|
||||
}
|
||||
else
|
||||
log('already fired $id');
|
||||
}
|
||||
unfired[id] = func;
|
||||
return func;
|
||||
}
|
||||
|
||||
inline function log(msg):Void
|
||||
{
|
||||
if (logId != null)
|
||||
trace('$logId: $msg');
|
||||
}
|
||||
|
||||
public function getFired() return fired.copy();
|
||||
public function getUnfired() return [for (id in unfired.keys()) id];
|
||||
}
|
|
@ -1,15 +1,73 @@
|
|||
package;
|
||||
|
||||
import flixel.FlxGame;
|
||||
import flixel.FlxState;
|
||||
import openfl.Assets;
|
||||
import openfl.Lib;
|
||||
import openfl.display.FPS;
|
||||
import openfl.display.Sprite;
|
||||
import openfl.events.Event;
|
||||
|
||||
class Main extends Sprite
|
||||
{
|
||||
var gameWidth:Int = 1280; // Width of the game in pixels (might be less / more in actual pixels depending on your zoom).
|
||||
var gameHeight:Int = 720; // Height of the game in pixels (might be less / more in actual pixels depending on your zoom).
|
||||
var initialState:Class<FlxState> = TitleState; // The FlxState the game starts with.
|
||||
var zoom:Float = -1; // If -1, zoom is automatically calculated to fit the window dimensions.
|
||||
var framerate:Int = 60; // How many frames per second the game should run at.
|
||||
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
|
||||
|
||||
// You can pretty much ignore everything from here on - your code should go in your states.
|
||||
|
||||
public static function main():Void
|
||||
{
|
||||
Lib.current.addChild(new Main());
|
||||
}
|
||||
|
||||
public function new()
|
||||
{
|
||||
super();
|
||||
addChild(new FlxGame(0, 0, TitleState));
|
||||
|
||||
if (stage != null)
|
||||
{
|
||||
init();
|
||||
}
|
||||
else
|
||||
{
|
||||
addEventListener(Event.ADDED_TO_STAGE, init);
|
||||
}
|
||||
}
|
||||
|
||||
private function init(?E:Event):Void
|
||||
{
|
||||
if (hasEventListener(Event.ADDED_TO_STAGE))
|
||||
{
|
||||
removeEventListener(Event.ADDED_TO_STAGE, init);
|
||||
}
|
||||
|
||||
setupGame();
|
||||
}
|
||||
|
||||
private function setupGame():Void
|
||||
{
|
||||
var stageWidth:Int = Lib.current.stage.stageWidth;
|
||||
var stageHeight:Int = Lib.current.stage.stageHeight;
|
||||
|
||||
if (zoom == -1)
|
||||
{
|
||||
var ratioX:Float = stageWidth / gameWidth;
|
||||
var ratioY:Float = stageHeight / gameHeight;
|
||||
zoom = Math.min(ratioX, ratioY);
|
||||
gameWidth = Math.ceil(stageWidth / zoom);
|
||||
gameHeight = Math.ceil(stageHeight / zoom);
|
||||
}
|
||||
|
||||
#if !debug
|
||||
initialState = TitleState;
|
||||
#end
|
||||
|
||||
addChild(new FlxGame(gameWidth, gameHeight, initialState, zoom, framerate, framerate, skipSplash, startFullscreen));
|
||||
|
||||
#if !mobile
|
||||
addChild(new FPS(10, 3, 0xFFFFFF));
|
||||
|
|
|
@ -3,6 +3,7 @@ package;
|
|||
import flixel.FlxG;
|
||||
import flixel.FlxObject;
|
||||
import flixel.FlxSprite;
|
||||
import flixel.addons.transition.FlxTransitionableState;
|
||||
import flixel.effects.FlxFlicker;
|
||||
import flixel.graphics.frames.FlxAtlasFrames;
|
||||
import flixel.group.FlxGroup.FlxTypedGroup;
|
||||
|
@ -22,7 +23,7 @@ class MainMenuState extends MusicBeatState
|
|||
var menuItems:FlxTypedGroup<FlxSprite>;
|
||||
|
||||
#if !switch
|
||||
var optionShit:Array<String> = ['story mode', 'freeplay', 'donate'];
|
||||
var optionShit:Array<String> = ['story mode', 'freeplay', 'donate', 'options'];
|
||||
#else
|
||||
var optionShit:Array<String> = ['story mode', 'freeplay'];
|
||||
#end
|
||||
|
@ -32,14 +33,17 @@ class MainMenuState extends MusicBeatState
|
|||
|
||||
override function create()
|
||||
{
|
||||
transIn = FlxTransitionableState.defaultTransIn;
|
||||
transOut = FlxTransitionableState.defaultTransOut;
|
||||
|
||||
if (!FlxG.sound.music.playing)
|
||||
{
|
||||
FlxG.sound.playMusic('assets/music/freakyMenu' + TitleState.soundExt);
|
||||
FlxG.sound.playMusic(Paths.music('freakyMenu'));
|
||||
}
|
||||
|
||||
persistentUpdate = persistentDraw = true;
|
||||
|
||||
var bg:FlxSprite = new FlxSprite(-80).loadGraphic('assets/images/menuBG.png');
|
||||
var bg:FlxSprite = new FlxSprite(-80).loadGraphic(Paths.image('menuBG'));
|
||||
bg.scrollFactor.x = 0;
|
||||
bg.scrollFactor.y = 0.18;
|
||||
bg.setGraphicSize(Std.int(bg.width * 1.1));
|
||||
|
@ -51,7 +55,7 @@ class MainMenuState extends MusicBeatState
|
|||
camFollow = new FlxObject(0, 0, 1, 1);
|
||||
add(camFollow);
|
||||
|
||||
magenta = new FlxSprite(-80).loadGraphic('assets/images/menuDesat.png');
|
||||
magenta = new FlxSprite(-80).loadGraphic(Paths.image('menuDesat'));
|
||||
magenta.scrollFactor.x = 0;
|
||||
magenta.scrollFactor.y = 0.18;
|
||||
magenta.setGraphicSize(Std.int(magenta.width * 1.1));
|
||||
|
@ -66,7 +70,7 @@ class MainMenuState extends MusicBeatState
|
|||
menuItems = new FlxTypedGroup<FlxSprite>();
|
||||
add(menuItems);
|
||||
|
||||
var tex = FlxAtlasFrames.fromSparrow('assets/images/FNF_main_menu_assets.png', 'assets/images/FNF_main_menu_assets.xml');
|
||||
var tex = Paths.getSparrowAtlas('FNF_main_menu_assets');
|
||||
|
||||
for (i in 0...optionShit.length)
|
||||
{
|
||||
|
@ -109,13 +113,13 @@ class MainMenuState extends MusicBeatState
|
|||
{
|
||||
if (controls.UP_P)
|
||||
{
|
||||
FlxG.sound.play('assets/sounds/scrollMenu' + TitleState.soundExt);
|
||||
FlxG.sound.play(Paths.sound('scrollMenu'));
|
||||
changeItem(-1);
|
||||
}
|
||||
|
||||
if (controls.DOWN_P)
|
||||
{
|
||||
FlxG.sound.play('assets/sounds/scrollMenu' + TitleState.soundExt);
|
||||
FlxG.sound.play(Paths.sound('scrollMenu'));
|
||||
changeItem(1);
|
||||
}
|
||||
|
||||
|
@ -137,7 +141,7 @@ class MainMenuState extends MusicBeatState
|
|||
else
|
||||
{
|
||||
selectedSomethin = true;
|
||||
FlxG.sound.play('assets/sounds/confirmMenu' + TitleState.soundExt);
|
||||
FlxG.sound.play(Paths.sound('confirmMenu'));
|
||||
|
||||
FlxFlicker.flicker(magenta, 1.1, 0.15, false);
|
||||
|
||||
|
@ -170,6 +174,8 @@ class MainMenuState extends MusicBeatState
|
|||
trace("Freeplay Menu Selected");
|
||||
|
||||
case 'options':
|
||||
FlxTransitionableState.skipNextTransIn = true;
|
||||
FlxTransitionableState.skipNextTransOut = true;
|
||||
FlxG.switchState(new OptionsMenu());
|
||||
}
|
||||
});
|
||||
|
|
|
@ -13,7 +13,7 @@ class MenuCharacter extends FlxSprite
|
|||
|
||||
this.character = character;
|
||||
|
||||
var tex = FlxAtlasFrames.fromSparrow('assets/images/campaign_menu_UI_characters.png', 'assets/images/campaign_menu_UI_characters.xml');
|
||||
var tex = Paths.getSparrowAtlas('campaign_menu_UI_characters');
|
||||
frames = tex;
|
||||
|
||||
animation.addByPrefix('bf', "BF idle dance white", 24);
|
||||
|
|
|
@ -14,7 +14,7 @@ class MenuItem extends FlxSpriteGroup
|
|||
{
|
||||
super(x, y);
|
||||
|
||||
var tex = FlxAtlasFrames.fromSparrow('assets/images/campaign_menu_UI_assets.png', 'assets/images/campaign_menu_UI_assets.xml');
|
||||
var tex = Paths.getSparrowAtlas('campaign_menu_UI_assets');
|
||||
|
||||
week = new FlxSprite();
|
||||
week.frames = tex;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package;
|
||||
|
||||
import Conductor.BPMChangeEvent;
|
||||
import flixel.FlxG;
|
||||
import flixel.addons.transition.FlxTransitionableState;
|
||||
import flixel.addons.ui.FlxUIState;
|
||||
|
@ -11,9 +12,6 @@ class MusicBeatState extends FlxUIState
|
|||
private var lastBeat:Float = 0;
|
||||
private var lastStep:Float = 0;
|
||||
|
||||
private var totalBeats:Int = 0;
|
||||
private var totalSteps:Int = 0;
|
||||
|
||||
private var curStep:Int = 0;
|
||||
private var curBeat:Int = 0;
|
||||
private var controls(get, never):Controls;
|
||||
|
@ -26,68 +24,52 @@ class MusicBeatState extends FlxUIState
|
|||
if (transIn != null)
|
||||
trace('reg ' + transIn.region);
|
||||
|
||||
#if (!web)
|
||||
TitleState.soundExt = '.ogg';
|
||||
#end
|
||||
|
||||
super.create();
|
||||
}
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
everyStep();
|
||||
//everyStep();
|
||||
var oldStep:Int = curStep;
|
||||
|
||||
updateCurStep();
|
||||
// Needs to be ROUNED, rather than ceil or floor
|
||||
updateBeat();
|
||||
|
||||
if (oldStep != curStep && curStep > 0)
|
||||
stepHit();
|
||||
|
||||
super.update(elapsed);
|
||||
}
|
||||
|
||||
private function updateBeat():Void
|
||||
{
|
||||
curBeat = Math.round(curStep / 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* CHECKS EVERY FRAME
|
||||
*/
|
||||
private function everyStep():Void
|
||||
{
|
||||
if (Conductor.songPosition > lastStep + Conductor.stepCrochet - Conductor.safeZoneOffset
|
||||
|| Conductor.songPosition < lastStep + Conductor.safeZoneOffset)
|
||||
{
|
||||
if (Conductor.songPosition > lastStep + Conductor.stepCrochet)
|
||||
{
|
||||
stepHit();
|
||||
}
|
||||
}
|
||||
curBeat = Math.floor(curStep / 4);
|
||||
}
|
||||
|
||||
private function updateCurStep():Void
|
||||
{
|
||||
curStep = Math.floor(Conductor.songPosition / Conductor.stepCrochet);
|
||||
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];
|
||||
}
|
||||
|
||||
curStep = lastChange.stepTime + Math.floor((Conductor.songPosition - lastChange.songTime) / Conductor.stepCrochet);
|
||||
}
|
||||
|
||||
public function stepHit():Void
|
||||
{
|
||||
totalSteps += 1;
|
||||
lastStep += Conductor.stepCrochet;
|
||||
|
||||
// If the song is at least 3 steps behind
|
||||
if (Conductor.songPosition > lastStep + (Conductor.stepCrochet * 3))
|
||||
{
|
||||
lastStep = Conductor.songPosition;
|
||||
totalSteps = Math.ceil(lastStep / Conductor.stepCrochet);
|
||||
}
|
||||
|
||||
if (totalSteps % 4 == 0)
|
||||
if (curStep % 4 == 0)
|
||||
beatHit();
|
||||
}
|
||||
|
||||
public function beatHit():Void
|
||||
{
|
||||
lastBeat += Conductor.crochet;
|
||||
totalBeats += 1;
|
||||
//do literally nothing dumbass
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package;
|
||||
|
||||
import Conductor.BPMChangeEvent;
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxSubState;
|
||||
|
||||
|
@ -13,9 +14,6 @@ class MusicBeatSubstate extends FlxSubState
|
|||
private var lastBeat:Float = 0;
|
||||
private var lastStep:Float = 0;
|
||||
|
||||
private var totalBeats:Int = 0;
|
||||
private var totalSteps:Int = 0;
|
||||
|
||||
private var curStep:Int = 0;
|
||||
private var curBeat:Int = 0;
|
||||
private var controls(get, never):Controls;
|
||||
|
@ -23,57 +21,45 @@ class MusicBeatSubstate extends FlxSubState
|
|||
inline function get_controls():Controls
|
||||
return PlayerSettings.player1.controls;
|
||||
|
||||
override function create()
|
||||
{
|
||||
#if (!web)
|
||||
TitleState.soundExt = '.ogg';
|
||||
#end
|
||||
|
||||
super.create();
|
||||
}
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
everyStep();
|
||||
//everyStep();
|
||||
var oldStep:Int = curStep;
|
||||
|
||||
updateCurStep();
|
||||
curBeat = Math.round(curStep / 4);
|
||||
curBeat = Math.floor(curStep / 4);
|
||||
|
||||
if (oldStep != curStep && curStep > 0)
|
||||
stepHit();
|
||||
|
||||
|
||||
super.update(elapsed);
|
||||
}
|
||||
|
||||
/**
|
||||
* CHECKS EVERY FRAME
|
||||
*/
|
||||
private function everyStep():Void
|
||||
{
|
||||
if (Conductor.songPosition > lastStep + Conductor.stepCrochet - Conductor.safeZoneOffset
|
||||
|| Conductor.songPosition < lastStep + Conductor.safeZoneOffset)
|
||||
{
|
||||
if (Conductor.songPosition > lastStep + Conductor.stepCrochet)
|
||||
{
|
||||
stepHit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function updateCurStep():Void
|
||||
{
|
||||
curStep = Math.floor(Conductor.songPosition / Conductor.stepCrochet);
|
||||
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];
|
||||
}
|
||||
|
||||
curStep = lastChange.stepTime + Math.floor((Conductor.songPosition - lastChange.songTime) / Conductor.stepCrochet);
|
||||
}
|
||||
|
||||
public function stepHit():Void
|
||||
{
|
||||
totalSteps += 1;
|
||||
lastStep += Conductor.stepCrochet;
|
||||
|
||||
if (totalSteps % 4 == 0)
|
||||
if (curStep % 4 == 0)
|
||||
beatHit();
|
||||
}
|
||||
|
||||
public function beatHit():Void
|
||||
{
|
||||
lastBeat += Conductor.crochet;
|
||||
totalBeats += 1;
|
||||
//do literally nothing dumbass
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,8 @@ import io.newgrounds.objects.events.Result.GetVersionResult;
|
|||
import lime.app.Application;
|
||||
import openfl.display.Stage;
|
||||
|
||||
using StringTools;
|
||||
|
||||
/**
|
||||
* MADE BY GEOKURELI THE LEGENED GOD HERO MVP
|
||||
*/
|
||||
|
@ -28,6 +30,7 @@ class NGio
|
|||
public static var ngScoresLoaded(default, null):FlxSignal = new FlxSignal();
|
||||
|
||||
public static var GAME_VER:String = "";
|
||||
public static var GAME_VER_NUMS:String = '';
|
||||
public static var gotOnlineVer:Bool = false;
|
||||
|
||||
public static function noLogin(api:String)
|
||||
|
@ -35,19 +38,24 @@ class NGio
|
|||
trace('INIT NOLOGIN');
|
||||
GAME_VER = "v" + Application.current.meta.get('version');
|
||||
|
||||
NG.create(api);
|
||||
|
||||
new FlxTimer().start(2, function(tmr:FlxTimer)
|
||||
if (api.length != 0)
|
||||
{
|
||||
var call = NG.core.calls.app.getCurrentVersion(GAME_VER).addDataHandler(function(response:Response<GetCurrentVersionResult>)
|
||||
{
|
||||
GAME_VER = response.result.data.current_version;
|
||||
trace('CURRENT NG VERSION: ' + GAME_VER);
|
||||
gotOnlineVer = true;
|
||||
});
|
||||
NG.create(api);
|
||||
|
||||
call.send();
|
||||
});
|
||||
new FlxTimer().start(2, function(tmr:FlxTimer)
|
||||
{
|
||||
var call = NG.core.calls.app.getCurrentVersion(GAME_VER).addDataHandler(function(response:Response<GetCurrentVersionResult>)
|
||||
{
|
||||
GAME_VER = response.result.data.currentVersion;
|
||||
GAME_VER_NUMS = GAME_VER.split(" ")[0].trim();
|
||||
trace('CURRENT NG VERSION: ' + GAME_VER);
|
||||
trace('CURRENT NG VERSION: ' + GAME_VER_NUMS);
|
||||
gotOnlineVer = true;
|
||||
});
|
||||
|
||||
call.send();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function new(api:String, encKey:String, ?sessionId:String)
|
||||
|
|
|
@ -4,7 +4,9 @@ import flixel.FlxSprite;
|
|||
import flixel.graphics.frames.FlxAtlasFrames;
|
||||
import flixel.math.FlxMath;
|
||||
import flixel.util.FlxColor;
|
||||
#if polymod
|
||||
import polymod.format.ParseRules.TargetSignatureElement;
|
||||
#end
|
||||
|
||||
using StringTools;
|
||||
|
||||
|
@ -51,8 +53,8 @@ class Note extends FlxSprite
|
|||
|
||||
switch (daStage)
|
||||
{
|
||||
case 'school':
|
||||
loadGraphic('assets/images/weeb/pixelUI/arrows-pixels.png', true, 17, 17);
|
||||
case 'school' | 'schoolEvil':
|
||||
loadGraphic(Paths.image('weeb/pixelUI/arrows-pixels'), true, 17, 17);
|
||||
|
||||
animation.add('greenScroll', [6]);
|
||||
animation.add('redScroll', [7]);
|
||||
|
@ -61,33 +63,7 @@ class Note extends FlxSprite
|
|||
|
||||
if (isSustainNote)
|
||||
{
|
||||
loadGraphic('assets/images/weeb/pixelUI/arrowEnds.png', true, 7, 6);
|
||||
|
||||
animation.add('purpleholdend', [4]);
|
||||
animation.add('greenholdend', [6]);
|
||||
animation.add('redholdend', [7]);
|
||||
animation.add('blueholdend', [5]);
|
||||
|
||||
animation.add('purplehold', [0]);
|
||||
animation.add('greenhold', [2]);
|
||||
animation.add('redhold', [3]);
|
||||
animation.add('bluehold', [1]);
|
||||
}
|
||||
|
||||
setGraphicSize(Std.int(width * PlayState.daPixelZoom));
|
||||
updateHitbox();
|
||||
|
||||
case 'schoolEvil': // COPY PASTED CUZ I AM LAZY
|
||||
loadGraphic('assets/images/weeb/pixelUI/arrows-pixels.png', true, 17, 17);
|
||||
|
||||
animation.add('greenScroll', [6]);
|
||||
animation.add('redScroll', [7]);
|
||||
animation.add('blueScroll', [5]);
|
||||
animation.add('purpleScroll', [4]);
|
||||
|
||||
if (isSustainNote)
|
||||
{
|
||||
loadGraphic('assets/images/weeb/pixelUI/arrowEnds.png', true, 7, 6);
|
||||
loadGraphic(Paths.image('weeb/pixelUI/arrowEnds'), true, 7, 6);
|
||||
|
||||
animation.add('purpleholdend', [4]);
|
||||
animation.add('greenholdend', [6]);
|
||||
|
@ -104,7 +80,7 @@ class Note extends FlxSprite
|
|||
updateHitbox();
|
||||
|
||||
default:
|
||||
frames = FlxAtlasFrames.fromSparrow('assets/images/NOTE_assets.png', 'assets/images/NOTE_assets.xml');
|
||||
frames = Paths.getSparrowAtlas('NOTE_assets');
|
||||
|
||||
animation.addByPrefix('greenScroll', 'green0');
|
||||
animation.addByPrefix('redScroll', 'red0');
|
||||
|
@ -174,18 +150,18 @@ class Note extends FlxSprite
|
|||
{
|
||||
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');
|
||||
case 1:
|
||||
prevNote.animation.play('bluehold');
|
||||
case 0:
|
||||
prevNote.animation.play('purplehold');
|
||||
}
|
||||
|
||||
prevNote.offset.y = -19;
|
||||
prevNote.scale.y *= (2.25 * FlxMath.roundDecimal(PlayState.SONG.speed, 1));
|
||||
prevNote.scale.y *= Conductor.stepCrochet / 100 * 1.5 * PlayState.SONG.speed;
|
||||
prevNote.updateHitbox();
|
||||
// prevNote.setGraphicSize();
|
||||
}
|
||||
}
|
||||
|
@ -197,16 +173,14 @@ class Note extends FlxSprite
|
|||
|
||||
if (mustPress)
|
||||
{
|
||||
// The * 0.5 us so that its easier to hit them too late, instead of too early
|
||||
// The * 0.5 is so that it's easier to hit them too late, instead of too early
|
||||
if (strumTime > Conductor.songPosition - Conductor.safeZoneOffset
|
||||
&& strumTime < Conductor.songPosition + (Conductor.safeZoneOffset * 0.5))
|
||||
{
|
||||
canBeHit = true;
|
||||
}
|
||||
else
|
||||
canBeHit = false;
|
||||
|
||||
if (strumTime < Conductor.songPosition - Conductor.safeZoneOffset)
|
||||
if (strumTime < Conductor.songPosition - Conductor.safeZoneOffset && !wasGoodHit)
|
||||
tooLate = true;
|
||||
}
|
||||
else
|
||||
|
@ -214,9 +188,7 @@ class Note extends FlxSprite
|
|||
canBeHit = false;
|
||||
|
||||
if (strumTime <= Conductor.songPosition)
|
||||
{
|
||||
wasGoodHit = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (tooLate)
|
||||
|
|
6
source/Options.hx
Normal file
6
source/Options.hx
Normal file
|
@ -0,0 +1,6 @@
|
|||
package;
|
||||
|
||||
class Options
|
||||
{
|
||||
public static var masterVolume:Float = 1;
|
||||
}
|
|
@ -23,8 +23,8 @@ class OptionsMenu extends MusicBeatState
|
|||
|
||||
override function create()
|
||||
{
|
||||
var menuBG:FlxSprite = new FlxSprite().loadGraphic('assets/images/menuDesat.png');
|
||||
controlsStrings = CoolUtil.coolTextFile('assets/data/controls.txt');
|
||||
var menuBG:FlxSprite = new FlxSprite().loadGraphic(Paths.image('menuDesat'));
|
||||
controlsStrings = CoolUtil.coolTextFile(Paths.txt('controls'));
|
||||
menuBG.color = 0xFFea71fd;
|
||||
menuBG.setGraphicSize(Std.int(menuBG.width * 1.1));
|
||||
menuBG.updateHitbox();
|
||||
|
@ -32,44 +32,50 @@ class OptionsMenu extends MusicBeatState
|
|||
menuBG.antialiasing = true;
|
||||
add(menuBG);
|
||||
|
||||
grpControls = new FlxTypedGroup<Alphabet>();
|
||||
add(grpControls);
|
||||
/*
|
||||
grpControls = new FlxTypedGroup<Alphabet>();
|
||||
add(grpControls);
|
||||
|
||||
for (i in 0...controlsStrings.length)
|
||||
{
|
||||
if (controlsStrings[i].indexOf('set') != -1)
|
||||
for (i in 0...controlsStrings.length)
|
||||
{
|
||||
var controlLabel:Alphabet = new Alphabet(0, (70 * i) + 30, controlsStrings[i].substring(3) + ': ' + controlsStrings[i + 1], true, false);
|
||||
controlLabel.isMenuItem = true;
|
||||
controlLabel.targetY = i;
|
||||
grpControls.add(controlLabel);
|
||||
if (controlsStrings[i].indexOf('set') != -1)
|
||||
{
|
||||
var controlLabel:Alphabet = new Alphabet(0, (70 * i) + 30, controlsStrings[i].substring(3) + ': ' + controlsStrings[i + 1], true, false);
|
||||
controlLabel.isMenuItem = true;
|
||||
controlLabel.targetY = i;
|
||||
grpControls.add(controlLabel);
|
||||
}
|
||||
// DONT PUT X IN THE FIRST PARAMETER OF new ALPHABET() !!
|
||||
}
|
||||
// DONT PUT X IN THE FIRST PARAMETER OF new ALPHABET() !!
|
||||
}
|
||||
*/
|
||||
|
||||
super.create();
|
||||
|
||||
openSubState(new OptionsSubState());
|
||||
}
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
super.update(elapsed);
|
||||
|
||||
if (controls.ACCEPT)
|
||||
{
|
||||
changeBinding();
|
||||
}
|
||||
/*
|
||||
if (controls.ACCEPT)
|
||||
{
|
||||
changeBinding();
|
||||
}
|
||||
|
||||
if (isSettingControl)
|
||||
waitingInput();
|
||||
else
|
||||
{
|
||||
if (controls.BACK)
|
||||
FlxG.switchState(new MainMenuState());
|
||||
if (controls.UP_P)
|
||||
changeSelection(-1);
|
||||
if (controls.DOWN_P)
|
||||
changeSelection(1);
|
||||
}
|
||||
if (isSettingControl)
|
||||
waitingInput();
|
||||
else
|
||||
{
|
||||
if (controls.BACK)
|
||||
FlxG.switchState(new MainMenuState());
|
||||
if (controls.UP_P)
|
||||
changeSelection(-1);
|
||||
if (controls.DOWN_P)
|
||||
changeSelection(1);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
function waitingInput():Void
|
||||
|
@ -97,7 +103,7 @@ class OptionsMenu extends MusicBeatState
|
|||
NGio.logEvent('Fresh');
|
||||
#end
|
||||
|
||||
FlxG.sound.play('assets/sounds/scrollMenu' + TitleState.soundExt, 0.4);
|
||||
FlxG.sound.play(Paths.sound('scrollMenu'), 0.4);
|
||||
|
||||
curSelected += change;
|
||||
|
||||
|
|
|
@ -1,11 +1,70 @@
|
|||
package;
|
||||
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxSprite;
|
||||
import flixel.group.FlxGroup.FlxTypedGroup;
|
||||
import flixel.text.FlxText;
|
||||
import flixel.util.FlxColor;
|
||||
|
||||
class OptionsSubState extends MusicBeatSubstate
|
||||
{
|
||||
var textMenuItems:Array<String> = ['Master Volume', 'Sound Volume'];
|
||||
var textMenuItems:Array<String> = ['Master Volume', 'Sound Volume', 'Controls'];
|
||||
|
||||
var selector:FlxSprite;
|
||||
var curSelected:Int = 0;
|
||||
|
||||
var grpOptionsTexts:FlxTypedGroup<FlxText>;
|
||||
|
||||
public function new()
|
||||
{
|
||||
super();
|
||||
|
||||
grpOptionsTexts = new FlxTypedGroup<FlxText>();
|
||||
add(grpOptionsTexts);
|
||||
|
||||
selector = new FlxSprite().makeGraphic(5, 5, FlxColor.RED);
|
||||
add(selector);
|
||||
|
||||
for (i in 0...textMenuItems.length)
|
||||
{
|
||||
var optionText:FlxText = new FlxText(20, 20 + (i * 50), 0, textMenuItems[i], 32);
|
||||
optionText.ID = i;
|
||||
grpOptionsTexts.add(optionText);
|
||||
}
|
||||
}
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
super.update(elapsed);
|
||||
|
||||
if (controls.UP_P)
|
||||
curSelected -= 1;
|
||||
|
||||
if (controls.DOWN_P)
|
||||
curSelected += 1;
|
||||
|
||||
if (curSelected < 0)
|
||||
curSelected = textMenuItems.length - 1;
|
||||
|
||||
if (curSelected >= textMenuItems.length)
|
||||
curSelected = 0;
|
||||
|
||||
grpOptionsTexts.forEach(function(txt:FlxText)
|
||||
{
|
||||
txt.color = FlxColor.WHITE;
|
||||
|
||||
if (txt.ID == curSelected)
|
||||
txt.color = FlxColor.YELLOW;
|
||||
});
|
||||
|
||||
if (controls.ACCEPT)
|
||||
{
|
||||
switch (textMenuItems[curSelected])
|
||||
{
|
||||
case "Controls":
|
||||
FlxG.state.closeSubState();
|
||||
FlxG.state.openSubState(new ControlsSubState());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
123
source/Paths.hx
Normal file
123
source/Paths.hx
Normal file
|
@ -0,0 +1,123 @@
|
|||
package;
|
||||
|
||||
import openfl.utils.Assets as OpenFlAssets;
|
||||
import openfl.utils.AssetType;
|
||||
|
||||
import flixel.FlxG;
|
||||
import flixel.graphics.frames.FlxAtlasFrames;
|
||||
|
||||
class Paths
|
||||
{
|
||||
inline public static var SOUND_EXT = #if web "mp3" #else "ogg" #end;
|
||||
|
||||
static var currentLevel:String;
|
||||
|
||||
static public function setCurrentLevel(name:String)
|
||||
{
|
||||
currentLevel = name.toLowerCase();
|
||||
}
|
||||
|
||||
static function getPath(file:String, type:AssetType, library:Null<String>)
|
||||
{
|
||||
if (library != null)
|
||||
return getLibraryPath(file, library);
|
||||
|
||||
if (currentLevel != null)
|
||||
{
|
||||
var levelPath = getLibraryPathForce(file, currentLevel);
|
||||
if (OpenFlAssets.exists(levelPath, type))
|
||||
return levelPath;
|
||||
|
||||
levelPath = getLibraryPathForce(file, "shared");
|
||||
if (OpenFlAssets.exists(levelPath, type))
|
||||
return levelPath;
|
||||
}
|
||||
|
||||
return getPreloadPath(file);
|
||||
}
|
||||
|
||||
static public function getLibraryPath(file:String, library = "preload")
|
||||
{
|
||||
return if (library == "preload" || library == "default")
|
||||
getPreloadPath(file);
|
||||
else
|
||||
getLibraryPathForce(file, library);
|
||||
}
|
||||
|
||||
inline static function getLibraryPathForce(file:String, library:String)
|
||||
{
|
||||
|
||||
return '$library:assets/$library/$file';
|
||||
}
|
||||
|
||||
inline static function getPreloadPath(file:String)
|
||||
{
|
||||
|
||||
return 'assets/$file';
|
||||
}
|
||||
|
||||
inline static public function file(file:String, type:AssetType = TEXT, ?library:String)
|
||||
{
|
||||
return getPath(file, type, library);
|
||||
}
|
||||
|
||||
inline static public function txt(key:String, ?library:String)
|
||||
{
|
||||
return getPath('data/$key.txt', TEXT, library);
|
||||
}
|
||||
|
||||
inline static public function xml(key:String, ?library:String)
|
||||
{
|
||||
return getPath('data/$key.xml', TEXT, library);
|
||||
}
|
||||
|
||||
inline static public function json(key:String, ?library:String)
|
||||
{
|
||||
return getPath('data/$key.json', TEXT, library);
|
||||
}
|
||||
|
||||
static public function sound(key:String, ?library:String)
|
||||
{
|
||||
return getPath('sounds/$key.$SOUND_EXT', SOUND, library);
|
||||
}
|
||||
|
||||
inline static public function soundRandom(key:String, min:Int, max:Int, ?library:String)
|
||||
{
|
||||
return sound(key + FlxG.random.int(min, max), library);
|
||||
}
|
||||
|
||||
inline static public function music(key:String, ?library:String)
|
||||
{
|
||||
return getPath('music/$key.$SOUND_EXT', MUSIC, library);
|
||||
}
|
||||
|
||||
inline static public function voices(song:String)
|
||||
{
|
||||
return 'songs:assets/songs/${song.toLowerCase()}/Voices.$SOUND_EXT';
|
||||
}
|
||||
|
||||
inline static public function inst(song:String)
|
||||
{
|
||||
return 'songs:assets/songs/${song.toLowerCase()}/Inst.$SOUND_EXT';
|
||||
}
|
||||
|
||||
inline static public function image(key:String, ?library:String)
|
||||
{
|
||||
return getPath('images/$key.png', IMAGE, library);
|
||||
}
|
||||
|
||||
inline static public function font(key:String)
|
||||
{
|
||||
return 'assets/fonts/$key';
|
||||
}
|
||||
|
||||
inline static public function getSparrowAtlas(key:String, ?library:String)
|
||||
{
|
||||
return FlxAtlasFrames.fromSparrow(image(key, library), file('images/$key.xml', library));
|
||||
}
|
||||
|
||||
inline static public function getPackerAtlas(key:String, ?library:String)
|
||||
{
|
||||
return FlxAtlasFrames.fromSpriteSheetPacker(image(key, library), file('images/$key.txt', library));
|
||||
}
|
||||
}
|
|
@ -4,6 +4,7 @@ import Controls.Control;
|
|||
import flixel.FlxG;
|
||||
import flixel.FlxSprite;
|
||||
import flixel.FlxSubState;
|
||||
import flixel.addons.transition.FlxTransitionableState;
|
||||
import flixel.group.FlxGroup.FlxTypedGroup;
|
||||
import flixel.input.keyboard.FlxKey;
|
||||
import flixel.system.FlxSound;
|
||||
|
@ -22,7 +23,7 @@ class PauseSubState extends MusicBeatSubstate
|
|||
{
|
||||
super();
|
||||
|
||||
pauseMusic = new FlxSound().loadEmbedded('assets/music/breakfast' + TitleState.soundExt, true, true);
|
||||
pauseMusic = new FlxSound().loadEmbedded(Paths.music('breakfast'), true, true);
|
||||
pauseMusic.volume = 0;
|
||||
pauseMusic.play(false, FlxG.random.int(0, Std.int(pauseMusic.length / 2)));
|
||||
|
||||
|
|
|
@ -124,6 +124,10 @@ class PlayState extends MusicBeatState
|
|||
|
||||
override public function create()
|
||||
{
|
||||
|
||||
if (FlxG.sound.music != null)
|
||||
FlxG.sound.music.stop();
|
||||
|
||||
// var gameCam:FlxCamera = FlxG.camera;
|
||||
camGame = new FlxCamera();
|
||||
camHUD = new FlxCamera();
|
||||
|
@ -140,6 +144,7 @@ class PlayState extends MusicBeatState
|
|||
if (SONG == null)
|
||||
SONG = Song.loadFromJson('tutorial');
|
||||
|
||||
Conductor.mapBPMChanges(SONG);
|
||||
Conductor.changeBPM(SONG.bpm);
|
||||
|
||||
switch (SONG.song.toLowerCase())
|
||||
|
@ -162,11 +167,11 @@ class PlayState extends MusicBeatState
|
|||
"Only then I will even CONSIDER letting you\ndate my daughter!"
|
||||
];
|
||||
case 'senpai':
|
||||
dialogue = CoolUtil.coolTextFile('assets/data/senpai/senpaiDialogue.txt');
|
||||
dialogue = CoolUtil.coolTextFile(Paths.txt('senpai/senpaiDialogue'));
|
||||
case 'roses':
|
||||
dialogue = CoolUtil.coolTextFile('assets/data/roses/rosesDialogue.txt');
|
||||
dialogue = CoolUtil.coolTextFile(Paths.txt('roses/rosesDialogue'));
|
||||
case 'thorns':
|
||||
dialogue = CoolUtil.coolTextFile('assets/data/thorns/thornsDialogue.txt');
|
||||
dialogue = CoolUtil.coolTextFile(Paths.txt('thorns/thornsDialogue'));
|
||||
}
|
||||
|
||||
if (SONG.song.toLowerCase() == 'spookeez' || SONG.song.toLowerCase() == 'monster' || SONG.song.toLowerCase() == 'south')
|
||||
|
@ -174,7 +179,7 @@ class PlayState extends MusicBeatState
|
|||
curStage = "spooky";
|
||||
halloweenLevel = true;
|
||||
|
||||
var hallowTex = FlxAtlasFrames.fromSparrow('assets/images/halloween_bg.png', 'assets/images/halloween_bg.xml');
|
||||
var hallowTex = Paths.getSparrowAtlas('halloween_bg');
|
||||
|
||||
halloweenBG = new FlxSprite(-200, -100);
|
||||
halloweenBG.frames = hallowTex;
|
||||
|
@ -190,11 +195,11 @@ class PlayState extends MusicBeatState
|
|||
{
|
||||
curStage = 'philly';
|
||||
|
||||
var bg:FlxSprite = new FlxSprite(-100).loadGraphic('assets/images/philly/sky.png');
|
||||
var bg:FlxSprite = new FlxSprite(-100).loadGraphic(Paths.image('philly/sky'));
|
||||
bg.scrollFactor.set(0.1, 0.1);
|
||||
add(bg);
|
||||
|
||||
var city:FlxSprite = new FlxSprite(-10).loadGraphic('assets/images/philly/city.png');
|
||||
var city:FlxSprite = new FlxSprite(-10).loadGraphic(Paths.image('philly/city'));
|
||||
city.scrollFactor.set(0.3, 0.3);
|
||||
city.setGraphicSize(Std.int(city.width * 0.85));
|
||||
city.updateHitbox();
|
||||
|
@ -205,26 +210,27 @@ class PlayState extends MusicBeatState
|
|||
|
||||
for (i in 0...5)
|
||||
{
|
||||
var light:FlxSprite = new FlxSprite(city.x).loadGraphic('assets/images/philly/win' + i + '.png');
|
||||
var light:FlxSprite = new FlxSprite(city.x).loadGraphic(Paths.image('philly/win' + i));
|
||||
light.scrollFactor.set(0.3, 0.3);
|
||||
light.visible = false;
|
||||
light.setGraphicSize(Std.int(light.width * 0.85));
|
||||
light.updateHitbox();
|
||||
light.antialiasing = true;
|
||||
phillyCityLights.add(light);
|
||||
}
|
||||
|
||||
var streetBehind:FlxSprite = new FlxSprite(-40, 50).loadGraphic('assets/images/philly/behindTrain.png');
|
||||
var streetBehind:FlxSprite = new FlxSprite(-40, 50).loadGraphic(Paths.image('philly/behindTrain'));
|
||||
add(streetBehind);
|
||||
|
||||
phillyTrain = new FlxSprite(2000, 360).loadGraphic('assets/images/philly/train.png');
|
||||
phillyTrain = new FlxSprite(2000, 360).loadGraphic(Paths.image('philly/train'));
|
||||
add(phillyTrain);
|
||||
|
||||
trainSound = new FlxSound().loadEmbedded('assets/sounds/train_passes' + TitleState.soundExt);
|
||||
trainSound = new FlxSound().loadEmbedded(Paths.sound('train_passes'));
|
||||
FlxG.sound.list.add(trainSound);
|
||||
|
||||
// var cityLights:FlxSprite = new FlxSprite().loadGraphic(AssetPaths.win0.png);
|
||||
|
||||
var street:FlxSprite = new FlxSprite(-40, streetBehind.y).loadGraphic('assets/images/philly/street.png');
|
||||
var street:FlxSprite = new FlxSprite(-40, streetBehind.y).loadGraphic(Paths.image('philly/street'));
|
||||
add(street);
|
||||
}
|
||||
else if (SONG.song.toLowerCase() == 'milf' || SONG.song.toLowerCase() == 'satin-panties' || SONG.song.toLowerCase() == 'high')
|
||||
|
@ -232,12 +238,12 @@ class PlayState extends MusicBeatState
|
|||
curStage = 'limo';
|
||||
defaultCamZoom = 0.90;
|
||||
|
||||
var skyBG:FlxSprite = new FlxSprite(-120, -50).loadGraphic('assets/images/limo/limoSunset.png');
|
||||
var skyBG:FlxSprite = new FlxSprite(-120, -50).loadGraphic(Paths.image('limo/limoSunset'));
|
||||
skyBG.scrollFactor.set(0.1, 0.1);
|
||||
add(skyBG);
|
||||
|
||||
var bgLimo:FlxSprite = new FlxSprite(-200, 480);
|
||||
bgLimo.frames = FlxAtlasFrames.fromSparrow('assets/images/limo/bgLimo.png', 'assets/images/limo/bgLimo.xml');
|
||||
bgLimo.frames = Paths.getSparrowAtlas('limo/bgLimo');
|
||||
bgLimo.animation.addByPrefix('drive', "background limo pink", 24);
|
||||
bgLimo.animation.play('drive');
|
||||
bgLimo.scrollFactor.set(0.4, 0.4);
|
||||
|
@ -253,7 +259,7 @@ class PlayState extends MusicBeatState
|
|||
grpLimoDancers.add(dancer);
|
||||
}
|
||||
|
||||
var overlayShit:FlxSprite = new FlxSprite(-500, -600).loadGraphic('assets/images/limo/limoOverlay.png');
|
||||
var overlayShit:FlxSprite = new FlxSprite(-500, -600).loadGraphic(Paths.image('limo/limoOverlay'));
|
||||
overlayShit.alpha = 0.5;
|
||||
// add(overlayShit);
|
||||
|
||||
|
@ -263,7 +269,7 @@ class PlayState extends MusicBeatState
|
|||
|
||||
// overlayShit.shader = shaderBullshit;
|
||||
|
||||
var limoTex = FlxAtlasFrames.fromSparrow('assets/images/limo/limoDrive.png', 'assets/images/limo/limoDrive.xml');
|
||||
var limoTex = Paths.getSparrowAtlas('limo/limoDrive');
|
||||
|
||||
limo = new FlxSprite(-120, 550);
|
||||
limo.frames = limoTex;
|
||||
|
@ -271,7 +277,7 @@ class PlayState extends MusicBeatState
|
|||
limo.animation.play('drive');
|
||||
limo.antialiasing = true;
|
||||
|
||||
fastCar = new FlxSprite(-300, 160).loadGraphic('assets/images/limo/fastCarLol.png');
|
||||
fastCar = new FlxSprite(-300, 160).loadGraphic(Paths.image('limo/fastCarLol'));
|
||||
// add(limo);
|
||||
}
|
||||
else if (SONG.song.toLowerCase() == 'cocoa' || SONG.song.toLowerCase() == 'eggnog')
|
||||
|
@ -280,7 +286,7 @@ class PlayState extends MusicBeatState
|
|||
|
||||
defaultCamZoom = 0.80;
|
||||
|
||||
var bg:FlxSprite = new FlxSprite(-1000, -500).loadGraphic('assets/images/christmas/bgWalls.png');
|
||||
var bg:FlxSprite = new FlxSprite(-1000, -500).loadGraphic(Paths.image('christmas/bgWalls'));
|
||||
bg.antialiasing = true;
|
||||
bg.scrollFactor.set(0.2, 0.2);
|
||||
bg.active = false;
|
||||
|
@ -289,7 +295,7 @@ class PlayState extends MusicBeatState
|
|||
add(bg);
|
||||
|
||||
upperBoppers = new FlxSprite(-240, -90);
|
||||
upperBoppers.frames = FlxAtlasFrames.fromSparrow('assets/images/christmas/upperBop.png', 'assets/images/christmas/upperBop.xml');
|
||||
upperBoppers.frames = Paths.getSparrowAtlas('christmas/upperBop');
|
||||
upperBoppers.animation.addByPrefix('bop', "Upper Crowd Bob", 24, false);
|
||||
upperBoppers.antialiasing = true;
|
||||
upperBoppers.scrollFactor.set(0.33, 0.33);
|
||||
|
@ -297,7 +303,7 @@ class PlayState extends MusicBeatState
|
|||
upperBoppers.updateHitbox();
|
||||
add(upperBoppers);
|
||||
|
||||
var bgEscalator:FlxSprite = new FlxSprite(-1100, -600).loadGraphic('assets/images/christmas/bgEscalator.png');
|
||||
var bgEscalator:FlxSprite = new FlxSprite(-1100, -600).loadGraphic(Paths.image('christmas/bgEscalator'));
|
||||
bgEscalator.antialiasing = true;
|
||||
bgEscalator.scrollFactor.set(0.3, 0.3);
|
||||
bgEscalator.active = false;
|
||||
|
@ -305,13 +311,13 @@ class PlayState extends MusicBeatState
|
|||
bgEscalator.updateHitbox();
|
||||
add(bgEscalator);
|
||||
|
||||
var tree:FlxSprite = new FlxSprite(370, -250).loadGraphic('assets/images/christmas/christmasTree.png');
|
||||
var tree:FlxSprite = new FlxSprite(370, -250).loadGraphic(Paths.image('christmas/christmasTree'));
|
||||
tree.antialiasing = true;
|
||||
tree.scrollFactor.set(0.40, 0.40);
|
||||
add(tree);
|
||||
|
||||
bottomBoppers = new FlxSprite(-300, 140);
|
||||
bottomBoppers.frames = FlxAtlasFrames.fromSparrow('assets/images/christmas/bottomBop.png', 'assets/images/christmas/bottomBop.xml');
|
||||
bottomBoppers.frames = Paths.getSparrowAtlas('christmas/bottomBop');
|
||||
bottomBoppers.animation.addByPrefix('bop', 'Bottom Level Boppers', 24, false);
|
||||
bottomBoppers.antialiasing = true;
|
||||
bottomBoppers.scrollFactor.set(0.9, 0.9);
|
||||
|
@ -319,13 +325,13 @@ class PlayState extends MusicBeatState
|
|||
bottomBoppers.updateHitbox();
|
||||
add(bottomBoppers);
|
||||
|
||||
var fgSnow:FlxSprite = new FlxSprite(-600, 700).loadGraphic('assets/images/christmas/fgSnow.png');
|
||||
var fgSnow:FlxSprite = new FlxSprite(-600, 700).loadGraphic(Paths.image('christmas/fgSnow'));
|
||||
fgSnow.active = false;
|
||||
fgSnow.antialiasing = true;
|
||||
add(fgSnow);
|
||||
|
||||
santa = new FlxSprite(-840, 150);
|
||||
santa.frames = FlxAtlasFrames.fromSparrow('assets/images/christmas/santa.png', 'assets/images/christmas/santa.xml');
|
||||
santa.frames = Paths.getSparrowAtlas('christmas/santa');
|
||||
santa.animation.addByPrefix('idle', 'santa idle in fear', 24, false);
|
||||
santa.antialiasing = true;
|
||||
add(santa);
|
||||
|
@ -333,7 +339,7 @@ class PlayState extends MusicBeatState
|
|||
else if (SONG.song.toLowerCase() == 'winter-horrorland')
|
||||
{
|
||||
curStage = 'mallEvil';
|
||||
var bg:FlxSprite = new FlxSprite(-400, -500).loadGraphic('assets/images/christmas/evilBG.png');
|
||||
var bg:FlxSprite = new FlxSprite(-400, -500).loadGraphic(Paths.image('christmas/evilBG'));
|
||||
bg.antialiasing = true;
|
||||
bg.scrollFactor.set(0.2, 0.2);
|
||||
bg.active = false;
|
||||
|
@ -341,12 +347,12 @@ class PlayState extends MusicBeatState
|
|||
bg.updateHitbox();
|
||||
add(bg);
|
||||
|
||||
var evilTree:FlxSprite = new FlxSprite(300, -300).loadGraphic('assets/images/christmas/evilTree.png');
|
||||
var evilTree:FlxSprite = new FlxSprite(300, -300).loadGraphic(Paths.image('christmas/evilTree'));
|
||||
evilTree.antialiasing = true;
|
||||
evilTree.scrollFactor.set(0.2, 0.2);
|
||||
add(evilTree);
|
||||
|
||||
var evilSnow:FlxSprite = new FlxSprite(-200, 700).loadGraphic("assets/images/christmas/evilSnow.png");
|
||||
var evilSnow:FlxSprite = new FlxSprite(-200, 700).loadGraphic(Paths.image("christmas/evilSnow"));
|
||||
evilSnow.antialiasing = true;
|
||||
add(evilSnow);
|
||||
}
|
||||
|
@ -356,26 +362,26 @@ class PlayState extends MusicBeatState
|
|||
|
||||
// defaultCamZoom = 0.9;
|
||||
|
||||
var bgSky = new FlxSprite().loadGraphic('assets/images/weeb/weebSky.png');
|
||||
var bgSky = new FlxSprite().loadGraphic(Paths.image('weeb/weebSky'));
|
||||
bgSky.scrollFactor.set(0.1, 0.1);
|
||||
add(bgSky);
|
||||
|
||||
var repositionShit = -200;
|
||||
|
||||
var bgSchool:FlxSprite = new FlxSprite(repositionShit, 0).loadGraphic('assets/images/weeb/weebSchool.png');
|
||||
var bgSchool:FlxSprite = new FlxSprite(repositionShit, 0).loadGraphic(Paths.image('weeb/weebSchool'));
|
||||
bgSchool.scrollFactor.set(0.6, 0.90);
|
||||
add(bgSchool);
|
||||
|
||||
var bgStreet:FlxSprite = new FlxSprite(repositionShit).loadGraphic('assets/images/weeb/weebStreet.png');
|
||||
var bgStreet:FlxSprite = new FlxSprite(repositionShit).loadGraphic(Paths.image('weeb/weebStreet'));
|
||||
bgStreet.scrollFactor.set(0.95, 0.95);
|
||||
add(bgStreet);
|
||||
|
||||
var fgTrees:FlxSprite = new FlxSprite(repositionShit + 170, 130).loadGraphic('assets/images/weeb/weebTreesBack.png');
|
||||
var fgTrees:FlxSprite = new FlxSprite(repositionShit + 170, 130).loadGraphic(Paths.image('weeb/weebTreesBack'));
|
||||
fgTrees.scrollFactor.set(0.9, 0.9);
|
||||
add(fgTrees);
|
||||
|
||||
var bgTrees:FlxSprite = new FlxSprite(repositionShit - 380, -800);
|
||||
var treetex = FlxAtlasFrames.fromSpriteSheetPacker('assets/images/weeb/weebTrees.png', 'assets/images/weeb/weebTrees.txt');
|
||||
var treetex = Paths.getPackerAtlas('weeb/weebTrees');
|
||||
bgTrees.frames = treetex;
|
||||
bgTrees.animation.add('treeLoop', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18], 12);
|
||||
bgTrees.animation.play('treeLoop');
|
||||
|
@ -383,7 +389,7 @@ class PlayState extends MusicBeatState
|
|||
add(bgTrees);
|
||||
|
||||
var treeLeaves:FlxSprite = new FlxSprite(repositionShit, -40);
|
||||
treeLeaves.frames = FlxAtlasFrames.fromSparrow('assets/images/weeb/petals.png', 'assets/images/weeb/petals.xml');
|
||||
treeLeaves.frames = Paths.getSparrowAtlas('weeb/petals');
|
||||
treeLeaves.animation.addByPrefix('leaves', 'PETALS ALL', 24, true);
|
||||
treeLeaves.animation.play('leaves');
|
||||
treeLeaves.scrollFactor.set(0.85, 0.85);
|
||||
|
@ -428,7 +434,7 @@ class PlayState extends MusicBeatState
|
|||
var posY = 200;
|
||||
|
||||
var bg:FlxSprite = new FlxSprite(posX, posY);
|
||||
bg.frames = FlxAtlasFrames.fromSparrow('assets/images/weeb/animatedEvilSchool.png', 'assets/images/weeb/animatedEvilSchool.xml');
|
||||
bg.frames = Paths.getSparrowAtlas('weeb/animatedEvilSchool');
|
||||
bg.animation.addByPrefix('idle', 'background 2', 24);
|
||||
bg.animation.play('idle');
|
||||
bg.scrollFactor.set(0.8, 0.9);
|
||||
|
@ -436,13 +442,13 @@ class PlayState extends MusicBeatState
|
|||
add(bg);
|
||||
|
||||
/*
|
||||
var bg:FlxSprite = new FlxSprite(posX, posY).loadGraphic('assets/images/weeb/evilSchoolBG.png');
|
||||
var bg:FlxSprite = new FlxSprite(posX, posY).loadGraphic(Paths.image('weeb/evilSchoolBG'));
|
||||
bg.scale.set(6, 6);
|
||||
// bg.setGraphicSize(Std.int(bg.width * 6));
|
||||
// bg.updateHitbox();
|
||||
add(bg);
|
||||
|
||||
var fg:FlxSprite = new FlxSprite(posX, posY).loadGraphic('assets/images/weeb/evilSchoolFG.png');
|
||||
var fg:FlxSprite = new FlxSprite(posX, posY).loadGraphic(Paths.image('weeb/evilSchoolFG'));
|
||||
fg.scale.set(6, 6);
|
||||
// fg.setGraphicSize(Std.int(fg.width * 6));
|
||||
// fg.updateHitbox();
|
||||
|
@ -483,15 +489,13 @@ class PlayState extends MusicBeatState
|
|||
{
|
||||
defaultCamZoom = 0.9;
|
||||
curStage = 'stage';
|
||||
var bg:FlxSprite = new FlxSprite(-600, -200).loadGraphic('assets/images/stageback.png');
|
||||
// bg.setGraphicSize(Std.int(bg.width * 2.5));
|
||||
// bg.updateHitbox();
|
||||
var bg:FlxSprite = new FlxSprite(-600, -200).loadGraphic(Paths.image('stageback'));
|
||||
bg.antialiasing = true;
|
||||
bg.scrollFactor.set(0.9, 0.9);
|
||||
bg.active = false;
|
||||
add(bg);
|
||||
|
||||
var stageFront:FlxSprite = new FlxSprite(-650, 600).loadGraphic('assets/images/stagefront.png');
|
||||
var stageFront:FlxSprite = new FlxSprite(-650, 600).loadGraphic(Paths.image('stagefront'));
|
||||
stageFront.setGraphicSize(Std.int(stageFront.width * 1.1));
|
||||
stageFront.updateHitbox();
|
||||
stageFront.antialiasing = true;
|
||||
|
@ -499,7 +503,7 @@ class PlayState extends MusicBeatState
|
|||
stageFront.active = false;
|
||||
add(stageFront);
|
||||
|
||||
var stageCurtains:FlxSprite = new FlxSprite(-500, -300).loadGraphic('assets/images/stagecurtains.png');
|
||||
var stageCurtains:FlxSprite = new FlxSprite(-500, -300).loadGraphic(Paths.image('stagecurtains'));
|
||||
stageCurtains.setGraphicSize(Std.int(stageCurtains.width * 0.9));
|
||||
stageCurtains.updateHitbox();
|
||||
stageCurtains.antialiasing = true;
|
||||
|
@ -515,9 +519,7 @@ class PlayState extends MusicBeatState
|
|||
{
|
||||
case 'limo':
|
||||
gfVersion = 'gf-car';
|
||||
case 'mall':
|
||||
gfVersion = 'gf-christmas';
|
||||
case 'mallEvil':
|
||||
case 'mall' | 'mallEvil':
|
||||
gfVersion = 'gf-christmas';
|
||||
case 'school':
|
||||
gfVersion = 'gf-pixel';
|
||||
|
@ -531,10 +533,6 @@ class PlayState extends MusicBeatState
|
|||
gf = new Character(400, 130, gfVersion);
|
||||
gf.scrollFactor.set(0.95, 0.95);
|
||||
|
||||
// Shitty layering but whatev it works LOL
|
||||
if (curStage == 'limo')
|
||||
add(limo);
|
||||
|
||||
dad = new Character(100, 100, SONG.player2);
|
||||
|
||||
var camPos:FlxPoint = new FlxPoint(dad.getGraphicMidpoint().x, dad.getGraphicMidpoint().y);
|
||||
|
@ -616,6 +614,11 @@ class PlayState extends MusicBeatState
|
|||
}
|
||||
|
||||
add(gf);
|
||||
|
||||
// Shitty layering but whatev it works LOL
|
||||
if (curStage == 'limo')
|
||||
add(limo);
|
||||
|
||||
add(dad);
|
||||
add(boyfriend);
|
||||
|
||||
|
@ -662,7 +665,7 @@ class PlayState extends MusicBeatState
|
|||
|
||||
FlxG.fixedTimestep = false;
|
||||
|
||||
healthBarBG = new FlxSprite(0, FlxG.height * 0.9).loadGraphic('assets/images/healthBar.png');
|
||||
healthBarBG = new FlxSprite(0, FlxG.height * 0.9).loadGraphic(Paths.image('healthBar'));
|
||||
healthBarBG.screenCenter(X);
|
||||
healthBarBG.scrollFactor.set();
|
||||
add(healthBarBG);
|
||||
|
@ -675,7 +678,7 @@ class PlayState extends MusicBeatState
|
|||
add(healthBar);
|
||||
|
||||
scoreTxt = new FlxText(healthBarBG.x + healthBarBG.width - 190, healthBarBG.y + 30, 0, "", 20);
|
||||
scoreTxt.setFormat("assets/fonts/vcr.ttf", 16, FlxColor.WHITE, RIGHT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
|
||||
scoreTxt.setFormat(Paths.font("vcr.ttf"), 16, FlxColor.WHITE, RIGHT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
|
||||
scoreTxt.scrollFactor.set();
|
||||
add(scoreTxt);
|
||||
|
||||
|
@ -716,7 +719,7 @@ class PlayState extends MusicBeatState
|
|||
new FlxTimer().start(0.1, function(tmr:FlxTimer)
|
||||
{
|
||||
remove(blackScreen);
|
||||
FlxG.sound.play('assets/sounds/Lights_Turn_On' + TitleState.soundExt);
|
||||
FlxG.sound.play(Paths.sound('Lights_Turn_On'));
|
||||
camFollow.y = -2050;
|
||||
camFollow.x += 200;
|
||||
FlxG.camera.focusOn(camFollow.getPosition());
|
||||
|
@ -738,7 +741,7 @@ class PlayState extends MusicBeatState
|
|||
case 'senpai':
|
||||
schoolIntro(doof);
|
||||
case 'roses':
|
||||
FlxG.sound.play('assets/sounds/ANGRY' + TitleState.soundExt);
|
||||
FlxG.sound.play(Paths.sound('ANGRY'));
|
||||
schoolIntro(doof);
|
||||
case 'thorns':
|
||||
schoolIntro(doof);
|
||||
|
@ -768,9 +771,10 @@ class PlayState extends MusicBeatState
|
|||
red.scrollFactor.set();
|
||||
|
||||
var senpaiEvil:FlxSprite = new FlxSprite();
|
||||
senpaiEvil.frames = FlxAtlasFrames.fromSparrow('assets/images/weeb/senpaiCrazy.png', 'assets/images/weeb/senpaiCrazy.xml');
|
||||
senpaiEvil.frames = Paths.getSparrowAtlas('weeb/senpaiCrazy');
|
||||
senpaiEvil.animation.addByPrefix('idle', 'Senpai Pre Explosion', 24, false);
|
||||
senpaiEvil.setGraphicSize(Std.int(senpaiEvil.width * 6));
|
||||
senpaiEvil.scrollFactor.set();
|
||||
senpaiEvil.updateHitbox();
|
||||
senpaiEvil.screenCenter();
|
||||
|
||||
|
@ -812,7 +816,7 @@ class PlayState extends MusicBeatState
|
|||
else
|
||||
{
|
||||
senpaiEvil.animation.play('idle');
|
||||
FlxG.sound.play('assets/sounds/Senpai_Dies' + TitleState.soundExt, 1, false, null, true, function()
|
||||
FlxG.sound.play(Paths.sound('Senpai_Dies'), 1, false, null, true, function()
|
||||
{
|
||||
remove(senpaiEvil);
|
||||
remove(red);
|
||||
|
@ -865,16 +869,16 @@ class PlayState extends MusicBeatState
|
|||
boyfriend.playAnim('idle');
|
||||
|
||||
var introAssets:Map<String, Array<String>> = new Map<String, Array<String>>();
|
||||
introAssets.set('default', ['ready.png', "set.png", "go.png"]);
|
||||
introAssets.set('default', ['ready', "set", "go"]);
|
||||
introAssets.set('school', [
|
||||
'weeb/pixelUI/ready-pixel.png',
|
||||
'weeb/pixelUI/set-pixel.png',
|
||||
'weeb/pixelUI/date-pixel.png'
|
||||
'weeb/pixelUI/ready-pixel',
|
||||
'weeb/pixelUI/set-pixel',
|
||||
'weeb/pixelUI/date-pixel'
|
||||
]);
|
||||
introAssets.set('schoolEvil', [
|
||||
'weeb/pixelUI/ready-pixel.png',
|
||||
'weeb/pixelUI/set-pixel.png',
|
||||
'weeb/pixelUI/date-pixel.png'
|
||||
'weeb/pixelUI/ready-pixel',
|
||||
'weeb/pixelUI/set-pixel',
|
||||
'weeb/pixelUI/date-pixel'
|
||||
]);
|
||||
|
||||
var introAlts:Array<String> = introAssets.get('default');
|
||||
|
@ -893,9 +897,9 @@ class PlayState extends MusicBeatState
|
|||
|
||||
{
|
||||
case 0:
|
||||
FlxG.sound.play('assets/sounds/intro3' + altSuffix + TitleState.soundExt, 0.6);
|
||||
FlxG.sound.play(Paths.sound('intro3'), 0.6);
|
||||
case 1:
|
||||
var ready:FlxSprite = new FlxSprite().loadGraphic('assets/images/' + introAlts[0]);
|
||||
var ready:FlxSprite = new FlxSprite().loadGraphic(Paths.image(introAlts[0]));
|
||||
ready.scrollFactor.set();
|
||||
ready.updateHitbox();
|
||||
|
||||
|
@ -911,9 +915,9 @@ class PlayState extends MusicBeatState
|
|||
ready.destroy();
|
||||
}
|
||||
});
|
||||
FlxG.sound.play('assets/sounds/intro2' + altSuffix + TitleState.soundExt, 0.6);
|
||||
FlxG.sound.play(Paths.sound('intro2'), 0.6);
|
||||
case 2:
|
||||
var set:FlxSprite = new FlxSprite().loadGraphic('assets/images/' + introAlts[1]);
|
||||
var set:FlxSprite = new FlxSprite().loadGraphic(Paths.image(introAlts[1]));
|
||||
set.scrollFactor.set();
|
||||
|
||||
if (curStage.startsWith('school'))
|
||||
|
@ -928,9 +932,9 @@ class PlayState extends MusicBeatState
|
|||
set.destroy();
|
||||
}
|
||||
});
|
||||
FlxG.sound.play('assets/sounds/intro1' + altSuffix + TitleState.soundExt, 0.6);
|
||||
FlxG.sound.play(Paths.sound('intro1'), 0.6);
|
||||
case 3:
|
||||
var go:FlxSprite = new FlxSprite().loadGraphic('assets/images/' + introAlts[2]);
|
||||
var go:FlxSprite = new FlxSprite().loadGraphic(Paths.image(introAlts[2]));
|
||||
go.scrollFactor.set();
|
||||
|
||||
if (curStage.startsWith('school'))
|
||||
|
@ -947,7 +951,7 @@ class PlayState extends MusicBeatState
|
|||
go.destroy();
|
||||
}
|
||||
});
|
||||
FlxG.sound.play('assets/sounds/introGo' + altSuffix + TitleState.soundExt, 0.6);
|
||||
FlxG.sound.play(Paths.sound('introGo'), 0.6);
|
||||
case 4:
|
||||
}
|
||||
|
||||
|
@ -968,7 +972,7 @@ class PlayState extends MusicBeatState
|
|||
lastReportedPlayheadPosition = 0;
|
||||
|
||||
if (!paused)
|
||||
FlxG.sound.playMusic("assets/music/" + SONG.song + "_Inst" + TitleState.soundExt, 1, false);
|
||||
FlxG.sound.playMusic(Paths.inst(PlayState.SONG.song), 1, false);
|
||||
FlxG.sound.music.onComplete = endSong;
|
||||
vocals.play();
|
||||
}
|
||||
|
@ -985,7 +989,7 @@ class PlayState extends MusicBeatState
|
|||
curSong = songData.song;
|
||||
|
||||
if (SONG.needsVoices)
|
||||
vocals = new FlxSound().loadEmbedded("assets/music/" + curSong + "_Voices" + TitleState.soundExt);
|
||||
vocals = new FlxSound().loadEmbedded(Paths.voices(PlayState.SONG.song));
|
||||
else
|
||||
vocals = new FlxSound();
|
||||
|
||||
|
@ -1084,8 +1088,8 @@ class PlayState extends MusicBeatState
|
|||
|
||||
switch (curStage)
|
||||
{
|
||||
case 'school':
|
||||
babyArrow.loadGraphic('assets/images/weeb/pixelUI/arrows-pixels.png', true, 17, 17);
|
||||
case 'school' | 'schoolEvil':
|
||||
babyArrow.loadGraphic(Paths.image('weeb/pixelUI/arrows-pixels'), true, 17, 17);
|
||||
babyArrow.animation.add('green', [6]);
|
||||
babyArrow.animation.add('red', [7]);
|
||||
babyArrow.animation.add('blue', [5]);
|
||||
|
@ -1097,6 +1101,16 @@ class PlayState extends MusicBeatState
|
|||
|
||||
switch (Math.abs(i))
|
||||
{
|
||||
case 0:
|
||||
babyArrow.x += Note.swagWidth * 0;
|
||||
babyArrow.animation.add('static', [0]);
|
||||
babyArrow.animation.add('pressed', [4, 8], 12, false);
|
||||
babyArrow.animation.add('confirm', [12, 16], 24, false);
|
||||
case 1:
|
||||
babyArrow.x += Note.swagWidth * 1;
|
||||
babyArrow.animation.add('static', [1]);
|
||||
babyArrow.animation.add('pressed', [5, 9], 12, false);
|
||||
babyArrow.animation.add('confirm', [13, 17], 24, false);
|
||||
case 2:
|
||||
babyArrow.x += Note.swagWidth * 2;
|
||||
babyArrow.animation.add('static', [2]);
|
||||
|
@ -1107,57 +1121,10 @@ class PlayState extends MusicBeatState
|
|||
babyArrow.animation.add('static', [3]);
|
||||
babyArrow.animation.add('pressed', [7, 11], 12, false);
|
||||
babyArrow.animation.add('confirm', [15, 19], 24, false);
|
||||
case 1:
|
||||
babyArrow.x += Note.swagWidth * 1;
|
||||
babyArrow.animation.add('static', [1]);
|
||||
babyArrow.animation.add('pressed', [5, 9], 12, false);
|
||||
babyArrow.animation.add('confirm', [13, 17], 24, false);
|
||||
case 0:
|
||||
babyArrow.x += Note.swagWidth * 0;
|
||||
babyArrow.animation.add('static', [0]);
|
||||
babyArrow.animation.add('pressed', [4, 8], 12, false);
|
||||
babyArrow.animation.add('confirm', [12, 16], 24, false);
|
||||
}
|
||||
|
||||
case 'schoolEvil':
|
||||
// ALL THIS IS COPY PASTED CUZ IM LAZY
|
||||
|
||||
babyArrow.loadGraphic('assets/images/weeb/pixelUI/arrows-pixels.png', true, 17, 17);
|
||||
babyArrow.animation.add('green', [6]);
|
||||
babyArrow.animation.add('red', [7]);
|
||||
babyArrow.animation.add('blue', [5]);
|
||||
babyArrow.animation.add('purplel', [4]);
|
||||
|
||||
babyArrow.setGraphicSize(Std.int(babyArrow.width * daPixelZoom));
|
||||
babyArrow.updateHitbox();
|
||||
babyArrow.antialiasing = false;
|
||||
|
||||
switch (Math.abs(i))
|
||||
{
|
||||
case 2:
|
||||
babyArrow.x += Note.swagWidth * 2;
|
||||
babyArrow.animation.add('static', [2]);
|
||||
babyArrow.animation.add('pressed', [6, 10], 12, false);
|
||||
babyArrow.animation.add('confirm', [14, 18], 12, false);
|
||||
case 3:
|
||||
babyArrow.x += Note.swagWidth * 3;
|
||||
babyArrow.animation.add('static', [3]);
|
||||
babyArrow.animation.add('pressed', [7, 11], 12, false);
|
||||
babyArrow.animation.add('confirm', [15, 19], 24, false);
|
||||
case 1:
|
||||
babyArrow.x += Note.swagWidth * 1;
|
||||
babyArrow.animation.add('static', [1]);
|
||||
babyArrow.animation.add('pressed', [5, 9], 12, false);
|
||||
babyArrow.animation.add('confirm', [13, 17], 24, false);
|
||||
case 0:
|
||||
babyArrow.x += Note.swagWidth * 0;
|
||||
babyArrow.animation.add('static', [0]);
|
||||
babyArrow.animation.add('pressed', [4, 8], 12, false);
|
||||
babyArrow.animation.add('confirm', [12, 16], 24, false);
|
||||
}
|
||||
|
||||
default:
|
||||
babyArrow.frames = FlxAtlasFrames.fromSparrow('assets/images/NOTE_assets.png', 'assets/images/NOTE_assets.xml');
|
||||
babyArrow.frames = Paths.getSparrowAtlas('NOTE_assets');
|
||||
babyArrow.animation.addByPrefix('green', 'arrowUP');
|
||||
babyArrow.animation.addByPrefix('blue', 'arrowDOWN');
|
||||
babyArrow.animation.addByPrefix('purple', 'arrowLEFT');
|
||||
|
@ -1168,6 +1135,16 @@ class PlayState extends MusicBeatState
|
|||
|
||||
switch (Math.abs(i))
|
||||
{
|
||||
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);
|
||||
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 2:
|
||||
babyArrow.x += Note.swagWidth * 2;
|
||||
babyArrow.animation.addByPrefix('static', 'arrowUP');
|
||||
|
@ -1178,25 +1155,18 @@ class PlayState extends MusicBeatState
|
|||
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 = 0;
|
||||
FlxTween.tween(babyArrow, {y: babyArrow.y + 10, alpha: 1}, 1, {ease: FlxEase.circOut, startDelay: 0.5 + (0.2 * i)});
|
||||
if (!isStoryMode)
|
||||
{
|
||||
babyArrow.y -= 10;
|
||||
babyArrow.alpha = 0;
|
||||
FlxTween.tween(babyArrow, {y: babyArrow.y + 10, alpha: 1}, 1, {ease: FlxEase.circOut, startDelay: 0.5 + (0.2 * i)});
|
||||
}
|
||||
|
||||
babyArrow.ID = i;
|
||||
|
||||
|
@ -1306,7 +1276,14 @@ class PlayState extends MusicBeatState
|
|||
persistentDraw = true;
|
||||
paused = true;
|
||||
|
||||
openSubState(new PauseSubState(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));
|
||||
// 1 / 1000 chance for Gitaroo Man easter egg
|
||||
if (FlxG.random.bool(0.1))
|
||||
{
|
||||
// gitaroo man easter egg
|
||||
FlxG.switchState(new GitarooPause());
|
||||
}
|
||||
else
|
||||
openSubState(new PauseSubState(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));
|
||||
}
|
||||
|
||||
if (FlxG.keys.justPressed.SEVEN)
|
||||
|
@ -1445,11 +1422,12 @@ class PlayState extends MusicBeatState
|
|||
camHUD.zoom = FlxMath.lerp(1, camHUD.zoom, 0.95);
|
||||
}
|
||||
|
||||
FlxG.watch.addQuick("beatShit", totalBeats);
|
||||
FlxG.watch.addQuick("beatShit", curBeat);
|
||||
FlxG.watch.addQuick("stepShit", curStep);
|
||||
|
||||
if (curSong == 'Fresh')
|
||||
{
|
||||
switch (totalBeats)
|
||||
switch (curBeat)
|
||||
{
|
||||
case 16:
|
||||
camZooming = true;
|
||||
|
@ -1468,7 +1446,7 @@ class PlayState extends MusicBeatState
|
|||
|
||||
if (curSong == 'Bopeebo')
|
||||
{
|
||||
switch (totalBeats)
|
||||
switch (curBeat)
|
||||
{
|
||||
case 128, 129, 130:
|
||||
vocals.volume = 0;
|
||||
|
@ -1535,6 +1513,20 @@ class PlayState extends MusicBeatState
|
|||
daNote.active = true;
|
||||
}
|
||||
|
||||
daNote.y = (strumLine.y - (Conductor.songPosition - daNote.strumTime) * (0.45 * FlxMath.roundDecimal(SONG.speed, 2)));
|
||||
|
||||
// i am so fucking sorry for this if condition
|
||||
if (daNote.isSustainNote
|
||||
&& daNote.y + daNote.offset.y <= strumLine.y + Note.swagWidth / 2
|
||||
&& (!daNote.mustPress || (daNote.wasGoodHit || (daNote.prevNote.wasGoodHit && !daNote.canBeHit))))
|
||||
{
|
||||
var swagRect = new FlxRect(0, strumLine.y + Note.swagWidth / 2 - daNote.y, daNote.width * 2, daNote.height * 2);
|
||||
swagRect.y /= daNote.scale.y;
|
||||
swagRect.height -= swagRect.y;
|
||||
|
||||
daNote.clipRect = swagRect;
|
||||
}
|
||||
|
||||
if (!daNote.mustPress && daNote.wasGoodHit)
|
||||
{
|
||||
if (SONG.song != 'Tutorial')
|
||||
|
@ -1548,18 +1540,16 @@ class PlayState extends MusicBeatState
|
|||
altAnim = '-alt';
|
||||
}
|
||||
|
||||
trace("DA ALT THO?: " + SONG.notes[Math.floor(curStep / 16)].altAnim);
|
||||
|
||||
switch (Math.abs(daNote.noteData))
|
||||
{
|
||||
case 0:
|
||||
dad.playAnim('singLEFT' + altAnim, true);
|
||||
case 1:
|
||||
dad.playAnim('singDOWN' + altAnim, true);
|
||||
case 2:
|
||||
dad.playAnim('singUP' + altAnim, true);
|
||||
case 3:
|
||||
dad.playAnim('singRIGHT' + altAnim, true);
|
||||
case 1:
|
||||
dad.playAnim('singDOWN' + altAnim, true);
|
||||
case 0:
|
||||
dad.playAnim('singLEFT' + altAnim, true);
|
||||
}
|
||||
|
||||
dad.holdTimer = 0;
|
||||
|
@ -1572,8 +1562,6 @@ class PlayState extends MusicBeatState
|
|||
daNote.destroy();
|
||||
}
|
||||
|
||||
daNote.y = (strumLine.y - (Conductor.songPosition - daNote.strumTime) * (0.45 * FlxMath.roundDecimal(PlayState.SONG.speed, 2)));
|
||||
|
||||
// WIP interpolation shit? Need to fix the pause issue
|
||||
// daNote.y = (strumLine.y - (songTime - daNote.strumTime) * (0.45 * PlayState.SONG.speed));
|
||||
|
||||
|
@ -1624,7 +1612,10 @@ class PlayState extends MusicBeatState
|
|||
|
||||
if (storyPlaylist.length <= 0)
|
||||
{
|
||||
FlxG.sound.playMusic('assets/music/freakyMenu' + TitleState.soundExt);
|
||||
FlxG.sound.playMusic(Paths.music('freakyMenu'));
|
||||
|
||||
transIn = FlxTransitionableState.defaultTransIn;
|
||||
transOut = FlxTransitionableState.defaultTransOut;
|
||||
|
||||
FlxG.switchState(new StoryMenuState());
|
||||
|
||||
|
@ -1661,23 +1652,17 @@ class PlayState extends MusicBeatState
|
|||
add(blackShit);
|
||||
camHUD.visible = false;
|
||||
|
||||
FlxG.sound.play('assets/sounds/Lights_Shut_off' + TitleState.soundExt);
|
||||
FlxG.sound.play(Paths.sound('Lights_Shut_off'));
|
||||
}
|
||||
|
||||
if (SONG.song.toLowerCase() == 'senpai')
|
||||
{
|
||||
transIn = null;
|
||||
transOut = null;
|
||||
prevCamFollow = camFollow;
|
||||
}
|
||||
FlxTransitionableState.skipNextTransIn = true;
|
||||
FlxTransitionableState.skipNextTransOut = true;
|
||||
prevCamFollow = camFollow;
|
||||
|
||||
PlayState.SONG = Song.loadFromJson(PlayState.storyPlaylist[0].toLowerCase() + difficulty, PlayState.storyPlaylist[0]);
|
||||
FlxG.sound.music.stop();
|
||||
|
||||
FlxG.switchState(new PlayState());
|
||||
|
||||
transIn = FlxTransitionableState.defaultTransIn;
|
||||
transOut = FlxTransitionableState.defaultTransOut;
|
||||
LoadingState.loadAndSwitchState(new PlayState());
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1742,7 +1727,7 @@ class PlayState extends MusicBeatState
|
|||
pixelShitPart2 = '-pixel';
|
||||
}
|
||||
|
||||
rating.loadGraphic('assets/images/' + pixelShitPart1 + daRating + pixelShitPart2 + ".png");
|
||||
rating.loadGraphic(Paths.image(pixelShitPart1 + daRating + pixelShitPart2));
|
||||
rating.screenCenter();
|
||||
rating.x = coolText.x - 40;
|
||||
rating.y -= 60;
|
||||
|
@ -1750,7 +1735,7 @@ class PlayState extends MusicBeatState
|
|||
rating.velocity.y -= FlxG.random.int(140, 175);
|
||||
rating.velocity.x -= FlxG.random.int(0, 10);
|
||||
|
||||
var comboSpr:FlxSprite = new FlxSprite().loadGraphic('assets/images/' + pixelShitPart1 + 'combo' + pixelShitPart2 + '.png');
|
||||
var comboSpr:FlxSprite = new FlxSprite().loadGraphic(Paths.image(pixelShitPart1 + 'combo' + pixelShitPart2));
|
||||
comboSpr.screenCenter();
|
||||
comboSpr.x = coolText.x;
|
||||
comboSpr.acceleration.y = 600;
|
||||
|
@ -1784,7 +1769,7 @@ class PlayState extends MusicBeatState
|
|||
var daLoop:Int = 0;
|
||||
for (i in seperatedScore)
|
||||
{
|
||||
var numScore:FlxSprite = new FlxSprite().loadGraphic('assets/images/' + pixelShitPart1 + 'num' + Std.int(i) + pixelShitPart2 + '.png');
|
||||
var numScore:FlxSprite = new FlxSprite().loadGraphic(Paths.image(pixelShitPart1 + 'num' + Std.int(i) + pixelShitPart2));
|
||||
numScore.screenCenter();
|
||||
numScore.x = coolText.x + (43 * daLoop) - 90;
|
||||
numScore.y += 80;
|
||||
|
@ -1874,7 +1859,7 @@ class PlayState extends MusicBeatState
|
|||
|
||||
notes.forEachAlive(function(daNote:Note)
|
||||
{
|
||||
if (daNote.canBeHit && daNote.mustPress && !daNote.tooLate)
|
||||
if (daNote.canBeHit && daNote.mustPress && !daNote.tooLate && !daNote.wasGoodHit)
|
||||
{
|
||||
// the sorting probably doesn't need to be in here? who cares lol
|
||||
possibleNotes.push(daNote);
|
||||
|
@ -1950,13 +1935,15 @@ class PlayState extends MusicBeatState
|
|||
if (upP || rightP || downP || leftP)
|
||||
noteCheck(leftP, daNote);
|
||||
}
|
||||
*/
|
||||
|
||||
//this is already done in noteCheck / goodNoteHit
|
||||
if (daNote.wasGoodHit)
|
||||
{
|
||||
daNote.kill();
|
||||
notes.remove(daNote, true);
|
||||
daNote.destroy();
|
||||
}
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1973,18 +1960,18 @@ class PlayState extends MusicBeatState
|
|||
switch (daNote.noteData)
|
||||
{
|
||||
// NOTES YOU ARE HOLDING
|
||||
case 0:
|
||||
if (left)
|
||||
goodNoteHit(daNote);
|
||||
case 1:
|
||||
if (down)
|
||||
goodNoteHit(daNote);
|
||||
case 2:
|
||||
if (up)
|
||||
goodNoteHit(daNote);
|
||||
case 3:
|
||||
if (right)
|
||||
goodNoteHit(daNote);
|
||||
case 1:
|
||||
if (down)
|
||||
goodNoteHit(daNote);
|
||||
case 0:
|
||||
if (left)
|
||||
goodNoteHit(daNote);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -2002,6 +1989,16 @@ class PlayState extends MusicBeatState
|
|||
{
|
||||
switch (spr.ID)
|
||||
{
|
||||
case 0:
|
||||
if (leftP && spr.animation.curAnim.name != 'confirm')
|
||||
spr.animation.play('pressed');
|
||||
if (leftR)
|
||||
spr.animation.play('static');
|
||||
case 1:
|
||||
if (downP && spr.animation.curAnim.name != 'confirm')
|
||||
spr.animation.play('pressed');
|
||||
if (downR)
|
||||
spr.animation.play('static');
|
||||
case 2:
|
||||
if (upP && spr.animation.curAnim.name != 'confirm')
|
||||
spr.animation.play('pressed');
|
||||
|
@ -2012,16 +2009,6 @@ class PlayState extends MusicBeatState
|
|||
spr.animation.play('pressed');
|
||||
if (rightR)
|
||||
spr.animation.play('static');
|
||||
case 1:
|
||||
if (downP && spr.animation.curAnim.name != 'confirm')
|
||||
spr.animation.play('pressed');
|
||||
if (downR)
|
||||
spr.animation.play('static');
|
||||
case 0:
|
||||
if (leftP && spr.animation.curAnim.name != 'confirm')
|
||||
spr.animation.play('pressed');
|
||||
if (leftR)
|
||||
spr.animation.play('static');
|
||||
}
|
||||
|
||||
if (spr.animation.curAnim.name == 'confirm' && !curStage.startsWith('school'))
|
||||
|
@ -2040,7 +2027,7 @@ class PlayState extends MusicBeatState
|
|||
if (!boyfriend.stunned)
|
||||
{
|
||||
health -= 0.04;
|
||||
if (combo > 5)
|
||||
if (combo > 5 && gf.animOffsets.exists('sad'))
|
||||
{
|
||||
gf.playAnim('sad');
|
||||
}
|
||||
|
@ -2048,8 +2035,8 @@ class PlayState extends MusicBeatState
|
|||
|
||||
songScore -= 10;
|
||||
|
||||
FlxG.sound.play('assets/sounds/missnote' + FlxG.random.int(1, 3) + TitleState.soundExt, FlxG.random.float(0.1, 0.2));
|
||||
// FlxG.sound.play('assets/sounds/missnote1' + TitleState.soundExt, 1, false);
|
||||
FlxG.sound.play(Paths.soundRandom('missnote', 1, 3), FlxG.random.float(0.1, 0.2));
|
||||
// FlxG.sound.play(Paths.sound('missnote1'), 1, false);
|
||||
// FlxG.log.add('played imss note');
|
||||
|
||||
boyfriend.stunned = true;
|
||||
|
@ -2062,14 +2049,14 @@ class PlayState extends MusicBeatState
|
|||
|
||||
switch (direction)
|
||||
{
|
||||
case 0:
|
||||
boyfriend.playAnim('singLEFTmiss', true);
|
||||
case 1:
|
||||
boyfriend.playAnim('singDOWNmiss', true);
|
||||
case 2:
|
||||
boyfriend.playAnim('singUPmiss', true);
|
||||
case 3:
|
||||
boyfriend.playAnim('singRIGHTmiss', true);
|
||||
case 1:
|
||||
boyfriend.playAnim('singDOWNmiss', true);
|
||||
case 0:
|
||||
boyfriend.playAnim('singLEFTmiss', true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2085,12 +2072,12 @@ class PlayState extends MusicBeatState
|
|||
|
||||
if (leftP)
|
||||
noteMiss(0);
|
||||
if (downP)
|
||||
noteMiss(1);
|
||||
if (upP)
|
||||
noteMiss(2);
|
||||
if (rightP)
|
||||
noteMiss(3);
|
||||
if (downP)
|
||||
noteMiss(1);
|
||||
}
|
||||
|
||||
function noteCheck(keyP:Bool, note:Note):Void
|
||||
|
@ -2120,14 +2107,14 @@ class PlayState extends MusicBeatState
|
|||
|
||||
switch (note.noteData)
|
||||
{
|
||||
case 0:
|
||||
boyfriend.playAnim('singLEFT', true);
|
||||
case 1:
|
||||
boyfriend.playAnim('singDOWN', true);
|
||||
case 2:
|
||||
boyfriend.playAnim('singUP', true);
|
||||
case 3:
|
||||
boyfriend.playAnim('singRIGHT', true);
|
||||
case 1:
|
||||
boyfriend.playAnim('singDOWN', true);
|
||||
case 0:
|
||||
boyfriend.playAnim('singLEFT', true);
|
||||
}
|
||||
|
||||
playerStrums.forEach(function(spr:FlxSprite)
|
||||
|
@ -2141,9 +2128,12 @@ class PlayState extends MusicBeatState
|
|||
note.wasGoodHit = true;
|
||||
vocals.volume = 1;
|
||||
|
||||
note.kill();
|
||||
notes.remove(note, true);
|
||||
note.destroy();
|
||||
if (!note.isSustainNote)
|
||||
{
|
||||
note.kill();
|
||||
notes.remove(note, true);
|
||||
note.destroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2159,7 +2149,7 @@ class PlayState extends MusicBeatState
|
|||
|
||||
function fastCarDrive()
|
||||
{
|
||||
FlxG.sound.play('assets/sounds/carPass' + FlxG.random.int(0, 1) + TitleState.soundExt, 0.7);
|
||||
FlxG.sound.play(Paths.soundRandom('carPass', 0, 1), 0.7);
|
||||
|
||||
fastCar.velocity.x = (FlxG.random.int(170, 220) / FlxG.elapsed) * 3;
|
||||
fastCarCanDrive = false;
|
||||
|
@ -2225,7 +2215,7 @@ class PlayState extends MusicBeatState
|
|||
|
||||
function lightningStrikeShit():Void
|
||||
{
|
||||
FlxG.sound.play('assets/sounds/thunder_' + FlxG.random.int(1, 2) + TitleState.soundExt);
|
||||
FlxG.sound.play(Paths.soundRandom('thunder_', 1, 2));
|
||||
halloweenBG.animation.play('lightning');
|
||||
|
||||
lightningStrikeBeat = curBeat;
|
||||
|
@ -2237,20 +2227,16 @@ class PlayState extends MusicBeatState
|
|||
|
||||
override function stepHit()
|
||||
{
|
||||
if (SONG.needsVoices)
|
||||
super.stepHit();
|
||||
if (FlxG.sound.music.time > Conductor.songPosition + 20 || FlxG.sound.music.time < Conductor.songPosition - 20)
|
||||
{
|
||||
if (vocals.time > Conductor.songPosition + 20 || vocals.time < Conductor.songPosition - 20)
|
||||
{
|
||||
resyncVocals();
|
||||
}
|
||||
resyncVocals();
|
||||
}
|
||||
|
||||
if (dad.curCharacter == 'spooky' && totalSteps % 4 == 2)
|
||||
if (dad.curCharacter == 'spooky' && curStep % 4 == 2)
|
||||
{
|
||||
// dad.dance();
|
||||
}
|
||||
|
||||
super.stepHit();
|
||||
}
|
||||
|
||||
var lightningStrikeBeat:Int = 0;
|
||||
|
@ -2258,7 +2244,6 @@ class PlayState extends MusicBeatState
|
|||
|
||||
override function beatHit()
|
||||
{
|
||||
wiggleShit.update(Conductor.crochet);
|
||||
super.beatHit();
|
||||
|
||||
if (generatedMusic)
|
||||
|
@ -2273,23 +2258,24 @@ class PlayState extends MusicBeatState
|
|||
Conductor.changeBPM(SONG.notes[Math.floor(curStep / 16)].bpm);
|
||||
FlxG.log.add('CHANGED BPM!');
|
||||
}
|
||||
else
|
||||
Conductor.changeBPM(SONG.bpm);
|
||||
// else
|
||||
// Conductor.changeBPM(SONG.bpm);
|
||||
|
||||
// Dad doesnt interupt his own notes
|
||||
if (SONG.notes[Math.floor(curStep / 16)].mustHitSection)
|
||||
dad.dance();
|
||||
}
|
||||
// FlxG.log.add('change bpm' + SONG.notes[Std.int(curStep / 16)].changeBPM);
|
||||
wiggleShit.update(Conductor.crochet);
|
||||
|
||||
// HARDCODING FOR MILF ZOOMS!
|
||||
if (curSong.toLowerCase() == 'milf' && curBeat >= 168 && curBeat <= 200 && camZooming && FlxG.camera.zoom < 1.35)
|
||||
if (curSong.toLowerCase() == 'milf' && curBeat >= 168 && curBeat < 200 && camZooming && FlxG.camera.zoom < 1.35)
|
||||
{
|
||||
FlxG.camera.zoom += 0.015;
|
||||
camHUD.zoom += 0.03;
|
||||
}
|
||||
|
||||
if (camZooming && FlxG.camera.zoom < 1.35 && totalBeats % 4 == 0)
|
||||
if (camZooming && FlxG.camera.zoom < 1.35 && curBeat % 4 == 0)
|
||||
{
|
||||
FlxG.camera.zoom += 0.015;
|
||||
camHUD.zoom += 0.03;
|
||||
|
@ -2301,7 +2287,7 @@ class PlayState extends MusicBeatState
|
|||
iconP1.updateHitbox();
|
||||
iconP2.updateHitbox();
|
||||
|
||||
if (totalBeats % gfSpeed == 0)
|
||||
if (curBeat % gfSpeed == 0)
|
||||
{
|
||||
gf.dance();
|
||||
}
|
||||
|
@ -2311,7 +2297,7 @@ class PlayState extends MusicBeatState
|
|||
boyfriend.playAnim('idle');
|
||||
}
|
||||
|
||||
if (totalBeats % 8 == 7 && curSong == 'Bopeebo')
|
||||
if (curBeat % 8 == 7 && curSong == 'Bopeebo')
|
||||
{
|
||||
boyfriend.playAnim('hey', true);
|
||||
|
||||
|
@ -2343,7 +2329,7 @@ class PlayState extends MusicBeatState
|
|||
if (!trainMoving)
|
||||
trainCooldown += 1;
|
||||
|
||||
if (totalBeats % 4 == 0)
|
||||
if (curBeat % 4 == 0)
|
||||
{
|
||||
phillyCityLights.forEach(function(light:FlxSprite)
|
||||
{
|
||||
|
@ -2356,7 +2342,7 @@ class PlayState extends MusicBeatState
|
|||
// phillyCityLights.members[curLight].alpha = 1;
|
||||
}
|
||||
|
||||
if (totalBeats % 8 == 4 && FlxG.random.bool(30) && !trainMoving && trainCooldown > 8)
|
||||
if (curBeat % 8 == 4 && FlxG.random.bool(30) && !trainMoving && trainCooldown > 8)
|
||||
{
|
||||
trainCooldown = FlxG.random.int(-4, 0);
|
||||
trainStart();
|
||||
|
|
|
@ -12,8 +12,6 @@ typedef SwagSong =
|
|||
var song:String;
|
||||
var notes:Array<SwagSection>;
|
||||
var bpm:Int;
|
||||
var sections:Int;
|
||||
var sectionLengths:Array<Dynamic>;
|
||||
var needsVoices:Bool;
|
||||
var speed:Float;
|
||||
|
||||
|
@ -27,30 +25,22 @@ class Song
|
|||
public var song:String;
|
||||
public var notes:Array<SwagSection>;
|
||||
public var bpm:Int;
|
||||
public var sections:Int;
|
||||
public var sectionLengths:Array<Dynamic> = [];
|
||||
public var needsVoices:Bool = true;
|
||||
public var speed:Float = 1;
|
||||
|
||||
public var player1:String = 'bf';
|
||||
public var player2:String = 'dad';
|
||||
|
||||
public function new(song, notes, bpm, sections)
|
||||
public function new(song, notes, bpm)
|
||||
{
|
||||
this.song = song;
|
||||
this.notes = notes;
|
||||
this.bpm = bpm;
|
||||
this.sections = sections;
|
||||
|
||||
for (i in 0...notes.length)
|
||||
{
|
||||
this.sectionLengths.push(notes[i]);
|
||||
}
|
||||
}
|
||||
|
||||
public static function loadFromJson(jsonInput:String, ?folder:String):SwagSong
|
||||
{
|
||||
var rawJson = Assets.getText('assets/data/' + folder.toLowerCase() + '/' + jsonInput.toLowerCase() + '.json').trim();
|
||||
var rawJson = Assets.getText(Paths.json(folder.toLowerCase() + '/' + jsonInput.toLowerCase())).trim();
|
||||
|
||||
while (!rawJson.endsWith("}"))
|
||||
{
|
||||
|
@ -72,9 +62,7 @@ class Song
|
|||
|
||||
daNotes = songData.notes;
|
||||
daSong = songData.song;
|
||||
daSections = songData.sections;
|
||||
daBpm = songData.bpm;
|
||||
daSectionLengths = songData.sectionLengths; */
|
||||
daBpm = songData.bpm; */
|
||||
|
||||
return parseJSONshit(rawJson);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package;
|
|||
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxSprite;
|
||||
import flixel.addons.transition.FlxTransitionableState;
|
||||
import flixel.graphics.frames.FlxAtlasFrames;
|
||||
import flixel.group.FlxGroup.FlxTypedGroup;
|
||||
import flixel.group.FlxGroup;
|
||||
|
@ -21,7 +22,7 @@ class StoryMenuState extends MusicBeatState
|
|||
var weekData:Array<Dynamic> = [
|
||||
['Tutorial'],
|
||||
['Bopeebo', 'Fresh', 'Dadbattle'],
|
||||
['Spookeez', 'South'],
|
||||
['Spookeez', 'South', "Monster"],
|
||||
['Pico', 'Philly', "Blammed"],
|
||||
['Satin-Panties', "High", "Milf"],
|
||||
['Cocoa', 'Eggnog', 'Winter-Horrorland'],
|
||||
|
@ -69,10 +70,13 @@ class StoryMenuState extends MusicBeatState
|
|||
|
||||
override function create()
|
||||
{
|
||||
transIn = FlxTransitionableState.defaultTransIn;
|
||||
transOut = FlxTransitionableState.defaultTransOut;
|
||||
|
||||
if (FlxG.sound.music != null)
|
||||
{
|
||||
if (!FlxG.sound.music.playing)
|
||||
FlxG.sound.playMusic('assets/music/freakyMenu' + TitleState.soundExt);
|
||||
FlxG.sound.playMusic(Paths.music('freakyMenu'));
|
||||
}
|
||||
|
||||
persistentUpdate = persistentDraw = true;
|
||||
|
@ -86,11 +90,11 @@ class StoryMenuState extends MusicBeatState
|
|||
|
||||
var rankText:FlxText = new FlxText(0, 10);
|
||||
rankText.text = 'RANK: GREAT';
|
||||
rankText.setFormat("assets/fonts/vcr.ttf", 32);
|
||||
rankText.setFormat(Paths.font("vcr.ttf"), 32);
|
||||
rankText.size = scoreText.size;
|
||||
rankText.screenCenter(X);
|
||||
|
||||
var ui_tex = FlxAtlasFrames.fromSparrow('assets/images/campaign_menu_UI_assets.png', 'assets/images/campaign_menu_UI_assets.xml');
|
||||
var ui_tex = Paths.getSparrowAtlas('campaign_menu_UI_assets');
|
||||
var yellowBG:FlxSprite = new FlxSprite(0, 56).makeGraphic(FlxG.width, 400, 0xFFF9CF51);
|
||||
|
||||
grpWeekText = new FlxTypedGroup<MenuItem>();
|
||||
|
@ -267,7 +271,7 @@ class StoryMenuState extends MusicBeatState
|
|||
|
||||
if (controls.BACK && !movedBack && !selectedWeek)
|
||||
{
|
||||
FlxG.sound.play('assets/sounds/cancelMenu' + TitleState.soundExt);
|
||||
FlxG.sound.play(Paths.sound('cancelMenu'));
|
||||
movedBack = true;
|
||||
FlxG.switchState(new MainMenuState());
|
||||
}
|
||||
|
@ -285,7 +289,7 @@ class StoryMenuState extends MusicBeatState
|
|||
{
|
||||
if (stopspamming == false)
|
||||
{
|
||||
FlxG.sound.play('assets/sounds/confirmMenu' + TitleState.soundExt);
|
||||
FlxG.sound.play(Paths.sound('confirmMenu'));
|
||||
|
||||
grpWeekText.members[curWeek].week.animation.resume();
|
||||
grpWeekCharacters.members[1].animation.play('bfConfirm');
|
||||
|
@ -313,9 +317,7 @@ class StoryMenuState extends MusicBeatState
|
|||
PlayState.campaignScore = 0;
|
||||
new FlxTimer().start(1, function(tmr:FlxTimer)
|
||||
{
|
||||
if (FlxG.sound.music != null)
|
||||
FlxG.sound.music.stop();
|
||||
FlxG.switchState(new PlayState());
|
||||
LoadingState.loadAndSwitchState(new PlayState(), true);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -381,7 +383,7 @@ class StoryMenuState extends MusicBeatState
|
|||
bullShit++;
|
||||
}
|
||||
|
||||
FlxG.sound.play('assets/sounds/scrollMenu' + TitleState.soundExt);
|
||||
FlxG.sound.play(Paths.sound('scrollMenu'));
|
||||
|
||||
updateText();
|
||||
}
|
||||
|
|
|
@ -23,14 +23,12 @@ import flixel.util.FlxTimer;
|
|||
import io.newgrounds.NG;
|
||||
import lime.app.Application;
|
||||
import openfl.Assets;
|
||||
import polymod.Polymod;
|
||||
|
||||
using StringTools;
|
||||
|
||||
class TitleState extends MusicBeatState
|
||||
{
|
||||
static var initialized:Bool = false;
|
||||
static public var soundExt:String = ".mp3";
|
||||
|
||||
var blackScreen:FlxSprite;
|
||||
var credGroup:FlxGroup;
|
||||
|
@ -44,12 +42,10 @@ class TitleState extends MusicBeatState
|
|||
|
||||
override public function create():Void
|
||||
{
|
||||
Polymod.init({modRoot: "mods", dirs: ['introMod']});
|
||||
|
||||
#if (!web)
|
||||
TitleState.soundExt = '.ogg';
|
||||
#if polymod
|
||||
polymod.Polymod.init({modRoot: "mods", dirs: ['introMod']});
|
||||
#end
|
||||
|
||||
|
||||
PlayerSettings.init();
|
||||
|
||||
curWacky = FlxG.random.getObject(getIntroTextShit());
|
||||
|
@ -88,7 +84,10 @@ class TitleState extends MusicBeatState
|
|||
#elseif CHARTING
|
||||
FlxG.switchState(new ChartingState());
|
||||
#else
|
||||
startIntro();
|
||||
new FlxTimer().start(1, function(tmr:FlxTimer)
|
||||
{
|
||||
startIntro();
|
||||
});
|
||||
#end
|
||||
}
|
||||
|
||||
|
@ -118,10 +117,10 @@ class TitleState extends MusicBeatState
|
|||
// https://github.com/HaxeFlixel/flixel-addons/pull/348
|
||||
|
||||
// var music:FlxSound = new FlxSound();
|
||||
// music.loadStream('assets/music/freakyMenu' + TitleState.soundExt);
|
||||
// music.loadStream(Paths.music('freakyMenu'));
|
||||
// FlxG.sound.list.add(music);
|
||||
// music.play();
|
||||
FlxG.sound.playMusic('assets/music/freakyMenu' + TitleState.soundExt, 0);
|
||||
FlxG.sound.playMusic(Paths.music('freakyMenu'), 0);
|
||||
|
||||
FlxG.sound.music.fadeIn(4, 0, 0.7);
|
||||
}
|
||||
|
@ -136,7 +135,7 @@ class TitleState extends MusicBeatState
|
|||
add(bg);
|
||||
|
||||
logoBl = new FlxSprite(-150, -100);
|
||||
logoBl.frames = FlxAtlasFrames.fromSparrow('assets/images/logoBumpin.png', 'assets/images/logoBumpin.xml');
|
||||
logoBl.frames = Paths.getSparrowAtlas('logoBumpin');
|
||||
logoBl.antialiasing = true;
|
||||
logoBl.animation.addByPrefix('bump', 'logo bumpin', 24);
|
||||
logoBl.animation.play('bump');
|
||||
|
@ -145,7 +144,7 @@ class TitleState extends MusicBeatState
|
|||
// logoBl.color = FlxColor.BLACK;
|
||||
|
||||
gfDance = new FlxSprite(FlxG.width * 0.4, FlxG.height * 0.07);
|
||||
gfDance.frames = FlxAtlasFrames.fromSparrow('assets/images/gfDanceTitle.png', 'assets/images/gfDanceTitle.xml');
|
||||
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);
|
||||
gfDance.antialiasing = true;
|
||||
|
@ -153,7 +152,7 @@ class TitleState extends MusicBeatState
|
|||
add(logoBl);
|
||||
|
||||
titleText = new FlxSprite(100, FlxG.height * 0.8);
|
||||
titleText.frames = FlxAtlasFrames.fromSparrow('assets/images/titleEnter.png', 'assets/images/titleEnter.xml');
|
||||
titleText.frames = Paths.getSparrowAtlas('titleEnter');
|
||||
titleText.animation.addByPrefix('idle', "Press Enter to Begin", 24);
|
||||
titleText.animation.addByPrefix('press', "ENTER PRESSED", 24);
|
||||
titleText.antialiasing = true;
|
||||
|
@ -162,7 +161,7 @@ class TitleState extends MusicBeatState
|
|||
// titleText.screenCenter(X);
|
||||
add(titleText);
|
||||
|
||||
var logo:FlxSprite = new FlxSprite().loadGraphic('assets/images/logo.png');
|
||||
var logo:FlxSprite = new FlxSprite().loadGraphic(Paths.image('logo'));
|
||||
logo.screenCenter();
|
||||
logo.antialiasing = true;
|
||||
// add(logo);
|
||||
|
@ -184,7 +183,7 @@ class TitleState extends MusicBeatState
|
|||
|
||||
credTextShit.visible = false;
|
||||
|
||||
ngSpr = new FlxSprite(0, FlxG.height * 0.52).loadGraphic('assets/images/newgrounds_logo.png');
|
||||
ngSpr = new FlxSprite(0, FlxG.height * 0.52).loadGraphic(Paths.image('newgrounds_logo'));
|
||||
add(ngSpr);
|
||||
ngSpr.visible = false;
|
||||
ngSpr.setGraphicSize(Std.int(ngSpr.width * 0.8));
|
||||
|
@ -206,7 +205,7 @@ class TitleState extends MusicBeatState
|
|||
|
||||
function getIntroTextShit():Array<Array<String>>
|
||||
{
|
||||
var fullText:String = Assets.getText('assets/data/introText.txt');
|
||||
var fullText:String = Assets.getText(Paths.txt('introText'));
|
||||
|
||||
var firstArray:Array<String> = fullText.split('\n');
|
||||
var swagGoodArray:Array<Array<String>> = [];
|
||||
|
@ -223,7 +222,8 @@ class TitleState extends MusicBeatState
|
|||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
Conductor.songPosition = FlxG.sound.music.time;
|
||||
if (FlxG.sound.music != null)
|
||||
Conductor.songPosition = FlxG.sound.music.time;
|
||||
// FlxG.watch.addQuick('amp', FlxG.sound.music.amplitude);
|
||||
|
||||
if (FlxG.keys.justPressed.F)
|
||||
|
@ -233,6 +233,16 @@ class TitleState extends MusicBeatState
|
|||
|
||||
var pressedEnter:Bool = FlxG.keys.justPressed.ENTER;
|
||||
|
||||
#if mobile
|
||||
for (touch in FlxG.touches.list)
|
||||
{
|
||||
if (touch.justPressed)
|
||||
{
|
||||
pressedEnter = true;
|
||||
}
|
||||
}
|
||||
#end
|
||||
|
||||
var gamepad:FlxGamepad = FlxG.gamepads.lastActive;
|
||||
|
||||
if (gamepad != null)
|
||||
|
@ -259,7 +269,7 @@ class TitleState extends MusicBeatState
|
|||
titleText.animation.play('press');
|
||||
|
||||
FlxG.camera.flash(FlxColor.WHITE, 1);
|
||||
FlxG.sound.play('assets/sounds/confirmMenu' + TitleState.soundExt, 0.7);
|
||||
FlxG.sound.play(Paths.sound('confirmMenu'), 0.7);
|
||||
|
||||
transitioning = true;
|
||||
// FlxG.sound.music.stop();
|
||||
|
@ -270,9 +280,13 @@ class TitleState extends MusicBeatState
|
|||
|
||||
var version:String = "v" + Application.current.meta.get('version');
|
||||
|
||||
if (version.trim() != NGio.GAME_VER.trim() && !OutdatedSubState.leftState)
|
||||
if (version.trim() != NGio.GAME_VER_NUMS.trim() && !OutdatedSubState.leftState)
|
||||
{
|
||||
trace('OLD VERSION!');
|
||||
trace('old ver');
|
||||
trace(version.trim());
|
||||
trace('cur ver');
|
||||
trace(NGio.GAME_VER_NUMS.trim());
|
||||
FlxG.switchState(new OutdatedSubState());
|
||||
}
|
||||
else
|
||||
|
@ -280,7 +294,7 @@ class TitleState extends MusicBeatState
|
|||
FlxG.switchState(new MainMenuState());
|
||||
}
|
||||
});
|
||||
// FlxG.sound.play('assets/music/titleShoot' + TitleState.soundExt, 0.7);
|
||||
// FlxG.sound.play(Paths.music('titleShoot'), 0.7);
|
||||
}
|
||||
|
||||
if (pressedEnter && !skippedIntro)
|
||||
|
|
1
source/import.hx
Normal file
1
source/import.hx
Normal file
|
@ -0,0 +1 @@
|
|||
import Paths;
|
Loading…
Reference in a new issue