diff --git a/Changelog.md b/Changelog.md new file mode 100644 index 0000000..8e57b04 --- /dev/null +++ b/Changelog.md @@ -0,0 +1,65 @@ +# 0.8.1 + +## Compiled files altered + +- DenpaEngine.exe +- assets/images/alphabet.png +- assets/images/alphabet.xml + +## Changelog + +### Additions + +- The Time Bar now has its own entering animation for normal and pixel stages. + +- Alphabet now supports the characters `¿`, `¡`, and `ñ`. + +### Improvements + +- Windows Builds now utilize DPI Awareness for higher fidelity visuals on resolutions greater than 1280x720. + +### Fixes + +- Freeplay vocals can no longer persist into PlayState. + +- Icon animations now all respect `gfSpeed`. + +- Ghost Tapping animations now consider whether the current section is a `gfSection`. + +- FlxBars no longer have choppy filling due to a rounding error. + +- FlxBars no longer incorrectly floor their percentage `Float` and now have a `roundedPercentage` value for the floored version. + +- Strums are now perfectly centered. + +- The Bold `(`, `)`, and `.` characters are no longer improperly offset when using the Alphabet class. + +- The Duet and Mirror Section buttons in the Charter now work properly on all key amounts. + +- Mod Maps now properly refresh where they should be. + +- Note splashes are no longer spawned in `popUpScore()` and will spawn if ratings are disabled for the note, but not notesplashes. + +- `popUpScore()` is no longer run when a note has its ratings disabled. + +### Optimizations + +- Note Spawning now `shift()`s instead of `splice()`ing. + +- Philly Glow Particles are now `recycle()`ed instead of recreated whenever a new one is needed. + +- Modifier indicators are now made with much more compact code that only adds the sprites if needed. + +- The majoroity of objects are now properly `remove()`ed and `destroy()`ed instead of `kill()`ed and `destroy()`ed, as `kill()`ing does nothing since it is immediately destroyed. + +- Text made using the Alphabet class now loads characters on demand, rather than loading a huge sprite sheet, which saves on RAM usage. + +- Crossfades are now `recycle()`ed rather than being made anew whenever one is needed. + +- The Discouragement Elevator track, and the bfBeep, scrollMenu, confirmMenu, and cancelMenu sound effects are no longer cleared from the cache, allowing for faster load times on the Manual, as well as not needing to reload the basic menu sounds every time you swap states. + +- Icons no longer load their graphic twice when changing icons. + +### Removals + +- N/A diff --git a/assets/preload/data/dialogue/TEST.json b/assets/preload/data/dialogue/TEST.json index a932395..ac074e5 100644 --- a/assets/preload/data/dialogue/TEST.json +++ b/assets/preload/data/dialogue/TEST.json @@ -2,7 +2,7 @@ "dialogue": [ { "expression": "talk", - "text": "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM\\nNOPQRSTUVWXYZ1234567890|~#&$%()*+-:;\\n<=>@[]^_.,'\"!?{}\\/×↑→←↓♥😡", + "text": "abcdefghijklmnñopqrstuvwxyzABCDEFGHIJK\\nLMNÑOPQRSTUVWXYZ1234567890|~#&$%()*\\n+-:;<=>@[]^_.,'\"!¡?¿{}\\/×↑→←↓♥😡", "boxState": "normal", "sound": "", "speed": 0.05, diff --git a/assets/preload/images/alphabet.png b/assets/preload/images/alphabet.png deleted file mode 100644 index e3d2b85..0000000 Binary files a/assets/preload/images/alphabet.png and /dev/null differ diff --git a/assets/preload/images/alphabet.xml b/assets/preload/images/alphabet.xml deleted file mode 100644 index b768dd7..0000000 --- a/assets/preload/images/alphabet.xml +++ /dev/null @@ -1,599 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/preload/images/alphabet/A BOLD.png b/assets/preload/images/alphabet/A BOLD.png new file mode 100644 index 0000000..c5ffce2 Binary files /dev/null and b/assets/preload/images/alphabet/A BOLD.png differ diff --git a/assets/preload/images/alphabet/A LOWERCASE.png b/assets/preload/images/alphabet/A LOWERCASE.png new file mode 100644 index 0000000..aff7a40 Binary files /dev/null and b/assets/preload/images/alphabet/A LOWERCASE.png differ diff --git a/assets/preload/images/alphabet/A.png b/assets/preload/images/alphabet/A.png new file mode 100644 index 0000000..eeaf749 Binary files /dev/null and b/assets/preload/images/alphabet/A.png differ diff --git a/assets/preload/images/alphabet/AMPERSAND BOLD.png b/assets/preload/images/alphabet/AMPERSAND BOLD.png new file mode 100644 index 0000000..1206757 Binary files /dev/null and b/assets/preload/images/alphabet/AMPERSAND BOLD.png differ diff --git a/assets/preload/images/alphabet/AMPERSAND.png b/assets/preload/images/alphabet/AMPERSAND.png new file mode 100644 index 0000000..08e902d Binary files /dev/null and b/assets/preload/images/alphabet/AMPERSAND.png differ diff --git a/assets/preload/images/alphabet/ANGRY FAIC.png b/assets/preload/images/alphabet/ANGRY FAIC.png new file mode 100644 index 0000000..ce7bc2e Binary files /dev/null and b/assets/preload/images/alphabet/ANGRY FAIC.png differ diff --git a/assets/preload/images/alphabet/APOSTROPHE BOLD.png b/assets/preload/images/alphabet/APOSTROPHE BOLD.png new file mode 100644 index 0000000..beb2952 Binary files /dev/null and b/assets/preload/images/alphabet/APOSTROPHE BOLD.png differ diff --git a/assets/preload/images/alphabet/APOSTROPHE.png b/assets/preload/images/alphabet/APOSTROPHE.png new file mode 100644 index 0000000..9a969b3 Binary files /dev/null and b/assets/preload/images/alphabet/APOSTROPHE.png differ diff --git a/assets/preload/images/alphabet/ASTERISK BOLD.png b/assets/preload/images/alphabet/ASTERISK BOLD.png new file mode 100644 index 0000000..ab72185 Binary files /dev/null and b/assets/preload/images/alphabet/ASTERISK BOLD.png differ diff --git a/assets/preload/images/alphabet/ASTERISK.png b/assets/preload/images/alphabet/ASTERISK.png new file mode 100644 index 0000000..fc39d27 Binary files /dev/null and b/assets/preload/images/alphabet/ASTERISK.png differ diff --git a/assets/preload/images/alphabet/AT.png b/assets/preload/images/alphabet/AT.png new file mode 100644 index 0000000..9c693a2 Binary files /dev/null and b/assets/preload/images/alphabet/AT.png differ diff --git a/assets/preload/images/alphabet/B BOLD.png b/assets/preload/images/alphabet/B BOLD.png new file mode 100644 index 0000000..e587dac Binary files /dev/null and b/assets/preload/images/alphabet/B BOLD.png differ diff --git a/assets/preload/images/alphabet/B LOWERCASE.png b/assets/preload/images/alphabet/B LOWERCASE.png new file mode 100644 index 0000000..692728d Binary files /dev/null and b/assets/preload/images/alphabet/B LOWERCASE.png differ diff --git a/assets/preload/images/alphabet/B.png b/assets/preload/images/alphabet/B.png new file mode 100644 index 0000000..e1735a8 Binary files /dev/null and b/assets/preload/images/alphabet/B.png differ diff --git a/assets/preload/images/alphabet/BACKSLASH.png b/assets/preload/images/alphabet/BACKSLASH.png new file mode 100644 index 0000000..282c7c3 Binary files /dev/null and b/assets/preload/images/alphabet/BACKSLASH.png differ diff --git a/assets/preload/images/alphabet/BAR.png b/assets/preload/images/alphabet/BAR.png new file mode 100644 index 0000000..739b1ee Binary files /dev/null and b/assets/preload/images/alphabet/BAR.png differ diff --git a/assets/preload/images/alphabet/C BOLD.png b/assets/preload/images/alphabet/C BOLD.png new file mode 100644 index 0000000..8a60170 Binary files /dev/null and b/assets/preload/images/alphabet/C BOLD.png differ diff --git a/assets/preload/images/alphabet/C LOWERCASE.png b/assets/preload/images/alphabet/C LOWERCASE.png new file mode 100644 index 0000000..4561a9b Binary files /dev/null and b/assets/preload/images/alphabet/C LOWERCASE.png differ diff --git a/assets/preload/images/alphabet/C.png b/assets/preload/images/alphabet/C.png new file mode 100644 index 0000000..bbd8f5b Binary files /dev/null and b/assets/preload/images/alphabet/C.png differ diff --git a/assets/preload/images/alphabet/CARROT.png b/assets/preload/images/alphabet/CARROT.png new file mode 100644 index 0000000..d998733 Binary files /dev/null and b/assets/preload/images/alphabet/CARROT.png differ diff --git a/assets/preload/images/alphabet/COLON.png b/assets/preload/images/alphabet/COLON.png new file mode 100644 index 0000000..26049f2 Binary files /dev/null and b/assets/preload/images/alphabet/COLON.png differ diff --git a/assets/preload/images/alphabet/COMMA.png b/assets/preload/images/alphabet/COMMA.png new file mode 100644 index 0000000..891cfbd Binary files /dev/null and b/assets/preload/images/alphabet/COMMA.png differ diff --git a/assets/preload/images/alphabet/D BOLD.png b/assets/preload/images/alphabet/D BOLD.png new file mode 100644 index 0000000..6579899 Binary files /dev/null and b/assets/preload/images/alphabet/D BOLD.png differ diff --git a/assets/preload/images/alphabet/D LOWERCASE.png b/assets/preload/images/alphabet/D LOWERCASE.png new file mode 100644 index 0000000..13f7181 Binary files /dev/null and b/assets/preload/images/alphabet/D LOWERCASE.png differ diff --git a/assets/preload/images/alphabet/D.png b/assets/preload/images/alphabet/D.png new file mode 100644 index 0000000..5cf56c9 Binary files /dev/null and b/assets/preload/images/alphabet/D.png differ diff --git a/assets/preload/images/alphabet/DASH BOLD.png b/assets/preload/images/alphabet/DASH BOLD.png new file mode 100644 index 0000000..4930cbd Binary files /dev/null and b/assets/preload/images/alphabet/DASH BOLD.png differ diff --git a/assets/preload/images/alphabet/DASH.png b/assets/preload/images/alphabet/DASH.png new file mode 100644 index 0000000..70c5bdd Binary files /dev/null and b/assets/preload/images/alphabet/DASH.png differ diff --git a/assets/preload/images/alphabet/DBL QUOTE END BOLD.png b/assets/preload/images/alphabet/DBL QUOTE END BOLD.png new file mode 100644 index 0000000..c76c6bd Binary files /dev/null and b/assets/preload/images/alphabet/DBL QUOTE END BOLD.png differ diff --git a/assets/preload/images/alphabet/DBL QUOTE END.png b/assets/preload/images/alphabet/DBL QUOTE END.png new file mode 100644 index 0000000..f743a6a Binary files /dev/null and b/assets/preload/images/alphabet/DBL QUOTE END.png differ diff --git a/assets/preload/images/alphabet/DBL QUOTE START BOLD.png b/assets/preload/images/alphabet/DBL QUOTE START BOLD.png new file mode 100644 index 0000000..d18f886 Binary files /dev/null and b/assets/preload/images/alphabet/DBL QUOTE START BOLD.png differ diff --git a/assets/preload/images/alphabet/DBL QUOTE START.png b/assets/preload/images/alphabet/DBL QUOTE START.png new file mode 100644 index 0000000..1f03dfa Binary files /dev/null and b/assets/preload/images/alphabet/DBL QUOTE START.png differ diff --git a/assets/preload/images/alphabet/DOLLAR.png b/assets/preload/images/alphabet/DOLLAR.png new file mode 100644 index 0000000..4323097 Binary files /dev/null and b/assets/preload/images/alphabet/DOLLAR.png differ diff --git a/assets/preload/images/alphabet/DOWN ARROW.png b/assets/preload/images/alphabet/DOWN ARROW.png new file mode 100644 index 0000000..6e9856e Binary files /dev/null and b/assets/preload/images/alphabet/DOWN ARROW.png differ diff --git a/assets/preload/images/alphabet/E BOLD.png b/assets/preload/images/alphabet/E BOLD.png new file mode 100644 index 0000000..04df9fd Binary files /dev/null and b/assets/preload/images/alphabet/E BOLD.png differ diff --git a/assets/preload/images/alphabet/E LOWERCASE.png b/assets/preload/images/alphabet/E LOWERCASE.png new file mode 100644 index 0000000..ea5f6c4 Binary files /dev/null and b/assets/preload/images/alphabet/E LOWERCASE.png differ diff --git a/assets/preload/images/alphabet/E.png b/assets/preload/images/alphabet/E.png new file mode 100644 index 0000000..c66a740 Binary files /dev/null and b/assets/preload/images/alphabet/E.png differ diff --git a/assets/preload/images/alphabet/EIGHT BOLD.png b/assets/preload/images/alphabet/EIGHT BOLD.png new file mode 100644 index 0000000..cf868bd Binary files /dev/null and b/assets/preload/images/alphabet/EIGHT BOLD.png differ diff --git a/assets/preload/images/alphabet/EIGHT.png b/assets/preload/images/alphabet/EIGHT.png new file mode 100644 index 0000000..9d99a2d Binary files /dev/null and b/assets/preload/images/alphabet/EIGHT.png differ diff --git a/assets/preload/images/alphabet/ENE BOLD.png b/assets/preload/images/alphabet/ENE BOLD.png new file mode 100644 index 0000000..3302e98 Binary files /dev/null and b/assets/preload/images/alphabet/ENE BOLD.png differ diff --git a/assets/preload/images/alphabet/ENE LOWERCASE.png b/assets/preload/images/alphabet/ENE LOWERCASE.png new file mode 100644 index 0000000..d1fe213 Binary files /dev/null and b/assets/preload/images/alphabet/ENE LOWERCASE.png differ diff --git a/assets/preload/images/alphabet/ENE.png b/assets/preload/images/alphabet/ENE.png new file mode 100644 index 0000000..e5cc08b Binary files /dev/null and b/assets/preload/images/alphabet/ENE.png differ diff --git a/assets/preload/images/alphabet/EQUAL.png b/assets/preload/images/alphabet/EQUAL.png new file mode 100644 index 0000000..8b1a3ea Binary files /dev/null and b/assets/preload/images/alphabet/EQUAL.png differ diff --git a/assets/preload/images/alphabet/EXCLAMATION BOLD.png b/assets/preload/images/alphabet/EXCLAMATION BOLD.png new file mode 100644 index 0000000..6a222e9 Binary files /dev/null and b/assets/preload/images/alphabet/EXCLAMATION BOLD.png differ diff --git a/assets/preload/images/alphabet/EXCLAMATION.png b/assets/preload/images/alphabet/EXCLAMATION.png new file mode 100644 index 0000000..236483b Binary files /dev/null and b/assets/preload/images/alphabet/EXCLAMATION.png differ diff --git a/assets/preload/images/alphabet/F BOLD.png b/assets/preload/images/alphabet/F BOLD.png new file mode 100644 index 0000000..06bfbe5 Binary files /dev/null and b/assets/preload/images/alphabet/F BOLD.png differ diff --git a/assets/preload/images/alphabet/F LOWERCASE.png b/assets/preload/images/alphabet/F LOWERCASE.png new file mode 100644 index 0000000..496d0a2 Binary files /dev/null and b/assets/preload/images/alphabet/F LOWERCASE.png differ diff --git a/assets/preload/images/alphabet/F.png b/assets/preload/images/alphabet/F.png new file mode 100644 index 0000000..1f2b2a0 Binary files /dev/null and b/assets/preload/images/alphabet/F.png differ diff --git a/assets/preload/images/alphabet/FIVE BOLD.png b/assets/preload/images/alphabet/FIVE BOLD.png new file mode 100644 index 0000000..55af250 Binary files /dev/null and b/assets/preload/images/alphabet/FIVE BOLD.png differ diff --git a/assets/preload/images/alphabet/FIVE.png b/assets/preload/images/alphabet/FIVE.png new file mode 100644 index 0000000..8cf4b67 Binary files /dev/null and b/assets/preload/images/alphabet/FIVE.png differ diff --git a/assets/preload/images/alphabet/FORWARD SLASH.png b/assets/preload/images/alphabet/FORWARD SLASH.png new file mode 100644 index 0000000..6dd5e2a Binary files /dev/null and b/assets/preload/images/alphabet/FORWARD SLASH.png differ diff --git a/assets/preload/images/alphabet/FOUR BOLD.png b/assets/preload/images/alphabet/FOUR BOLD.png new file mode 100644 index 0000000..4eb99a3 Binary files /dev/null and b/assets/preload/images/alphabet/FOUR BOLD.png differ diff --git a/assets/preload/images/alphabet/FOUR.png b/assets/preload/images/alphabet/FOUR.png new file mode 100644 index 0000000..ed3366d Binary files /dev/null and b/assets/preload/images/alphabet/FOUR.png differ diff --git a/assets/preload/images/alphabet/G BOLD.png b/assets/preload/images/alphabet/G BOLD.png new file mode 100644 index 0000000..b961ff4 Binary files /dev/null and b/assets/preload/images/alphabet/G BOLD.png differ diff --git a/assets/preload/images/alphabet/G LOWERCASE.png b/assets/preload/images/alphabet/G LOWERCASE.png new file mode 100644 index 0000000..d7fc0ba Binary files /dev/null and b/assets/preload/images/alphabet/G LOWERCASE.png differ diff --git a/assets/preload/images/alphabet/G.png b/assets/preload/images/alphabet/G.png new file mode 100644 index 0000000..c0fdcfb Binary files /dev/null and b/assets/preload/images/alphabet/G.png differ diff --git a/assets/preload/images/alphabet/GREATER BOLD.png b/assets/preload/images/alphabet/GREATER BOLD.png new file mode 100644 index 0000000..b71861f Binary files /dev/null and b/assets/preload/images/alphabet/GREATER BOLD.png differ diff --git a/assets/preload/images/alphabet/GREATER.png b/assets/preload/images/alphabet/GREATER.png new file mode 100644 index 0000000..ff7d394 Binary files /dev/null and b/assets/preload/images/alphabet/GREATER.png differ diff --git a/assets/preload/images/alphabet/H BOLD.png b/assets/preload/images/alphabet/H BOLD.png new file mode 100644 index 0000000..caccea6 Binary files /dev/null and b/assets/preload/images/alphabet/H BOLD.png differ diff --git a/assets/preload/images/alphabet/H LOWERCASE.png b/assets/preload/images/alphabet/H LOWERCASE.png new file mode 100644 index 0000000..51ae3af Binary files /dev/null and b/assets/preload/images/alphabet/H LOWERCASE.png differ diff --git a/assets/preload/images/alphabet/H.png b/assets/preload/images/alphabet/H.png new file mode 100644 index 0000000..cb94fc0 Binary files /dev/null and b/assets/preload/images/alphabet/H.png differ diff --git a/assets/preload/images/alphabet/HASHTAG.png b/assets/preload/images/alphabet/HASHTAG.png new file mode 100644 index 0000000..fda9850 Binary files /dev/null and b/assets/preload/images/alphabet/HASHTAG.png differ diff --git a/assets/preload/images/alphabet/HEART.png b/assets/preload/images/alphabet/HEART.png new file mode 100644 index 0000000..5d57b3e Binary files /dev/null and b/assets/preload/images/alphabet/HEART.png differ diff --git a/assets/preload/images/alphabet/I BOLD.png b/assets/preload/images/alphabet/I BOLD.png new file mode 100644 index 0000000..3d265df Binary files /dev/null and b/assets/preload/images/alphabet/I BOLD.png differ diff --git a/assets/preload/images/alphabet/I LOWERCASE.png b/assets/preload/images/alphabet/I LOWERCASE.png new file mode 100644 index 0000000..3903e13 Binary files /dev/null and b/assets/preload/images/alphabet/I LOWERCASE.png differ diff --git a/assets/preload/images/alphabet/I.png b/assets/preload/images/alphabet/I.png new file mode 100644 index 0000000..bf8e251 Binary files /dev/null and b/assets/preload/images/alphabet/I.png differ diff --git a/assets/preload/images/alphabet/J BOLD.png b/assets/preload/images/alphabet/J BOLD.png new file mode 100644 index 0000000..a50b893 Binary files /dev/null and b/assets/preload/images/alphabet/J BOLD.png differ diff --git a/assets/preload/images/alphabet/J LOWERCASE.png b/assets/preload/images/alphabet/J LOWERCASE.png new file mode 100644 index 0000000..c939b5e Binary files /dev/null and b/assets/preload/images/alphabet/J LOWERCASE.png differ diff --git a/assets/preload/images/alphabet/J.png b/assets/preload/images/alphabet/J.png new file mode 100644 index 0000000..00bd863 Binary files /dev/null and b/assets/preload/images/alphabet/J.png differ diff --git a/assets/preload/images/alphabet/K BOLD.png b/assets/preload/images/alphabet/K BOLD.png new file mode 100644 index 0000000..cfc6f3b Binary files /dev/null and b/assets/preload/images/alphabet/K BOLD.png differ diff --git a/assets/preload/images/alphabet/K LOWERCASE.png b/assets/preload/images/alphabet/K LOWERCASE.png new file mode 100644 index 0000000..ef32523 Binary files /dev/null and b/assets/preload/images/alphabet/K LOWERCASE.png differ diff --git a/assets/preload/images/alphabet/K.png b/assets/preload/images/alphabet/K.png new file mode 100644 index 0000000..2337ad1 Binary files /dev/null and b/assets/preload/images/alphabet/K.png differ diff --git a/assets/preload/images/alphabet/L BOLD.png b/assets/preload/images/alphabet/L BOLD.png new file mode 100644 index 0000000..047c02a Binary files /dev/null and b/assets/preload/images/alphabet/L BOLD.png differ diff --git a/assets/preload/images/alphabet/L LOWERCASE.png b/assets/preload/images/alphabet/L LOWERCASE.png new file mode 100644 index 0000000..e65144e Binary files /dev/null and b/assets/preload/images/alphabet/L LOWERCASE.png differ diff --git a/assets/preload/images/alphabet/L PARENTHESIS BOLD.png b/assets/preload/images/alphabet/L PARENTHESIS BOLD.png new file mode 100644 index 0000000..0c5cb78 Binary files /dev/null and b/assets/preload/images/alphabet/L PARENTHESIS BOLD.png differ diff --git a/assets/preload/images/alphabet/L PARENTHESIS.png b/assets/preload/images/alphabet/L PARENTHESIS.png new file mode 100644 index 0000000..57a14d3 Binary files /dev/null and b/assets/preload/images/alphabet/L PARENTHESIS.png differ diff --git a/assets/preload/images/alphabet/L SQR BRACKET.png b/assets/preload/images/alphabet/L SQR BRACKET.png new file mode 100644 index 0000000..b04868f Binary files /dev/null and b/assets/preload/images/alphabet/L SQR BRACKET.png differ diff --git a/assets/preload/images/alphabet/L.png b/assets/preload/images/alphabet/L.png new file mode 100644 index 0000000..7525048 Binary files /dev/null and b/assets/preload/images/alphabet/L.png differ diff --git a/assets/preload/images/alphabet/LEFT ARROW.png b/assets/preload/images/alphabet/LEFT ARROW.png new file mode 100644 index 0000000..34ed59c Binary files /dev/null and b/assets/preload/images/alphabet/LEFT ARROW.png differ diff --git a/assets/preload/images/alphabet/LESS BOLD.png b/assets/preload/images/alphabet/LESS BOLD.png new file mode 100644 index 0000000..3243b5d Binary files /dev/null and b/assets/preload/images/alphabet/LESS BOLD.png differ diff --git a/assets/preload/images/alphabet/LESS.png b/assets/preload/images/alphabet/LESS.png new file mode 100644 index 0000000..48bb491 Binary files /dev/null and b/assets/preload/images/alphabet/LESS.png differ diff --git a/assets/preload/images/alphabet/M BOLD.png b/assets/preload/images/alphabet/M BOLD.png new file mode 100644 index 0000000..6ce5dc2 Binary files /dev/null and b/assets/preload/images/alphabet/M BOLD.png differ diff --git a/assets/preload/images/alphabet/M LOWERCASE.png b/assets/preload/images/alphabet/M LOWERCASE.png new file mode 100644 index 0000000..722f9be Binary files /dev/null and b/assets/preload/images/alphabet/M LOWERCASE.png differ diff --git a/assets/preload/images/alphabet/M.png b/assets/preload/images/alphabet/M.png new file mode 100644 index 0000000..0621dbc Binary files /dev/null and b/assets/preload/images/alphabet/M.png differ diff --git a/assets/preload/images/alphabet/MULTIPLY.png b/assets/preload/images/alphabet/MULTIPLY.png new file mode 100644 index 0000000..53cb64e Binary files /dev/null and b/assets/preload/images/alphabet/MULTIPLY.png differ diff --git a/assets/preload/images/alphabet/N BOLD.png b/assets/preload/images/alphabet/N BOLD.png new file mode 100644 index 0000000..eaf2a79 Binary files /dev/null and b/assets/preload/images/alphabet/N BOLD.png differ diff --git a/assets/preload/images/alphabet/N LOWERCASE.png b/assets/preload/images/alphabet/N LOWERCASE.png new file mode 100644 index 0000000..22584a2 Binary files /dev/null and b/assets/preload/images/alphabet/N LOWERCASE.png differ diff --git a/assets/preload/images/alphabet/N.png b/assets/preload/images/alphabet/N.png new file mode 100644 index 0000000..a57285b Binary files /dev/null and b/assets/preload/images/alphabet/N.png differ diff --git a/assets/preload/images/alphabet/NINE BOLD.png b/assets/preload/images/alphabet/NINE BOLD.png new file mode 100644 index 0000000..68e8d80 Binary files /dev/null and b/assets/preload/images/alphabet/NINE BOLD.png differ diff --git a/assets/preload/images/alphabet/NINE.png b/assets/preload/images/alphabet/NINE.png new file mode 100644 index 0000000..3fcce18 Binary files /dev/null and b/assets/preload/images/alphabet/NINE.png differ diff --git a/assets/preload/images/alphabet/O BOLD.png b/assets/preload/images/alphabet/O BOLD.png new file mode 100644 index 0000000..582a391 Binary files /dev/null and b/assets/preload/images/alphabet/O BOLD.png differ diff --git a/assets/preload/images/alphabet/O LOWERCASE.png b/assets/preload/images/alphabet/O LOWERCASE.png new file mode 100644 index 0000000..082d833 Binary files /dev/null and b/assets/preload/images/alphabet/O LOWERCASE.png differ diff --git a/assets/preload/images/alphabet/O.png b/assets/preload/images/alphabet/O.png new file mode 100644 index 0000000..fb60b3a Binary files /dev/null and b/assets/preload/images/alphabet/O.png differ diff --git a/assets/preload/images/alphabet/ONE BOLD.png b/assets/preload/images/alphabet/ONE BOLD.png new file mode 100644 index 0000000..1b6c2cd Binary files /dev/null and b/assets/preload/images/alphabet/ONE BOLD.png differ diff --git a/assets/preload/images/alphabet/ONE.png b/assets/preload/images/alphabet/ONE.png new file mode 100644 index 0000000..bbd4e05 Binary files /dev/null and b/assets/preload/images/alphabet/ONE.png differ diff --git a/assets/preload/images/alphabet/P BOLD.png b/assets/preload/images/alphabet/P BOLD.png new file mode 100644 index 0000000..06959c8 Binary files /dev/null and b/assets/preload/images/alphabet/P BOLD.png differ diff --git a/assets/preload/images/alphabet/P LOWERCASE.png b/assets/preload/images/alphabet/P LOWERCASE.png new file mode 100644 index 0000000..db81808 Binary files /dev/null and b/assets/preload/images/alphabet/P LOWERCASE.png differ diff --git a/assets/preload/images/alphabet/P.png b/assets/preload/images/alphabet/P.png new file mode 100644 index 0000000..17f8680 Binary files /dev/null and b/assets/preload/images/alphabet/P.png differ diff --git a/assets/preload/images/alphabet/PERCENTAGE.png b/assets/preload/images/alphabet/PERCENTAGE.png new file mode 100644 index 0000000..8b405c3 Binary files /dev/null and b/assets/preload/images/alphabet/PERCENTAGE.png differ diff --git a/assets/preload/images/alphabet/PERIOD BOLD.png b/assets/preload/images/alphabet/PERIOD BOLD.png new file mode 100644 index 0000000..c421c0b Binary files /dev/null and b/assets/preload/images/alphabet/PERIOD BOLD.png differ diff --git a/assets/preload/images/alphabet/PERIOD.png b/assets/preload/images/alphabet/PERIOD.png new file mode 100644 index 0000000..532db51 Binary files /dev/null and b/assets/preload/images/alphabet/PERIOD.png differ diff --git a/assets/preload/images/alphabet/PLUS BOLD.png b/assets/preload/images/alphabet/PLUS BOLD.png new file mode 100644 index 0000000..55cce62 Binary files /dev/null and b/assets/preload/images/alphabet/PLUS BOLD.png differ diff --git a/assets/preload/images/alphabet/PLUS.png b/assets/preload/images/alphabet/PLUS.png new file mode 100644 index 0000000..ed634da Binary files /dev/null and b/assets/preload/images/alphabet/PLUS.png differ diff --git a/assets/preload/images/alphabet/Q BOLD.png b/assets/preload/images/alphabet/Q BOLD.png new file mode 100644 index 0000000..15cad60 Binary files /dev/null and b/assets/preload/images/alphabet/Q BOLD.png differ diff --git a/assets/preload/images/alphabet/Q LOWERCASE.png b/assets/preload/images/alphabet/Q LOWERCASE.png new file mode 100644 index 0000000..30cb5c0 Binary files /dev/null and b/assets/preload/images/alphabet/Q LOWERCASE.png differ diff --git a/assets/preload/images/alphabet/Q.png b/assets/preload/images/alphabet/Q.png new file mode 100644 index 0000000..556873d Binary files /dev/null and b/assets/preload/images/alphabet/Q.png differ diff --git a/assets/preload/images/alphabet/QUESTION BOLD.png b/assets/preload/images/alphabet/QUESTION BOLD.png new file mode 100644 index 0000000..42441fa Binary files /dev/null and b/assets/preload/images/alphabet/QUESTION BOLD.png differ diff --git a/assets/preload/images/alphabet/QUESTION.png b/assets/preload/images/alphabet/QUESTION.png new file mode 100644 index 0000000..900592f Binary files /dev/null and b/assets/preload/images/alphabet/QUESTION.png differ diff --git a/assets/preload/images/alphabet/R BOLD.png b/assets/preload/images/alphabet/R BOLD.png new file mode 100644 index 0000000..25006fa Binary files /dev/null and b/assets/preload/images/alphabet/R BOLD.png differ diff --git a/assets/preload/images/alphabet/R LOWERCASE.png b/assets/preload/images/alphabet/R LOWERCASE.png new file mode 100644 index 0000000..44c6bd0 Binary files /dev/null and b/assets/preload/images/alphabet/R LOWERCASE.png differ diff --git a/assets/preload/images/alphabet/R PARENTHESIS BOLD.png b/assets/preload/images/alphabet/R PARENTHESIS BOLD.png new file mode 100644 index 0000000..d00ab3a Binary files /dev/null and b/assets/preload/images/alphabet/R PARENTHESIS BOLD.png differ diff --git a/assets/preload/images/alphabet/R PARENTHESIS.png b/assets/preload/images/alphabet/R PARENTHESIS.png new file mode 100644 index 0000000..4c696e0 Binary files /dev/null and b/assets/preload/images/alphabet/R PARENTHESIS.png differ diff --git a/assets/preload/images/alphabet/R SQR BRACKET.png b/assets/preload/images/alphabet/R SQR BRACKET.png new file mode 100644 index 0000000..27f65eb Binary files /dev/null and b/assets/preload/images/alphabet/R SQR BRACKET.png differ diff --git a/assets/preload/images/alphabet/R.png b/assets/preload/images/alphabet/R.png new file mode 100644 index 0000000..1cec838 Binary files /dev/null and b/assets/preload/images/alphabet/R.png differ diff --git a/assets/preload/images/alphabet/RIGHT ARROW.png b/assets/preload/images/alphabet/RIGHT ARROW.png new file mode 100644 index 0000000..49c5136 Binary files /dev/null and b/assets/preload/images/alphabet/RIGHT ARROW.png differ diff --git a/assets/preload/images/alphabet/S BOLD.png b/assets/preload/images/alphabet/S BOLD.png new file mode 100644 index 0000000..4d85981 Binary files /dev/null and b/assets/preload/images/alphabet/S BOLD.png differ diff --git a/assets/preload/images/alphabet/S LOWERCASE.png b/assets/preload/images/alphabet/S LOWERCASE.png new file mode 100644 index 0000000..970874a Binary files /dev/null and b/assets/preload/images/alphabet/S LOWERCASE.png differ diff --git a/assets/preload/images/alphabet/S.png b/assets/preload/images/alphabet/S.png new file mode 100644 index 0000000..2fc2218 Binary files /dev/null and b/assets/preload/images/alphabet/S.png differ diff --git a/assets/preload/images/alphabet/SEMICOLON.png b/assets/preload/images/alphabet/SEMICOLON.png new file mode 100644 index 0000000..dd1dadb Binary files /dev/null and b/assets/preload/images/alphabet/SEMICOLON.png differ diff --git a/assets/preload/images/alphabet/SEVEN BOLD.png b/assets/preload/images/alphabet/SEVEN BOLD.png new file mode 100644 index 0000000..d8f88fb Binary files /dev/null and b/assets/preload/images/alphabet/SEVEN BOLD.png differ diff --git a/assets/preload/images/alphabet/SEVEN.png b/assets/preload/images/alphabet/SEVEN.png new file mode 100644 index 0000000..84cae58 Binary files /dev/null and b/assets/preload/images/alphabet/SEVEN.png differ diff --git a/assets/preload/images/alphabet/SIX BOLD.png b/assets/preload/images/alphabet/SIX BOLD.png new file mode 100644 index 0000000..033f403 Binary files /dev/null and b/assets/preload/images/alphabet/SIX BOLD.png differ diff --git a/assets/preload/images/alphabet/SIX.png b/assets/preload/images/alphabet/SIX.png new file mode 100644 index 0000000..335680c Binary files /dev/null and b/assets/preload/images/alphabet/SIX.png differ diff --git a/assets/preload/images/alphabet/T BOLD.png b/assets/preload/images/alphabet/T BOLD.png new file mode 100644 index 0000000..0114b0d Binary files /dev/null and b/assets/preload/images/alphabet/T BOLD.png differ diff --git a/assets/preload/images/alphabet/T LOWERCASE.png b/assets/preload/images/alphabet/T LOWERCASE.png new file mode 100644 index 0000000..7f190de Binary files /dev/null and b/assets/preload/images/alphabet/T LOWERCASE.png differ diff --git a/assets/preload/images/alphabet/T.png b/assets/preload/images/alphabet/T.png new file mode 100644 index 0000000..1517ed4 Binary files /dev/null and b/assets/preload/images/alphabet/T.png differ diff --git a/assets/preload/images/alphabet/THREE BOLD.png b/assets/preload/images/alphabet/THREE BOLD.png new file mode 100644 index 0000000..2e1b5b6 Binary files /dev/null and b/assets/preload/images/alphabet/THREE BOLD.png differ diff --git a/assets/preload/images/alphabet/THREE.png b/assets/preload/images/alphabet/THREE.png new file mode 100644 index 0000000..9f99619 Binary files /dev/null and b/assets/preload/images/alphabet/THREE.png differ diff --git a/assets/preload/images/alphabet/TILDA BOLD.png b/assets/preload/images/alphabet/TILDA BOLD.png new file mode 100644 index 0000000..ac5c10c Binary files /dev/null and b/assets/preload/images/alphabet/TILDA BOLD.png differ diff --git a/assets/preload/images/alphabet/TILDA.png b/assets/preload/images/alphabet/TILDA.png new file mode 100644 index 0000000..9885678 Binary files /dev/null and b/assets/preload/images/alphabet/TILDA.png differ diff --git a/assets/preload/images/alphabet/TWO BOLD.png b/assets/preload/images/alphabet/TWO BOLD.png new file mode 100644 index 0000000..fb20be8 Binary files /dev/null and b/assets/preload/images/alphabet/TWO BOLD.png differ diff --git a/assets/preload/images/alphabet/TWO.png b/assets/preload/images/alphabet/TWO.png new file mode 100644 index 0000000..77385b6 Binary files /dev/null and b/assets/preload/images/alphabet/TWO.png differ diff --git a/assets/preload/images/alphabet/U BOLD.png b/assets/preload/images/alphabet/U BOLD.png new file mode 100644 index 0000000..efbc63a Binary files /dev/null and b/assets/preload/images/alphabet/U BOLD.png differ diff --git a/assets/preload/images/alphabet/U LOWERCASE.png b/assets/preload/images/alphabet/U LOWERCASE.png new file mode 100644 index 0000000..5afa88f Binary files /dev/null and b/assets/preload/images/alphabet/U LOWERCASE.png differ diff --git a/assets/preload/images/alphabet/U.png b/assets/preload/images/alphabet/U.png new file mode 100644 index 0000000..914b013 Binary files /dev/null and b/assets/preload/images/alphabet/U.png differ diff --git a/assets/preload/images/alphabet/UNDERSCORE.png b/assets/preload/images/alphabet/UNDERSCORE.png new file mode 100644 index 0000000..02bc0eb Binary files /dev/null and b/assets/preload/images/alphabet/UNDERSCORE.png differ diff --git a/assets/preload/images/alphabet/UP ARROW.png b/assets/preload/images/alphabet/UP ARROW.png new file mode 100644 index 0000000..fd286fb Binary files /dev/null and b/assets/preload/images/alphabet/UP ARROW.png differ diff --git a/assets/preload/images/alphabet/V BOLD.png b/assets/preload/images/alphabet/V BOLD.png new file mode 100644 index 0000000..32559cf Binary files /dev/null and b/assets/preload/images/alphabet/V BOLD.png differ diff --git a/assets/preload/images/alphabet/V LOWERCASE.png b/assets/preload/images/alphabet/V LOWERCASE.png new file mode 100644 index 0000000..59a0f11 Binary files /dev/null and b/assets/preload/images/alphabet/V LOWERCASE.png differ diff --git a/assets/preload/images/alphabet/V.png b/assets/preload/images/alphabet/V.png new file mode 100644 index 0000000..6b93916 Binary files /dev/null and b/assets/preload/images/alphabet/V.png differ diff --git a/assets/preload/images/alphabet/W BOLD.png b/assets/preload/images/alphabet/W BOLD.png new file mode 100644 index 0000000..fd08434 Binary files /dev/null and b/assets/preload/images/alphabet/W BOLD.png differ diff --git a/assets/preload/images/alphabet/W LOWERCASE.png b/assets/preload/images/alphabet/W LOWERCASE.png new file mode 100644 index 0000000..db3df14 Binary files /dev/null and b/assets/preload/images/alphabet/W LOWERCASE.png differ diff --git a/assets/preload/images/alphabet/W.png b/assets/preload/images/alphabet/W.png new file mode 100644 index 0000000..49c1d4b Binary files /dev/null and b/assets/preload/images/alphabet/W.png differ diff --git a/assets/preload/images/alphabet/X BOLD.png b/assets/preload/images/alphabet/X BOLD.png new file mode 100644 index 0000000..402a510 Binary files /dev/null and b/assets/preload/images/alphabet/X BOLD.png differ diff --git a/assets/preload/images/alphabet/X LOWERCASE.png b/assets/preload/images/alphabet/X LOWERCASE.png new file mode 100644 index 0000000..a1a6b2a Binary files /dev/null and b/assets/preload/images/alphabet/X LOWERCASE.png differ diff --git a/assets/preload/images/alphabet/X.png b/assets/preload/images/alphabet/X.png new file mode 100644 index 0000000..4a2214e Binary files /dev/null and b/assets/preload/images/alphabet/X.png differ diff --git a/assets/preload/images/alphabet/Y BOLD.png b/assets/preload/images/alphabet/Y BOLD.png new file mode 100644 index 0000000..7cc8bee Binary files /dev/null and b/assets/preload/images/alphabet/Y BOLD.png differ diff --git a/assets/preload/images/alphabet/Y LOWERCASE.png b/assets/preload/images/alphabet/Y LOWERCASE.png new file mode 100644 index 0000000..2929558 Binary files /dev/null and b/assets/preload/images/alphabet/Y LOWERCASE.png differ diff --git a/assets/preload/images/alphabet/Y.png b/assets/preload/images/alphabet/Y.png new file mode 100644 index 0000000..d15ae89 Binary files /dev/null and b/assets/preload/images/alphabet/Y.png differ diff --git a/assets/preload/images/alphabet/Z BOLD.png b/assets/preload/images/alphabet/Z BOLD.png new file mode 100644 index 0000000..0e78953 Binary files /dev/null and b/assets/preload/images/alphabet/Z BOLD.png differ diff --git a/assets/preload/images/alphabet/Z LOWERCASE.png b/assets/preload/images/alphabet/Z LOWERCASE.png new file mode 100644 index 0000000..da79a1d Binary files /dev/null and b/assets/preload/images/alphabet/Z LOWERCASE.png differ diff --git a/assets/preload/images/alphabet/Z.png b/assets/preload/images/alphabet/Z.png new file mode 100644 index 0000000..6a17aba Binary files /dev/null and b/assets/preload/images/alphabet/Z.png differ diff --git a/assets/preload/images/alphabet/ZERO BOLD.png b/assets/preload/images/alphabet/ZERO BOLD.png new file mode 100644 index 0000000..1dd297d Binary files /dev/null and b/assets/preload/images/alphabet/ZERO BOLD.png differ diff --git a/assets/preload/images/alphabet/ZERO.png b/assets/preload/images/alphabet/ZERO.png new file mode 100644 index 0000000..bee4727 Binary files /dev/null and b/assets/preload/images/alphabet/ZERO.png differ diff --git a/assets/preload/images/credits/dany.png b/assets/preload/images/credits/dany.png deleted file mode 100644 index 75c6bcb..0000000 Binary files a/assets/preload/images/credits/dany.png and /dev/null differ diff --git a/assets/preload/update/tracking/GitVer.txt b/assets/preload/update/tracking/GitVer.txt index 437cab5..c18d72b 100644 --- a/assets/preload/update/tracking/GitVer.txt +++ b/assets/preload/update/tracking/GitVer.txt @@ -1 +1 @@ -0.8.0e \ No newline at end of file +0.8.1 \ No newline at end of file diff --git a/source/Alphabet.hx b/source/Alphabet.hx index 0961ffb..bbc12ee 100644 --- a/source/Alphabet.hx +++ b/source/Alphabet.hx @@ -79,9 +79,9 @@ class Alphabet extends FlxSpriteGroup { for (i in 0...lettersArray.length) { var letter = lettersArray[0]; - letter.destroy(); - remove(letter); + remove(letter, true); lettersArray.remove(letter); + letter.destroy(); } lettersArray = []; splitWords = []; @@ -244,6 +244,7 @@ class Alphabet extends FlxSpriteGroup } add(letter); + lettersArray.push(letter); //so it can be destroyed later lastSprite = letter; } @@ -327,6 +328,9 @@ class AlphaCharacter extends FlxSprite { //actual xml mapping private static final characters:Map = [ + //SPECIAL CHARS -> DIFF NAME + "ñ" => "ENE LOWERCASE", + "Ñ" => "ENE", //numbers -> proper name "1" => "ONE", "2" => "TWO", @@ -362,22 +366,24 @@ class AlphaCharacter extends FlxSprite "_" => "UNDERSCORE", "." => "PERIOD", "," => "COMMA", - "'" => "QUOTE", + "'" => "APOSTROPHE", "\"" => "DBL QUOTE START", "!" => "EXCLAMATION", + "¡" => "EXCLAMATION", "?" => "QUESTION", + "¿" => "QUESTION", "{" => "L CRLY BRACKET", "}" => "R CRLY BRACKET", "`" => "BACKTICK", "\\" => "BACKSLASH", - "/" => "SLASH", + "/" => "FORWARD SLASH", "×" => "MULTIPLY", "↑" => "UP ARROW", "→" => "RIGHT ARROW", "←" => "LEFT ARROW", "↓" => "DOWN ARROW", "♥" => "HEART", - "😡" => "ANGRY" //ah yes, emoji in code + "😡" => "ANGRY FAIC" //ah yes, emoji in code ]; //for determaining which it is @@ -385,7 +391,7 @@ class AlphaCharacter extends FlxSprite public static final numbers:String = "1234567890"; - public static final symbols:String = "|~#&$%()*+-:;<=>@[]^_.,'\"!?\\/×↑→←↓♥😡"; + public static final symbols:String = "|~#&$%()*+-:;<=>@[]^_.,'\"!¡?¿\\/×↑→←↓♥😡ñÑ"; public var row:Int = 0; @@ -394,44 +400,37 @@ class AlphaCharacter extends FlxSprite public function new(x:Float, y:Float, textSize:Float) { super(x, y); - var tex = Paths.getSparrowAtlas('alphabet'); - frames = tex; - setGraphicSize(Std.int(width * textSize)); - updateHitbox(); this.textSize = textSize; moves = false; } public function set(character:String, letter:Bool, bold:Bool, ?typed:Bool = false) { - if (letter) { - final prefix:String = ((character.toUpperCase() != character) ? '${character.toUpperCase()} LOWERCASE' : character); - animation.addByPrefix(character, '${bold ? '${character.toUpperCase()} BOLD' : '${prefix}0'}', 24); - } else { - final prefix:String = ((bold && character == '_') ? characters.get('-') : characters.get(character)); - animation.addByPrefix(character, '$prefix${bold ? ' BOLD' : '0'}', 24); - } + var path = (letter ? (character.toUpperCase() != character ? '${character.toUpperCase()} LOWERCASE' : character) : ''); + if (!letter) path = characters.get((bold && character == '_') ? '-' : character); //?? + if (!Paths.fileExists('images/alphabet/' + (bold ? path.replace('LOWERCASE', '').trim() + ' BOLD' : path) + '.png', IMAGE)) + path = 'QUESTION'; + var gfx = Paths.image('alphabet/' + (bold ? path.replace('LOWERCASE', '').trim() + ' BOLD' : path)); + loadGraphic(gfx, true, Math.floor(gfx.width/2), gfx.height); + setGraphicSize(Std.int(width * textSize)); + animation.add(character, [0, 0, 1, 1], 24); animation.play(character); updateHitbox(); if (bold) { - switch (character) + switch (character.toUpperCase()) { case "'": y -= 20 * textSize; - case '-': y += 20 * textSize; + case '-': y += 22 * textSize; case '_': y += 50 * textSize; //totally real underscore - case '(': - x += (typed ? 1 * textSize : -35 * textSize); - y -= 5 * textSize; - offset.x = (typed ? -58 * textSize : -3 * textSize); - case ')': - x -= (typed ? 32 * textSize : 10 / textSize); - y -= 5 * textSize; - offset.x = (typed ? 12 * textSize : 24 * textSize); - case '.': - y += 45 * textSize; - x += (typed ? -3 : 5) * textSize; - offset.x += 3 * textSize; + case '(' | ')': y -= 5 * textSize; + case '.': y += 47 * textSize; + case 'Ñ': y -= 26 * textSize; //ñ (eñe) + case '!': y -= 11 * textSize; + case '?': y -= 7 * textSize; + case '¿' | '¡': flipX = flipY = true; + case '+': y += 13 * textSize; + case '~': y += 16 * textSize; } return; } @@ -457,6 +456,9 @@ class AlphaCharacter extends FlxSprite case 'j': y += 5.7 * textSize; case 'q': y += 12.8 * textSize; case 'y': y += 11.4 * textSize; + case '¿' | '¡': + y += 10 * textSize; + flipX = flipY = true; } } } diff --git a/source/CharacterSelectSubstate.hx b/source/CharacterSelectSubstate.hx index 991c373..7c3e7dc 100644 --- a/source/CharacterSelectSubstate.hx +++ b/source/CharacterSelectSubstate.hx @@ -247,7 +247,7 @@ class CharacterSelectSubstate extends MusicBeatSubstate function leEpicTween() { FlxTween.tween(bg, {alpha: 0}, 0.7, { onComplete: function(_) { - bg.kill(); + remove(bg, true); bg.destroy(); } }); @@ -255,7 +255,7 @@ class CharacterSelectSubstate extends MusicBeatSubstate for (shit in shitToTween) { FlxTween.tween(shit, {alpha: 0}, 0.5, { onComplete: function(_) { - shit.kill(); + remove(shit, true); shit.destroy(); } }); diff --git a/source/CrossFades.hx b/source/CrossFades.hx index 9530b7e..d57f416 100644 --- a/source/CrossFades.hx +++ b/source/CrossFades.hx @@ -13,124 +13,111 @@ import flixel.util.FlxColor; */ class CrossFade extends FlxSprite { - public var isPlayer:Bool = false; - public var playerOffsets:Bool = false; - public var flippedFlipX:Bool = false; - //dynamic is a big no no - //AT this is literally a dynamic - public function new(character:Any, group:FlxTypedGroup, ?isDad:Bool = true) - { + private static var colorMap:Map> = [ + 'gf-tutorial' => [0xFFa5004d], + 'gf' => [0xFFa5004d], + 'gf-pixel' => [0xFFa5004d], + 'monster' => [0xff919400], + 'monster-streetlight' => [0xff919400], + 'monster-christmas' => [0xff919400], + 'bf' => [0xFF1b008c], + 'bf-streetlight' => [0xFF1b008c], + 'bf-car' => [0xFF1b008c], + 'bf-christmas' => [0xFF1b008c], + 'bf-holding-gf' => [0xFF1b008c, 0xFFa5004d], + 'bf-pixel' => [0xFF00368c], + 'bf-pixel-opponent' => [0xFF00368c], + 'pico' => [0xff2c8c00], + 'pico-player' => [0xff2c8c00], + 'parents-christmas' => [0xff6a3381, 0xff882952], + 'spooky' => [0xff777777, 0xff925500], + 'senpai' => [0xFFffaa6f], + 'senpai-angry' => [0xFFffaa6f], + 'sarvente' => [0xFFe32486], + 'sarvente-dark' => [0xFFe32486], + 'sarvente-lucifer' => [0xFFe32486], + 'selever' => [0xFFe32486], + 'ruv' => [0xFF2e0069], + 'tankman' => [0xffcccccc, 0xff7c0000, 0xff7e3200, 0xff7c6900, 0xff0a7c00, 0xff00407c, 0xff13007c, 0xff63007c] + ]; + private var isPlayer:Bool = false; + private var playerOffsets:Bool = false; + private var flippedFlipX:Bool = false; + + //these are recycled now so the new function is empty except for the super + public function new() super(); - var char:Character = cast(character, Character); + public function resetShit(character:Character, ?isDad:Bool = true) { + if (character.trailData.enabled) { + kill(); + return; + } - isPlayer = char.isPlayer; - playerOffsets = char.playerOffsets; - flippedFlipX = char.flippedFlipX; - frames = char.frames; + isPlayer = character.isPlayer; + playerOffsets = character.playerOffsets; + flippedFlipX = character.flippedFlipX; + frames = character.frames; alpha = (!isDad ? ClientPrefs.settings.get('crossFadeData')[3] : 0.3); - setGraphicSize(Std.int(char.width), Std.int(char.height)); - scrollFactor.set(char.scrollFactor.x, char.scrollFactor.y); + setGraphicSize(Std.int(character.width), Std.int(character.height)); + scrollFactor.set(character.scrollFactor.x, character.scrollFactor.y); updateHitbox(); - flipX = char.flipX; - flipY = char.flipY; + flipX = character.flipX; + flipY = character.flipY; final curCrossFadeMode:String = ClientPrefs.settings.get('crossFadeData')[0]; switch (curCrossFadeMode) { case 'Static': - x = char.x + (isDad ? 60 : -60); - y = char.y - 48; + x = character.x + (isDad ? 60 : -60); + y = character.y - 48; case 'Subtle': - x = char.x; - y = char.y; + x = character.x; + y = character.y; case 'Eccentric': - x = char.x + FlxG.random.float(-20,90); - y = char.y + FlxG.random.float(-80, 80); + x = character.x + FlxG.random.float(-20,90); + y = character.y + FlxG.random.float(-80, 80); default: - x = char.x + FlxG.random.float(0,60); - y = char.y + FlxG.random.float(-50, 50); + x = character.x + FlxG.random.float(0,60); + y = character.y + FlxG.random.float(-50, 50); } - offset.x = char.offset.x; - offset.y = char.offset.y; - animation.add('cur', char.animation.curAnim.frames, 24, false); + offset.set(character.offset.x, character.offset.y); + animation.add('cur', character.animation.curAnim.frames, 24, false); animation.play('cur', true); - animation.curAnim.curFrame = char.animation.curAnim.curFrame; - antialiasing = char.antialiasing; - if (!char.trailData.enabled) { - switch(char.curCharacter) - { - case 'gf-pixel': - color = 0xFFa5004d; - antialiasing = false; - case 'monster' | 'monster-christmas' | 'monster-streetlight': - color = 0xff919400; - case 'bf' | 'bf-car' | 'bf-christmas' | 'bf-streetlight': - color = 0xFF1b008c; - case 'pico' | 'pico-player': - color = 0xff2c8c00; - case 'bf-holding-gf': - color = FlxG.random.bool(50) ? 0xFF1b008c : 0xFFa5004d; - case 'parents-christmas': - color = PlayState.SONG.notes[PlayState.instance.curSection].altAnim ? 0xff882952 : 0xff6a3381; - case 'spooky': - color = FlxG.random.bool(50) ? 0xff777777 : 0xff925500; - case 'bf-pixel' | 'bf-pixel-opponent': - color = 0xFF00368c; - antialiasing = false; - case 'senpai' | 'senpai-angry': - color = 0xFFffaa6f; - antialiasing = false; - case 'sarvente' | 'sarvente-dark' | 'sarvente-lucifer' | 'selever': - color = 0xFFe32486; - case 'ruv': - color = 0xFF2e0069; - case 'tankman' | 'tankman-player': - color = 0xffcccccc; - if (PlayState.instance != null && PlayState.instance.tankmanRainbow) { - switch(FlxG.random.int(0,5)) { - case 0: color = 0xff7c0000; - case 1: color = 0xff7e3200; - case 2: color = 0xff7c6900; - case 3: color = 0xff0a7c00; - case 4: color = 0xff02007c; - case 5: color = 0xff6d007c; - } - } - default: - //oooo scary chaining - color = FlxColor.subtract(FlxColor.fromRGB(char.healthColorArray[0].red, char.healthColorArray[0].green, char.healthColorArray[0].blue), 0x00333333); - } - } else { - alpha = 0; - kill(); - destroy(); - return; - } + animation.curAnim.curFrame = character.animation.curAnim.curFrame; + //animation.copyFrom(character.animation); //might be faster? + antialiasing = character.antialiasing; + + if (colorMap.exists(character.curCharacter)) { + final colors = colorMap.get(character.curCharacter); + var index:Int = 0; + + if (character.curCharacter == 'parents-christmas') + index = (PlayState.SONG.notes[PlayState.instance.curSection].altAnim ? 1 : 0); + else if (character.curCharacter == 'spooky' || character.curCharacter == 'bf-holding-gf') + index = (FlxG.random.bool() ? 1 : 0); + else if ((character.curCharacter == 'tankman' || character.curCharacter == 'tankman-player') && PlayState.instance.tankmanRainbow) + index = FlxG.random.int(1, 7); + + color = colors[index]; + } else + color = FlxColor.subtract(FlxColor.fromRGB(character.healthColorArray[0].red, character.healthColorArray[0].green, character.healthColorArray[0].blue), 0x00333333); - final dirLeft = FlxG.random.bool(70); //no mor shadow wario naming wahoo + final oppositeDir = FlxG.random.bool(70); //no mor shadow wario naming wahoo final velo = 12 * (curCrossFadeMode == 'Eccentric' ? 8 : 5); switch (curCrossFadeMode) { case 'Static' | 'Subtle': velocity.x = 0; case 'Eccentric': - velocity.x = (isDad ? (dirLeft ? -velo : velo) : (dirLeft ? velo : -velo)) * PlayState.instance.playbackRate; + velocity.x = (isDad ? (oppositeDir ? -velo : velo) : (oppositeDir ? velo : -velo)) * PlayState.instance.playbackRate; acceleration.x = (velocity.x > 0 ? FlxG.random.int(25,75) : FlxG.random.int(-25,-75)) * PlayState.instance.playbackRate * PlayState.instance.playbackRate; default: - velocity.x = (isDad ? (dirLeft ? -velo : velo) : (dirLeft ? velo : -velo)) * PlayState.instance.playbackRate; + velocity.x = (isDad ? (oppositeDir ? -velo : velo) : (oppositeDir ? velo : -velo)) * PlayState.instance.playbackRate; acceleration.x = (velocity.x > 0 ? FlxG.random.int(4,12) : FlxG.random.int(-4,-12)) * PlayState.instance.playbackRate * PlayState.instance.playbackRate; } var fadeTime = (!isDad ? ClientPrefs.settings.get('crossFadeData')[4] : 0.35); - FlxTween.tween(this, {alpha: 0}, FlxG.random.float(fadeTime - 0.03, fadeTime + 0.03) / PlayState.instance.playbackRate, { - onComplete: _ -> { - kill(); - group.remove(this, true); - destroy(); - } - }); - - group.add(this); - } + FlxTween.tween(this, {alpha: 0}, FlxG.random.float(fadeTime - 0.03, fadeTime + 0.03) / PlayState.instance.playbackRate, {onComplete: _ -> kill()}); + } public override function getScreenBounds(?newRect:FlxRect, ?camera:FlxCamera):FlxRect { if (flipDrawing) { diff --git a/source/CustomFadeTransition.hx b/source/CustomFadeTransition.hx index 7894e16..222b873 100644 --- a/source/CustomFadeTransition.hx +++ b/source/CustomFadeTransition.hx @@ -92,6 +92,7 @@ class CustomFadeTransition extends MusicBeatSubstate { if(leTween != null) { finishCallback(); leTween.cancel(); + leTween.destroy(); } colorForFunnyGrad = FlxColor.BLACK; super.destroy(); diff --git a/source/CutsceneHandler.hx b/source/CutsceneHandler.hx index 09c7d52..30505d3 100644 --- a/source/CutsceneHandler.hx +++ b/source/CutsceneHandler.hx @@ -59,7 +59,6 @@ class CutsceneHandler extends FlxBasic for (spr in objects) { - spr.kill(); PlayState.instance.remove(spr); spr.destroy(); } @@ -77,10 +76,9 @@ class CutsceneHandler extends FlxBasic for (spr in objects) { - spr.kill(); PlayState.instance.remove(spr); - spr.destroy(); objects.remove(spr); + spr.destroy(); } for (sound in sounds) @@ -99,9 +97,8 @@ class CutsceneHandler extends FlxBasic timedEvents = []; - kill(); - destroy(); PlayState.instance.remove(this); + destroy(); } } diff --git a/source/DenpaState.hx b/source/DenpaState.hx index efbf2ba..fbe1348 100644 --- a/source/DenpaState.hx +++ b/source/DenpaState.hx @@ -2,6 +2,7 @@ package; import flash.system.System; import flixel.FlxSprite; +import flixel.addons.display.FlxBackdrop; import flixel.addons.text.FlxTypeText; import flixel.addons.transition.FlxTransitionableState; import flixel.input.keyboard.FlxKey; @@ -34,35 +35,29 @@ class DenpaState extends MusicBeatState #if desktop Application.current.window.focus(); #end - var directory:String = 'splash'; - var weekDir:String = StageData.forceNextDirectory; - StageData.forceNextDirectory = null; - if(weekDir != null && weekDir.length > 0 && weekDir != '') directory = weekDir; - - Paths.setCurrentLevel(directory); - CoolUtil.precacheSound('denpa'); + CoolUtil.precacheSound('denpa', 'splash'); if (chooseYerIntroMate == 9) { - CoolUtil.precacheSound('dennad'); + CoolUtil.precacheSound('dennad', 'splash'); } if (FlxG.random.bool(1)) { chooseYerIntroMate = 9999; - CoolUtil.precacheSound('explosion'); + CoolUtil.precacheSound('explosion', 'splash'); } #if desktop if (FlxG.random.bool(0.01)) { chooseYerIntroMate = 666; - CoolUtil.precacheSound('JON_JUIMPSCARE'); - CoolUtil.precacheSound('undertale-game-over'); - CoolUtil.precacheSound('wasted'); - CoolUtil.precacheSound('soulbreak'); - CoolUtil.precacheSound('ourple'); + CoolUtil.precacheSound('JON_JUIMPSCARE', 'splash'); + CoolUtil.precacheSound('undertale-game-over', 'splash'); + CoolUtil.precacheSound('wasted', 'splash'); + CoolUtil.precacheSound('soulbreak', 'splash'); + CoolUtil.precacheSound('ourple', 'splash'); } #end - logo = new FlxSprite().loadGraphic(Paths.image('logo', null, false)); + logo = new FlxSprite().loadGraphic(Paths.image('logo', 'splash', false)); logo.scrollFactor.set(); logo.screenCenter(); logo.alpha = 0; @@ -77,7 +72,7 @@ class DenpaState extends MusicBeatState FlxTween.tween(skipTxt, {alpha: 0}, 0.5, { startDelay: 0.2, ease: FlxEase.quadInOut, - onComplete: function(twn:FlxTween) { + onComplete: _ -> { remove(skipTxt, true); skipTxt.destroy(); } @@ -90,46 +85,42 @@ class DenpaState extends MusicBeatState FlxTransitionableState.skipNextTransOut = true; switch (chooseYerIntroMate){ case 0: - FlxG.sound.play(Paths.sound('denpa')); + FlxG.sound.play(Paths.sound('denpa', 'splash')); FlxTween.tween(logo, {alpha: 1}, 0.95, { ease: FlxEase.quadInOut, - onComplete: function(twn:FlxTween) { + onComplete: _ -> { FlxTween.tween(logo, {alpha: 0}, 2, { ease: FlxEase.quadInOut, - onComplete: function(twn:FlxTween) { - goToTitle(); - } + onComplete: _ -> goToTitle() }); } }); case 1: - FlxG.sound.play(Paths.sound('denpa')); + FlxG.sound.play(Paths.sound('denpa', 'splash')); logo.scale.set(0.1,0.1); logo.updateHitbox(); logo.screenCenter(); FlxTween.tween(logo, {alpha: 1, "scale.x": 1, "scale.y": 1,}, 0.95, { ease: FlxEase.quadInOut, - onComplete: function(twn:FlxTween) { + onComplete: _ -> { logo.updateHitbox(); logo.screenCenter(); FlxTween.tween(logo, {alpha: 0, "scale.x": 8, "scale.y": 8}, 2, { ease: FlxEase.quadInOut, - onComplete: function(twn:FlxTween) { - goToTitle(); - } + onComplete: _ -> goToTitle() }); } }); case 9999: - FlxG.sound.play(Paths.sound('denpa')); + FlxG.sound.play(Paths.sound('denpa', 'splash')); FlxTween.tween(logo, {alpha: 1}, 0.95, { ease: FlxEase.quadInOut, - onComplete: function(twn:FlxTween) { + onComplete: _ -> { FlxG.sound.pause(); - FlxG.sound.play(Paths.sound('explosion')); + FlxG.sound.play(Paths.sound('explosion', 'splash')); for (i in 0...5) { var kaboom:FlxSprite = new FlxSprite(); - kaboom.frames = Paths.getSparrowAtlas('explosion'); + kaboom.frames = Paths.getSparrowAtlas('explosion', 'splash'); kaboom.animation.addByPrefix('boom', 'kaboom', 16, false); kaboom.animation.play('boom'); kaboom.scrollFactor.set(); @@ -140,27 +131,23 @@ class DenpaState extends MusicBeatState add(kaboom); FlxTween.tween(kaboom, {alpha: 0}, 1, { ease: FlxEase.quadOut, - onComplete: function(twn:FlxTween) { - kaboom.kill(); + onComplete: _ -> { + remove(kaboom, true); kaboom.destroy(); } }); } FlxTween.tween(logo, {y: logo.y - 250}, 0.2, { ease: FlxEase.quadInOut, - onComplete: function(twn:FlxTween) { - FlxTween.tween(logo, {y: 15000, x: logo.x + 500}, 1.8, { - onComplete: function(twnFlxTween) { - goToTitle(); - } - }); + onComplete: _ -> { + FlxTween.tween(logo, {y: 15000, x: logo.x + 500}, 1.8, {onComplete: _ -> goToTitle()}); } }); } }); case 2: for (i in 0...80) { - var logoPiece:FlxSprite = new FlxSprite().loadGraphic(Paths.image('loader/' + 'row-' + (i+1) + '-column-1', null, false)); + var logoPiece:FlxSprite = new FlxSprite().loadGraphic(Paths.image('loader/' + 'row-' + (i+1) + '-column-1', 'splash', false)); logoPiece.scrollFactor.set(); logoPiece.screenCenter(); logoPiece.alpha = 0; @@ -168,309 +155,252 @@ class DenpaState extends MusicBeatState logoPiece.x = logo.x + 1*i + FlxG.random.int(-100,100); logoPiece.active = false; add(logoPiece); - FlxTween.tween(logoPiece, {alpha: 1, x: logo.x}, 0.01 + i/34, { - ease: FlxEase.quadInOut - }); + FlxTween.tween(logoPiece, {alpha: 1, x: logo.x}, 0.01 + i/34, {ease: FlxEase.quadInOut}); } - FlxG.sound.play(Paths.sound('denpa')); - new FlxTimer().start(2, function(tmr:FlxTimer) - { - goToTitle(); - }); + FlxG.sound.play(Paths.sound('denpa', 'splash')); + new FlxTimer().start(2, _ -> goToTitle()); case 3: logo.x = -1000; - FlxG.sound.play(Paths.sound('denpa')); + FlxG.sound.play(Paths.sound('denpa', 'splash')); FlxTween.tween(logo, {alpha: 1, x: FlxG.width/2 - 691/2}, 0.95, { ease: FlxEase.quadInOut, - onComplete: function(twn:FlxTween) { + onComplete: _ -> { FlxTween.tween(logo, {alpha: 0, x: FlxG.width + 1000}, 2, { ease: FlxEase.quadInOut, - onComplete: function(twn:FlxTween) { - goToTitle(); - } + onComplete: _ -> goToTitle() }); } }); case 4: logo.y = -500; - FlxG.sound.play(Paths.sound('denpa')); + FlxG.sound.play(Paths.sound('denpa', 'splash')); FlxTween.tween(logo, {alpha: 1, y: FlxG.height/2 - 476/2}, 0.95, { ease: FlxEase.quadInOut, - onComplete: function(twn:FlxTween) { + onComplete: _ -> { FlxTween.tween(logo, {alpha: 0, y: FlxG.height + 500}, 2, { ease: FlxEase.quadInOut, - onComplete: function(twn:FlxTween) { - goToTitle(); - } + onComplete: _ -> goToTitle() }); } }); #if desktop case 666: - FlxG.sound.play(Paths.sound('denpa')); + FlxG.sound.play(Paths.sound('denpa', 'splash')); FlxTween.tween(logo, {alpha: 1}, 0.95, { ease: FlxEase.quadInOut, - onComplete: function(twn:FlxTween) { + onComplete: _ -> { FlxG.sound.pause(); - FlxG.sound.play(Paths.sound('JON_JUIMPSCARE')); - jonScare = new FlxSprite().loadGraphic(Paths.image('JONJUMPSCARE', null, false)); + FlxG.sound.play(Paths.sound('JON_JUIMPSCARE', 'splash')); + jonScare = new FlxSprite().loadGraphic(Paths.image('JONJUMPSCARE', 'splash', false)); jonScare.scrollFactor.set(); jonScare.screenCenter(); add(jonScare); - logo.kill(); + remove(logo, true); logo.destroy(); - new FlxTimer().start(2.66, function(tmr:FlxTimer) - { - var random:Bool = FlxG.random.bool(10); - if (!random) { - var gameOver:FlxSprite = new FlxSprite().loadGraphic(Paths.image('fnaf1dead', null, false)); - gameOver.scrollFactor.set(); - gameOver.screenCenter(); - add(gameOver); - jonScare.kill(); - jonScare.destroy(); - FlxG.sound.pause(); - new FlxTimer().start(3, function(tmr:FlxTimer) + new FlxTimer().start(2.66, _ -> + { + var random:Bool = FlxG.random.bool(10); + if (!random) { + var gameOver:FlxSprite = new FlxSprite().loadGraphic(Paths.image('fnaf1dead', 'splash', false)); + gameOver.scrollFactor.set(); + gameOver.screenCenter(); + add(gameOver); + remove(jonScare, true); + jonScare.destroy(); + FlxG.sound.pause(); + new FlxTimer().start(3, _ -> System.exit(0)); + } else { + var randomInt:Int = FlxG.random.int(0,2); + switch (randomInt) { + case 0: + FlxG.sound.pause(); + remove(jonScare, true); + jonScare.destroy(); + var soul:FlxSprite = new FlxSprite().loadGraphic(Paths.image('soul', 'splash', false)); + soul.scrollFactor.set(); + soul.scale.set(3,3); + soul.updateHitbox(); + soul.screenCenter(); + soul.antialiasing = false; + soul.y += 150; + add(soul); + new FlxTimer().start(1, _ -> { - System.exit(0); - }); - } else { - var randomInt:Int = FlxG.random.int(0,2); - switch (randomInt) { - case 0: - FlxG.sound.pause(); - jonScare.kill(); - jonScare.destroy(); - var soul:FlxSprite = new FlxSprite().loadGraphic(Paths.image('soul', null, false)); - soul.scrollFactor.set(); - soul.scale.set(3,3); - soul.updateHitbox(); - soul.screenCenter(); - soul.antialiasing = false; - soul.y += 150; - add(soul); - new FlxTimer().start(1, function(tmr:FlxTimer){ - FlxG.sound.play(Paths.sound('soulbreak')); - soul.kill(); - soul.destroy(); - var brokenSoul:FlxSprite = new FlxSprite().loadGraphic(Paths.image('brokensoul', null, false)); - brokenSoul.scrollFactor.set(); - brokenSoul.scale.set(3,3); - brokenSoul.updateHitbox(); - brokenSoul.screenCenter(); - brokenSoul.antialiasing = false; - brokenSoul.y += 150; - add(brokenSoul); - new FlxTimer().start(1.3, function(tmr:FlxTimer) - { - brokenSoul.kill(); - brokenSoul.destroy(); - for (i in 0...3) { - var soulShard:FlxSprite = new FlxSprite().loadGraphic(Paths.image('shard' + (i+1), null, false)); - soulShard.scrollFactor.set(); - soulShard.scale.set(3,3); - soulShard.updateHitbox(); - soulShard.screenCenter(); - soulShard.antialiasing = false; - soulShard.y += 150; - soulShard.velocity.x = FlxG.random.int(-455,455); - soulShard.velocity.y = FlxG.random.int(55,755); - FlxTween.tween(soulShard, {alpha: 0}, FlxG.random.float(0.1,1), { - ease: FlxEase.quadInOut - }); - add(soulShard); + FlxG.sound.play(Paths.sound('soulbreak', 'splash')); + remove(soul, true); + soul.destroy(); + var brokenSoul:FlxSprite = new FlxSprite().loadGraphic(Paths.image('brokensoul', 'splash', false)); + brokenSoul.scrollFactor.set(); + brokenSoul.scale.set(3,3); + brokenSoul.updateHitbox(); + brokenSoul.screenCenter(); + brokenSoul.antialiasing = false; + brokenSoul.y += 150; + add(brokenSoul); + new FlxTimer().start(1.3, _ -> + { + remove(brokenSoul, true); + brokenSoul.destroy(); + var velY = 755; + var velX = 455; + var durs:Array = [0.1, 1]; + for (i in 0...6) { + if (i == 3) { + velY = 255; + velX = 55; + durs = [0.3, 1.3]; + } + var soulShard:FlxSprite = new FlxSprite().loadGraphic(Paths.image('shard' + Math.min(4, Math.max(i+1 % 5, 1)), 'splash', false)); + soulShard.scrollFactor.set(); + soulShard.scale.set(3,3); + soulShard.updateHitbox(); + soulShard.screenCenter(); + soulShard.antialiasing = false; + soulShard.y += 150; + soulShard.velocity.x = FlxG.random.int(-velX, velX); + soulShard.velocity.y = FlxG.random.int(55, velY); + FlxTween.tween(soulShard, {alpha: 0}, FlxG.random.float(durs[0], durs[1]), { + ease: FlxEase.quadInOut, + onComplete: _ -> { + remove(soulShard, true); + soulShard.destroy(); } - for (i in 0...3) { - var soulShard:FlxSprite = new FlxSprite().loadGraphic(Paths.image('shard' + (i+1), null, false)); - soulShard.scrollFactor.set(); - soulShard.scale.set(3,3); - soulShard.updateHitbox(); - soulShard.screenCenter(); - soulShard.antialiasing = false; - soulShard.y += 150; - soulShard.velocity.x = FlxG.random.int(-55,55); - soulShard.velocity.y = FlxG.random.int(55,255); - FlxTween.tween(soulShard, {alpha: 0}, FlxG.random.float(0.3,1.3), { - ease: FlxEase.quadInOut - }); - add(soulShard); - } - new FlxTimer().start(1.6, function(tmr:FlxTimer) - { - FlxG.sound.play(Paths.sound('undertale-game-over')); - var gameOver:FlxSprite = new FlxSprite().loadGraphic(Paths.image('undertaledead', null, false)); - gameOver.scrollFactor.set(); - gameOver.screenCenter(); - gameOver.antialiasing = false; - gameOver.y -= 200; - gameOver.alpha = 0; - add(gameOver); - FlxTween.tween(gameOver, {alpha: 1}, 0.95, { - ease: FlxEase.quadInOut - }); - new FlxTimer().start(2.76, function(tmr:FlxTimer) - { - var text = new FlxTypeText(0, 0, 0, "DONT GIVE UP"); - text.scrollFactor.set(); - text.setFormat(Paths.font("determination.otf"), 36, FlxColor.WHITE, CENTER, FlxTextBorderStyle.SHADOW, FlxColor.BLACK); - text.screenCenter(); - text.y = gameOver.y + 350; - text.cursorBlinkSpeed = 0; - text.antialiasing = false; - text.x -= 220/2; - add(text); - text.start(0.06); - new FlxTimer().start(1, function(tmr:FlxTimer) - { - var text = new FlxTypeText(0, 0, 0, "STAY DETERMINED"); - text.scrollFactor.set(); - text.setFormat(Paths.font("determination.otf"), 36, FlxColor.WHITE, CENTER, FlxTextBorderStyle.SHADOW, FlxColor.BLACK); - text.screenCenter(); - text.y = gameOver.y + 400; - text.cursorBlinkSpeed = 0; - text.antialiasing = false; - text.x -= 274/2; - add(text); - text.start(0.06); - }); - }); - new FlxTimer().start(8.4, function(tmr:FlxTimer) - { - System.exit(0); - }); - }); }); - }); - case 1: - FlxG.sound.pause(); - FlxG.sound.play(Paths.sound('wasted')); - var wasted:FlxSprite = new FlxSprite().loadGraphic(Paths.image('wasted', null, false)); - wasted.scrollFactor.set(); - wasted.screenCenter(); - wasted.alpha = 0; - add(wasted); - jonScare.kill(); - jonScare.destroy(); - FlxTween.tween(wasted, {alpha: 1}, 0.3, { - ease: FlxEase.quadInOut - }); - new FlxTimer().start(6, function(tmr:FlxTimer) + add(soulShard); + } + new FlxTimer().start(1.6, _ -> { - System.exit(0); - }); - case 2: - FlxG.sound.pause(); - FlxG.sound.play(Paths.sound('ourple')); - for (i in 0...4) { - var ourple:FlxSprite = new FlxSprite(); - ourple.frames = Paths.getSparrowAtlas('ourple'); - ourple.animation.addByPrefix('dance', 'dance', 24, true); - ourple.animation.play('dance'); - ourple.scrollFactor.set(); - ourple.screenCenter(); - ourple.x = -250 + (450*i); - ourple.y = -200; - add(ourple); - } - for (i in 0...4) { - var ourple:FlxSprite = new FlxSprite(); - ourple.frames = Paths.getSparrowAtlas('ourple'); - ourple.animation.addByPrefix('dance', 'dance', 24, true); - ourple.animation.play('dance'); - ourple.scrollFactor.set(); - ourple.screenCenter(); - ourple.x = -250 + (450*i); - ourple.y = 200; - add(ourple); - } - for (i in 0...4) { - var ourple:FlxSprite = new FlxSprite(); - ourple.frames = Paths.getSparrowAtlas('ourple'); - ourple.animation.addByPrefix('dance', 'dance', 24, true); - ourple.animation.play('dance'); - ourple.scrollFactor.set(); - ourple.screenCenter(); - ourple.x = -250 + (450*i); - ourple.y = 600; - add(ourple); - } - jonScare.kill(); - jonScare.destroy(); - new FlxTimer().start(9, function(tmr:FlxTimer) - { - System.exit(0); + FlxG.sound.play(Paths.sound('undertale-game-over', 'splash')); + var gameOver:FlxSprite = new FlxSprite().loadGraphic(Paths.image('undertaledead', 'splash', false)); + gameOver.scrollFactor.set(); + gameOver.screenCenter(); + gameOver.antialiasing = false; + gameOver.y -= 200; + gameOver.alpha = 0; + add(gameOver); + FlxTween.tween(gameOver, {alpha: 1}, 0.95, {ease: FlxEase.quadInOut}); + new FlxTimer().start(2.76, function(tmr:FlxTimer) + { + var text = new FlxTypeText(0, 0, 0, "DONT GIVE UP"); + text.scrollFactor.set(); + text.setFormat(Paths.font("determination.otf"), 36, FlxColor.WHITE, CENTER, FlxTextBorderStyle.SHADOW, FlxColor.BLACK); + text.screenCenter(); + text.y = gameOver.y + 350; + text.cursorBlinkSpeed = 0; + text.antialiasing = false; + text.x -= 220/2; + add(text); + text.start(0.06); + new FlxTimer().start(1, function(tmr:FlxTimer) + { + var text = new FlxTypeText(0, 0, 0, "STAY DETERMINED"); + text.scrollFactor.set(); + text.setFormat(Paths.font("determination.otf"), 36, FlxColor.WHITE, CENTER, FlxTextBorderStyle.SHADOW, FlxColor.BLACK); + text.screenCenter(); + text.y = gameOver.y + 400; + text.cursorBlinkSpeed = 0; + text.antialiasing = false; + text.x -= 274/2; + add(text); + text.start(0.06); + }); + }); + new FlxTimer().start(8.4, _ -> System.exit(0)); }); - } + }); + }); + case 1: + FlxG.sound.pause(); + FlxG.sound.play(Paths.sound('wasted', 'splash')); + var wasted:FlxSprite = new FlxSprite().loadGraphic(Paths.image('wasted', 'splash', false)); + wasted.scrollFactor.set(); + wasted.screenCenter(); + wasted.alpha = 0; + add(wasted); + remove(jonScare, true); + jonScare.destroy(); + FlxTween.tween(wasted, {alpha: 1}, 0.3, {ease: FlxEase.quadInOut}); + new FlxTimer().start(6, _ -> System.exit(0)); + case 2: + FlxG.sound.pause(); + FlxG.sound.play(Paths.sound('ourple', 'splash')); + var ourple:FlxBackdrop = new FlxBackdrop(Paths.image('ourple', 'splash'), XY, 0, 0); + ourple.frames = Paths.getSparrowAtlas('ourple', 'splash'); + ourple.animation.addByPrefix('dance', 'dance', 24, true); + ourple.animation.play('dance'); + ourple.scrollFactor.set(); + ourple.acceleration.set(700, 700); + new FlxTimer().start(0.5, tmr -> { + ourple.acceleration.y *= -1.2; + tmr.reset(0.5); + }); + add(ourple); + remove(jonScare, true); + jonScare.destroy(); + new FlxTimer().start(9, _ -> System.exit(0)); } - }); + } + }); } }); #end case 5: - FlxG.sound.play(Paths.sound('denpa')); + FlxG.sound.play(Paths.sound('denpa', 'splash')); logo.scale.set(8,8); logo.updateHitbox(); logo.screenCenter(); FlxTween.tween(logo, {alpha: 1, "scale.x": 1, "scale.y": 1,}, 0.95, { ease: FlxEase.quadInOut, - onComplete: function(twn:FlxTween) { + onComplete: _ -> { logo.updateHitbox(); logo.screenCenter(); FlxTween.tween(logo, {alpha: 0, "scale.x": 0.1, "scale.y": 0.1}, 2, { ease: FlxEase.quadInOut, - onComplete: function(twn:FlxTween) { - goToTitle(); - } + onComplete: _ -> goToTitle() }); } }); case 6: logo.x = 1000; - FlxG.sound.play(Paths.sound('denpa')); + FlxG.sound.play(Paths.sound('denpa', 'splash')); FlxTween.tween(logo, {alpha: 1, x: FlxG.width/2 - 691/2}, 0.95, { ease: FlxEase.quadInOut, - onComplete: function(twn:FlxTween) { + onComplete: _ -> { FlxTween.tween(logo, {alpha: 0, x: FlxG.width - 1000}, 2, { ease: FlxEase.quadInOut, - onComplete: function(twn:FlxTween) { - goToTitle(); - } + onComplete: _ -> goToTitle() }); } }); case 7: logo.y = 500; - FlxG.sound.play(Paths.sound('denpa')); + FlxG.sound.play(Paths.sound('denpa', 'splash')); FlxTween.tween(logo, {alpha: 1, y: FlxG.height/2 - 476/2}, 0.95, { ease: FlxEase.quadInOut, - onComplete: function(twn:FlxTween) { + onComplete: _ -> { FlxTween.tween(logo, {alpha: 0, y: FlxG.height - 500}, 2, { ease: FlxEase.quadInOut, - onComplete: function(twn:FlxTween) { - goToTitle(); - } + onComplete: _ -> goToTitle() }); } }); case 8: - FlxG.sound.play(Paths.sound('denpa')); + FlxG.sound.play(Paths.sound('denpa', 'splash')); FlxTween.tween(logo, {alpha: 1, angle: -12}, 0.95, { ease: FlxEase.quadInOut, - onComplete: function(twn:FlxTween) { + onComplete: _ -> { FlxTween.tween(logo, {alpha: 0, angle: 12}, 2, { ease: FlxEase.quadInOut, - onComplete: function(twn:FlxTween) { - goToTitle(); - } + onComplete: _ -> goToTitle() }); } }); case 9: - FlxG.sound.play(Paths.sound('dennad')); + FlxG.sound.play(Paths.sound('dennad', 'splash')); FlxTween.tween(logo, {alpha: 1}, 0.95, { ease: FlxEase.quadInOut, - onComplete: function(twn:FlxTween) { - var circle:FlxSprite = new FlxSprite().loadGraphic(Paths.image('bigCircle', null, false)); + onComplete: _ -> { + var circle:FlxSprite = new FlxSprite().loadGraphic(Paths.image('bigCircle', 'splash', false)); circle.blend = openfl.display.BlendMode.INVERT; circle.scrollFactor.set(); circle.scale.set(0.001,0.001); @@ -480,22 +410,18 @@ class DenpaState extends MusicBeatState add(circle); FlxTween.tween(circle, {alpha: 1, "scale.x": 1.3, "scale.y": 1.3}, 0.95, { ease: FlxEase.expoOut, - onComplete: function(twn:FlxTween) { - goToTitle(); - } + onComplete: _ -> goToTitle() }); } }); default: - FlxG.sound.play(Paths.sound('denpa')); + FlxG.sound.play(Paths.sound('denpa', 'splash')); FlxTween.tween(logo, {alpha: 1}, 0.95, { ease: FlxEase.quadInOut, - onComplete: function(twn:FlxTween) { + onComplete: _ -> { FlxTween.tween(logo, {alpha: 0}, 2, { ease: FlxEase.quadInOut, - onComplete: function(twn:FlxTween) { - goToTitle(); - } + onComplete: _ -> goToTitle() }); } }); diff --git a/source/DialogueBoxDenpa.hx b/source/DialogueBoxDenpa.hx index af2427c..4111cc9 100644 --- a/source/DialogueBoxDenpa.hx +++ b/source/DialogueBoxDenpa.hx @@ -272,9 +272,7 @@ class DialogueBoxDenpa extends FlxSpriteGroup if(PlayerSettings.player1.controls.ACCEPT) { if(!daText.finishedText) { if(daText != null) { - daText.killTheTimer(); - daText.kill(); - remove(daText); + remove(daText, true); daText.destroy(); } daText = new Alphabet(DEFAULT_TEXT_X, DEFAULT_TEXT_Y, textToType, false, true, 0.0, 0.7); @@ -297,10 +295,8 @@ class DialogueBoxDenpa extends FlxSpriteGroup box.animation.curAnim.curFrame = box.animation.curAnim.frames.length - 1; box.animation.curAnim.reverse(); - daText.kill(); - remove(daText); + remove(daText, true); daText.destroy(); - daText = null; updateBoxOffsets(box); FlxG.sound.music.fadeOut(1, 0); } else { @@ -370,19 +366,15 @@ class DialogueBoxDenpa extends FlxSpriteGroup } } else { //Dialogue ending if(box != null && box.animation.curAnim.curFrame <= 0) { - box.kill(); - remove(box); + remove(box, true); box.destroy(); - box = null; } if(bgFade != null) { bgFade.alpha -= 0.5 * elapsed; if(bgFade.alpha == 0) { - bgFade.kill(); - remove(bgFade); + remove(bgFade, true); bgFade.destroy(); - bgFade = null; } } @@ -405,14 +397,13 @@ class DialogueBoxDenpa extends FlxSpriteGroup for (i in 0...arrayCharacters.length) { var leChar:DialogueCharacter = arrayCharacters[0]; if(leChar != null) { + remove(leChar, true); arrayCharacters.remove(leChar); - leChar.kill(); - remove(leChar); leChar.destroy(); } } finishThing(); - kill(); + destroy(); } } super.update(elapsed); diff --git a/source/FreeplaySectionSubstate.hx b/source/FreeplaySectionSubstate.hx index 3d59b1a..6957271 100644 --- a/source/FreeplaySectionSubstate.hx +++ b/source/FreeplaySectionSubstate.hx @@ -133,7 +133,7 @@ class FreeplaySectionSubstate extends MusicBeatSubstate { bgScroll2.visible = true; } for (spr in funnyArray) { - spr.kill(); + remove(spr, true); funnyArray.remove(spr); spr.destroy(); } diff --git a/source/FreeplayState.hx b/source/FreeplayState.hx index fc2b198..d03ac65 100644 --- a/source/FreeplayState.hx +++ b/source/FreeplayState.hx @@ -72,7 +72,7 @@ class FreeplayState extends MusicBeatState override function create() { Paths.clearUnusedCache(); - Paths.refreshModsMaps(false, true, true); + Paths.refreshModsMaps(true, true, true); instance = this; persistentUpdate = true; @@ -525,8 +525,8 @@ class FreeplayState extends MusicBeatState funnyText.setFormat("VCR OSD Mono", 64, FlxColor.RED, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); add(funnyText); FlxTween.tween(funnyText, {alpha: 0}, 0.9, { - onComplete: function(tween:FlxTween) - { + onComplete: _ -> { + remove(funnyText, true); funnyText.destroy(); } }); @@ -597,8 +597,8 @@ class FreeplayState extends MusicBeatState funnyText.setFormat("VCR OSD Mono", 64, FlxColor.RED, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); add(funnyText); FlxTween.tween(funnyText, {alpha: 0}, 0.9, { - onComplete: function(tween:FlxTween) - { + onComplete: _ -> { + remove(funnyText, true); funnyText.destroy(); } }); diff --git a/source/FunkinLua.hx b/source/FunkinLua.hx index afbd9dd..dda6194 100644 --- a/source/FunkinLua.hx +++ b/source/FunkinLua.hx @@ -1437,8 +1437,8 @@ class FunkinLua { } if(destroy) { - sprite.destroy(); PlayState.instance.modchartSprites.remove(tag); + sprite.destroy(); } }); @@ -1967,8 +1967,8 @@ class FunkinLua { } if(destroy) { - text.destroy(); PlayState.instance.modchartTexts.remove(tag); + text.destroy(); } }); @@ -2299,23 +2299,23 @@ class FunkinLua { return; } - var pee:ModchartText = PlayState.instance.modchartTexts.get(tag); - pee.kill(); - if(pee.wasAdded) { - PlayState.instance.remove(pee, true); + var text:ModchartText = PlayState.instance.modchartTexts.get(tag); + text.kill(); + if(text.wasAdded) { + PlayState.instance.remove(text, true); } - pee.destroy(); + text.destroy(); PlayState.instance.modchartTexts.remove(tag); } function resetSpriteTag(tag:String) { if (PlayState.instance.modchartSprites.exists(tag)) { - var pee:ModchartSprite = PlayState.instance.modchartSprites.get(tag); - pee.kill(); - if(pee.wasAdded) { - PlayState.instance.remove(pee, true); + var spr:ModchartSprite = PlayState.instance.modchartSprites.get(tag); + spr.kill(); + if(spr.wasAdded) { + PlayState.instance.remove(spr, true); } - pee.destroy(); + spr.destroy(); PlayState.instance.modchartSprites.remove(tag); return; } diff --git a/source/HUD.hx b/source/HUD.hx index 8bbdc86..ee50a42 100644 --- a/source/HUD.hx +++ b/source/HUD.hx @@ -360,26 +360,24 @@ class HUD extends FlxSpriteGroup { FlxTween.tween(songCard, {x: 0}, 0.7, { startDelay: 0.1, ease: FlxEase.backInOut, - onComplete: function(twn:FlxTween) + onComplete: _ -> { - new FlxTimer().start(1.3/(Conductor.bpm/100)/PlayState.instance.playbackRate, function(tmr:FlxTimer) + new FlxTimer().start(1.3/(Conductor.bpm/100)/PlayState.instance.playbackRate, _ -> { if(songCard != null){ FlxTween.tween(songCard, {x: cardTweenTo}, 0.5, { startDelay: 0.1, ease: FlxEase.backInOut, - onComplete: function(twn:FlxTween) + onComplete: _ -> { - var objects = [songCard, mirrorSongCard, songCreditsTxt, remixCreditsTxt, songNameTxt]; - for (obj in objects) { - obj.kill(); + for (obj in [songCard, mirrorSongCard, songCreditsTxt, remixCreditsTxt, songNameTxt]) { + remove(obj, true); obj.destroy(); } } }); } - var objects = [mirrorSongCard, songCreditsTxt, remixCreditsTxt, songNameTxt]; - for (obj in objects) { + for (obj in [mirrorSongCard, songCreditsTxt, remixCreditsTxt, songNameTxt]) { FlxTween.tween(obj, {x: (obj == mirrorSongCard ? -1202 : cardTweenTo)}, 0.5, { startDelay: 0.1, ease: (obj == songNameTxt ? FlxEase.quadInOut : FlxEase.backInOut) @@ -397,9 +395,8 @@ class HUD extends FlxSpriteGroup { } } else { if (songCard != null) { - var objects = [songCard, mirrorSongCard, songCreditsTxt, remixCreditsTxt, songNameTxt]; - for (obj in objects) { - obj.kill(); + for (obj in [songCard, mirrorSongCard, songCreditsTxt, remixCreditsTxt, songNameTxt]) { + remove(obj, true); obj.destroy(); } } @@ -412,11 +409,7 @@ class HUD extends FlxSpriteGroup { timeTxtTween.cancel(); } timeTxt.scale.set(1.075, 1.075); - timeTxtTween = FlxTween.tween(timeTxt.scale, {x: 1, y: 1}, Conductor.crochet / 1250 / 1.5 / PlayState.instance.playbackRate * PlayState.instance.gfSpeed, { - onComplete: function(twn:FlxTween) { - timeTxtTween = null; - } - }); + timeTxtTween = FlxTween.tween(timeTxt.scale, {x: 1, y: 1}, Conductor.crochet / 1250 / 1.5 / PlayState.instance.playbackRate * PlayState.instance.gfSpeed, {onComplete: _ -> timeTxtTween = null}); } public function scoreTween(daRating:String) { @@ -431,20 +424,8 @@ class HUD extends FlxSpriteGroup { scoreTxt.scale.set(scaler, scaler); leftTxt.scale.set(scaler, scaler); rightTxt.scale.set(scaler, scaler); - scoreTxtTween = FlxTween.tween(scoreTxt.scale, {x: 1, y: 1}, Conductor.crochet / 1250 / 2 / PlayState.instance.playbackRate * PlayState.instance.gfSpeed, { - onComplete: function(twn:FlxTween) { - scoreTxtTween = null; - } - }); - leftTxtTween = FlxTween.tween(leftTxt.scale, {x: 1, y: 1}, Conductor.crochet / 1250 / 2 / PlayState.instance.playbackRate * PlayState.instance.gfSpeed, { - onComplete: function(twn:FlxTween) { - leftTxtTween = null; - } - }); - rightTxtTween = FlxTween.tween(rightTxt.scale, {x: 1, y: 1}, Conductor.crochet / 1250 / 2 / PlayState.instance.playbackRate * PlayState.instance.gfSpeed, { - onComplete: function(twn:FlxTween) { - rightTxtTween = null; - } - }); + scoreTxtTween = FlxTween.tween(scoreTxt.scale, {x: 1, y: 1}, Conductor.crochet / 1250 / 2 / PlayState.instance.playbackRate * PlayState.instance.gfSpeed, {onComplete: _ ->scoreTxtTween = null}); + leftTxtTween = FlxTween.tween(leftTxt.scale, {x: 1, y: 1}, Conductor.crochet / 1250 / 2 / PlayState.instance.playbackRate * PlayState.instance.gfSpeed, {onComplete: _ -> leftTxtTween = null}); + rightTxtTween = FlxTween.tween(rightTxt.scale, {x: 1, y: 1}, Conductor.crochet / 1250 / 2 / PlayState.instance.playbackRate * PlayState.instance.gfSpeed, {onComplete: _ -> rightTxtTween = null}); } } \ No newline at end of file diff --git a/source/HealthIcon.hx b/source/HealthIcon.hx index ae58bd8..703240a 100644 --- a/source/HealthIcon.hx +++ b/source/HealthIcon.hx @@ -57,11 +57,12 @@ class HealthIcon extends FlxSprite } //Internal Bopping + //maybe make this affected by gf speed would be cool i think (takes longer on higher ones) switch (curBopType.toLowerCase()) { case 'swing' | 'snap' | 'none': //Prevent Default Scaling case 'stretch': - setGraphicSize(Std.int(FlxMath.lerp(150 * scaleMult, width, 0.8)),Std.int(FlxMath.lerp(150 * scaleMult, height, 0.8))); + setGraphicSize(Std.int(FlxMath.lerp(150 * scaleMult, width, 0.8)), Std.int(FlxMath.lerp(150 * scaleMult, height, 0.8))); updateHitbox(); case 'old': setGraphicSize(Std.int(FlxMath.lerp(150 * scaleMult, width, 0.50))); @@ -88,9 +89,9 @@ class HealthIcon extends FlxSprite if(curBopType != iconAnim) curBopType = iconAnim; final info:BopInfo = checkInfo(bopInfo); - switch (iconAnim.toLowerCase()) { //Messy Math hell jumpscare (it is more customizeable though) - case 'swing': - if (info.curBeat % info.gfSpeed == 0) { + if (info.curBeat % info.gfSpeed == 0) { + switch (iconAnim.toLowerCase()) { //Messy Math hell jumpscare (it is more customizeable though) + case 'swing': info.curBeat % (info.gfSpeed * 2) == 0 ? { var scaleArray:Array = [1.1 * bopMult, 0.8 / bopMult]; switch(type) { @@ -99,7 +100,7 @@ class HealthIcon extends FlxSprite } scale.set(scaleMult * scaleArray[0], scaleMult * scaleArray[1]); final reverse = type > 0 ? 1 : -1; - + FlxTween.angle(this, 15 * reverse, 0, Conductor.crochet / 1300 / info.playbackRate * info.gfSpeed, {ease: FlxEase.quadOut}); } : { var scaleArray:Array = [1.1 / bopMult, 1.3 * bopMult]; @@ -109,20 +110,18 @@ class HealthIcon extends FlxSprite } scale.set(scaleMult * scaleArray[0], scaleMult * scaleArray[1]); final reverse = type > 0 ? -1 : 1; - + FlxTween.angle(this, 15 * reverse, 0, Conductor.crochet / 1300 / info.playbackRate * info.gfSpeed, {ease: FlxEase.quadOut}); } - + final scaleThing:Float = type == 2 ? 0.75 : 1; FlxTween.tween(this, {'scale.x': scaleMult * scaleThing, 'scale.y': scaleMult * scaleThing}, Conductor.crochet / 1250 / info.playbackRate * info.gfSpeed, {ease: FlxEase.quadOut}); - } - case 'bop': - final scaleThing:Float = type == 2 ? 1 : 1.2; - scale.set((scaleMult * scaleThing) * bopMult, (scaleMult * scaleThing) * bopMult); - case 'old': - setGraphicSize(Std.int((width + 30) * bopMult)); - case 'snap': - if (info.curBeat % info.gfSpeed == 0) { + case 'bop': + final scaleThing:Float = type == 2 ? 1 : 1.2; + scale.set((scaleMult * scaleThing) * bopMult, (scaleMult * scaleThing) * bopMult); + case 'old': + setGraphicSize(Std.int((width + 30) * bopMult)); + case 'snap': info.curBeat % (info.gfSpeed * 2) == 0 ? { var scaleArray:Array = [1.1 * bopMult, 0.8 / bopMult]; switch(type) { @@ -130,7 +129,7 @@ class HealthIcon extends FlxSprite case 2: scaleArray = [0.85 / bopMult, 1.1 * bopMult]; } scale.set(scaleMult * scaleArray[0], scaleMult * scaleArray[1]); - + angle = type > 0 ? 15 : -15; } : { var scaleArray:Array = [1.1 / bopMult, 1.3 * bopMult]; @@ -139,19 +138,19 @@ class HealthIcon extends FlxSprite case 2: scaleArray = [0.85 * bopMult, 0.65 / bopMult]; } scale.set(scaleMult * scaleArray[0], scaleMult * scaleArray[1]); - + angle = type > 0 ? -15 : 15; } - + final scaleThing:Float = type == 2 ? 0.75 : 1; FlxTween.tween(this, {'scale.x': scaleMult * scaleThing, 'scale.y': scaleMult * scaleThing}, Conductor.crochet / 1250 / info.playbackRate * info.gfSpeed, {ease: FlxEase.quadOut}); - } - case 'stretch': - var funny:Float = (info.healthBarPercent * 0.01) + 0.01; - final trueFunny:Float = type > 0 ? (scaleMult * (2 - funny)) * bopMult : (scaleMult * funny) * bopMult; - final stretchValues = type == 2 ? [25, 12] : [50, 25]; - - setGraphicSize(Std.int(width + (stretchValues[0] * trueFunny)),Std.int(height - (stretchValues[1] * trueFunny))); + case 'stretch': + var funny:Float = (info.healthBarPercent * 0.01) + 0.01; + final trueFunny:Float = type > 0 ? (scaleMult * (2 - funny)) * bopMult : (scaleMult * funny) * bopMult; + final stretchValues = type == 2 ? [25, 12] : [50, 25]; + + setGraphicSize(Std.int(width + (stretchValues[0] * trueFunny)),Std.int(height - (stretchValues[1] * trueFunny))); + } } updateHitbox(); } @@ -182,10 +181,9 @@ class HealthIcon extends FlxSprite if(!Paths.fileExists('images/' + name + '.png', IMAGE)) name = 'icons/icon-face'; //Prevents crash from missing icon var file:FlxGraphic = Paths.image(name); - loadGraphic(file); //Load stupidly first for getting the file size - type = (width < 200 ? SINGLE : ((width > 199 && width < 301) ? DEFAULT : WINNING)); + type = (file.width < 200 ? SINGLE : ((file.width > 199 && file.width < 301) ? DEFAULT : WINNING)); - loadGraphic(file, true, Math.floor(width / (type+1)), Math.floor(height)); + loadGraphic(file, true, Math.floor(file.width / (type+1)), file.height); offsets[0] = offsets[1] = (width - 150) / (type+1); var frames:Array = []; for (i in 0...type+1) frames.push(i); diff --git a/source/Main.hx b/source/Main.hx index 6b2a0f2..122f6c7 100644 --- a/source/Main.hx +++ b/source/Main.hx @@ -36,6 +36,12 @@ class Main extends Sprite public function new() { super(); + #if windows + @:functionCode(' + #include + SetProcessDPIAware() + ') + #end if (stage != null) init(); @@ -60,7 +66,7 @@ class Main extends Sprite * * Use `debugVersion` to get the version with build date. */ - public static final denpaEngineVersion:GameVersion = new GameVersion(0, 8, 0, 'e'); + public static final denpaEngineVersion:GameVersion = new GameVersion(0, 8, 1, ''); public static var fpsCounter:FramerateDisplay; public static var ramCount:DebugDisplay; @@ -129,7 +135,6 @@ class Main extends Sprite //negates need for constant clearStored etc FlxG.signals.preStateSwitch.add(() -> { Paths.clearStoredCache(true); - FlxG.bitmap.dumpCache(); FlxG.sound.destroy(false); var cache = cast(Assets.cache, AssetCache); @@ -139,11 +144,11 @@ class Main extends Sprite cache.removeSound(key); cache = null; - gc(); + gc(true); }); FlxG.signals.postStateSwitch.add(() -> { Paths.clearUnusedCache(); - gc(true); + gc(); }); #if html5 diff --git a/source/MainMenuState.hx b/source/MainMenuState.hx index 20139ce..d417329 100644 --- a/source/MainMenuState.hx +++ b/source/MainMenuState.hx @@ -289,8 +289,8 @@ class MainMenuState extends MusicBeatState funnyText.setFormat("VCR OSD Mono", 64, FlxColor.RED, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); add(funnyText); FlxTween.tween(funnyText, {alpha: 0}, 0.6, { - onComplete: function(tween:FlxTween) - { + onComplete: _ -> { + remove(funnyText, true); funnyText.destroy(); } }); diff --git a/source/Note.hx b/source/Note.hx index e2bbb57..2b6683a 100644 --- a/source/Note.hx +++ b/source/Note.hx @@ -93,6 +93,7 @@ class Note extends FlxSprite // Lua shit public var noteSplashDisabled:Bool = false; + public var forceNoteSplash:Bool = false; public var noteSplashTexture:String = null; public var noteSplashHue:Float = 0; public var noteSplashSat:Float = 0; diff --git a/source/PatchState.hx b/source/PatchState.hx index 898e852..9c311d7 100644 --- a/source/PatchState.hx +++ b/source/PatchState.hx @@ -96,6 +96,7 @@ class PatchState extends MusicBeatState var pisspoop:Array> = [ //Ver - Icon name - Update Ver - Update Name - Description - Link - BG Color ['Denpa Engine'], + ['0.8.1', 'widol', "0.8.1", "", 'Additions:\nTimebar intro animations\nAlphabet now supports ¿, ¡, and ñ.\nImprovements:\nWindows builds now utilize DPI Awareness for crisper visuals.\nFixes:\nFreeplay vocals no longer persist into PlayState\nIcon animations now respect gfSpeed\nGhost tapping animations now respect gfSection\nFlxBars now fill smoothly\nFlxBars no longer incorrectly return a roudned percentage\nStrums are now perfectly centered\nThe bold (, ), and . characters are now properly offset in Alphabet\nThe duet and mirror section buttons now work properly on all mania amounts\nMod maps no longer require a game restart to refresh\nNote splashes are no longer incorrectly not spawned when a note has its ratings disabled\ncombo and rating popups no longer happen when the notes ratings are disabled.\nRFV-0.8.1', '', '4DB33C'], ['0.8.0', 'widol', "0.8.0", "", 'This update is too large to list in a reasonable format. Explore the engine to see the changes!', '', '4DB33C'], ['0.7.0b', 'iidol', "0.7.0b", "", 'Press ' + InputFormatter.getKeyName(ClientPrefs.keyBinds.get('accept')[0]) + ' or ' + InputFormatter.getKeyName(ClientPrefs.keyBinds.get('accept')[1]) + ' to view.', 'https://docs.google.com/document/d/1FYPeiyaO2OSlejfHyqvg8VlNH2PbRCJ2PTIDohbZmUI/edit?usp=sharing', '6FD2D2'], ['0.7.0', 'iidol', "0.7.0", "", 'Press ' + InputFormatter.getKeyName(ClientPrefs.keyBinds.get('accept')[0]) + ' or ' + InputFormatter.getKeyName(ClientPrefs.keyBinds.get('accept')[1]) + ' to view.', 'https://docs.google.com/document/d/1FYPeiyaO2OSlejfHyqvg8VlNH2PbRCJ2PTIDohbZmUI/edit?usp=sharing', '6FD2D2'], diff --git a/source/Paths.hx b/source/Paths.hx index b66ab44..a2912a1 100644 --- a/source/Paths.hx +++ b/source/Paths.hx @@ -39,7 +39,11 @@ class Paths [ 'assets/music/freakyMenu.$SOUND_EXT', 'assets/shared/music/breakfast.$SOUND_EXT', - 'assets/shared/music/tea-time.$SOUND_EXT', + 'assets/music/elevator.$SOUND_EXT', + 'assets/sounds/bfBeep.$SOUND_EXT', + 'assets/sounds/scrollMenu.$SOUND_EXT', + 'assets/sounds/confirmMenu.$SOUND_EXT', + 'assets/sounds/cancelMenu.$SOUND_EXT' ]; /// haya I love you for the base cache dump I took to the max /** diff --git a/source/PauseSubState.hx b/source/PauseSubState.hx index 5d25bb7..86eebaa 100644 --- a/source/PauseSubState.hx +++ b/source/PauseSubState.hx @@ -252,8 +252,8 @@ class PauseSubState extends MusicBeatSubstate funnyText.setFormat("VCR OSD Mono", 64, FlxColor.RED, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); add(funnyText); FlxTween.tween(funnyText, {alpha: 0}, 0.6, { - onComplete: function(tween:FlxTween) - { + onComplete: _ -> { + remove(funnyText, true); funnyText.destroy(); } }); @@ -455,7 +455,6 @@ class PauseSubState extends MusicBeatSubstate function regenMenu():Void { for (i in 0...grpMenuShit.members.length) { var obj = grpMenuShit.members[0]; - obj.kill(); grpMenuShit.remove(obj, true); obj.destroy(); } diff --git a/source/PlayState.hx b/source/PlayState.hx index a2c350d..66f3555 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -60,7 +60,7 @@ class PlayState extends MusicBeatState public static var instance:PlayState; //Strum positions?? - public static var STRUM_X = 42; + public static var STRUM_X = 48.5; public static var STRUM_X_MIDDLESCROLL = -278; public static var ratingStuff:Array = [ @@ -486,6 +486,7 @@ class PlayState extends MusicBeatState MusicBeatState.disableManual = true; SoundTestState.isPlaying = false; FlxG.mouse.visible = false; + FreeplayState.destroyFreeplayVocals(); instance = this; debugKeysChart = ClientPrefs.keyBinds.get('debug_1').copy(); debugKeysCharacter = ClientPrefs.keyBinds.get('debug_2').copy(); @@ -516,7 +517,7 @@ class PlayState extends MusicBeatState FlxG.cameras.add(camTint, false); FlxG.cameras.add(camHUD, false); FlxG.cameras.add(camOther, false); - grpNoteSplashes = new FlxTypedGroup((mania+1)*2); //We add a limit so it doesnt cause absurd lag. Since its jsut recyling, we shouldnt have any issues. + grpNoteSplashes = new FlxTypedGroup((mania+1)*3); //We add a limit so it doesnt cause absurd lag. Since its jsut recyling, we shouldnt have any issues. FlxG.cameras.setDefaultDrawTarget(camGame, true); CustomFadeTransition.nextCamera = camOther; @@ -1467,107 +1468,34 @@ class PlayState extends MusicBeatState flashLightSprite = null; } - var modifierArray:Array = []; - - var botspr:ModifierSprite = new ModifierSprite('botplay', camHUD, 0, 0); - botspr.visible = cpuControlled; - add(botspr); - modifierArray.insert(0, botspr); - - var hpgainspr:ModifierSprite = new ModifierSprite('healthgain', camHUD, 0, 1); - if (healthGain != 1) { - hpgainspr.visible = true; - } else { - hpgainspr.visible = false; - } - add(hpgainspr); - modifierArray.insert(0, hpgainspr); - - var hplossspr:ModifierSprite = new ModifierSprite('healthloss', camHUD, 0, 2); - if (healthLoss != 1) { - hplossspr.visible = true; - } else { - hplossspr.visible = false; - } - add(hplossspr); - modifierArray.insert(0, hplossspr); - - var instakillspr:ModifierSprite = new ModifierSprite('instakill', camHUD, 0, 3); - instakillspr.visible = instakillOnMiss; - add(instakillspr); - modifierArray.insert(0, instakillspr); - - var poisonspr:ModifierSprite = new ModifierSprite('poison', camHUD, 1, 0); - poisonspr.visible = poison; - add(poisonspr); - modifierArray.insert(0, poisonspr); - - var practicespr:ModifierSprite = new ModifierSprite('practice', camHUD, 1, 1); - practicespr.visible = practiceMode; - add(practicespr); - modifierArray.insert(0, practicespr); - - var sicksspr:ModifierSprite = new ModifierSprite('sickonly', camHUD, 1, 2); - sicksspr.visible = sickOnly; - add(sicksspr); - modifierArray.insert(0, sicksspr); - - var toVisible:Bool = false; songSpeedType = ClientPrefs.getGameplaySetting('scrolltype','multiplicative'); - switch(songSpeedType) - { - case "multiplicative": - var scrollspr:ModifierSprite = new ModifierSprite('scrolltypemultiplicative', camHUD, 1, 3); - toVisible = (ClientPrefs.getGameplaySetting('scrollspeed', 1) != 1) ? true : false; - scrollspr.visible = toVisible; - add(scrollspr); - modifierArray.insert(0, scrollspr); - case "constant": - var scrollspr:ModifierSprite = new ModifierSprite('scrolltypeconstant', camHUD, 1, 3); - toVisible = true; - scrollspr.visible = toVisible; - add(scrollspr); - modifierArray.insert(0, scrollspr); - } - - var freezespr:ModifierSprite = new ModifierSprite('freeze', camHUD, 2, 0); - freezespr.visible = freeze; - add(freezespr); - modifierArray.insert(0, freezespr); - - var flashlightspr:ModifierSprite = new ModifierSprite('flashlight', camHUD, 2, 1); - flashlightspr.visible = flashLight; - add(flashlightspr); - modifierArray.insert(0, flashlightspr); - - var randomspr:ModifierSprite = new ModifierSprite('randommode', camHUD, 2, 2); - randomspr.visible = randomMode; - add(randomspr); - modifierArray.insert(0, randomspr); - - var ghostspr:ModifierSprite = new ModifierSprite('ghostmode', camHUD, 2, 3); - ghostspr.visible = ghostMode; - add(ghostspr); - modifierArray.insert(0, ghostspr); - - var quartizspr:ModifierSprite = new ModifierSprite('quartiz', camHUD, 3, 0); - quartizspr.visible = quartiz; - add(quartizspr); - modifierArray.insert(0, quartizspr); - - var flipspr:ModifierSprite = new ModifierSprite('flip', camHUD, 3, 1); - flipspr.visible = flip; - add(flipspr); - modifierArray.insert(0, flipspr); - - for (sprite in modifierArray) { - FlxTween.tween(sprite, {alpha: 0}, 0.5, { + final modifierDatas:Array = [ + {name: 'botplay', condition: cpuControlled, xPos:0, yPos:0}, + {name: 'healthgain', condition: healthGain != 1, xPos:0, yPos:1}, + {name: 'healthloss', condition: healthLoss != 1, xPos:0, yPos:2}, + {name: 'instakill', condition: instakillOnMiss, xPos:0, yPos:3}, + {name: 'poison', condition: poison, xPos:1, yPos:0}, + {name: 'practice', condition: practiceMode, xPos:1, yPos:1}, + {name: 'sickonly', condition: sickOnly, xPos:1, yPos:2}, + {name: (songSpeedType == 'constant' ? 'scrolltypeconstant' : 'scrolltypemultiplicative'), condition: (songSpeedType == 'constant' ? true : ClientPrefs.getGameplaySetting('scrollspeed', 1) != 1), xPos:1, yPos:3}, + {name: 'freeze', condition: freeze, xPos:2, yPos:0}, + {name: 'flashlight', condition: flashLight, xPos:2, yPos:1}, + {name: 'randommode', condition: randomMode, xPos:2, yPos:2}, + {name: 'ghostmode', condition: ghostMode, xPos:2, yPos:3}, + {name: 'quartiz', condition: quartiz, xPos:3, yPos:0}, + {name: 'flip', condition: flip, xPos:3, yPos:1} + ]; + + for (data in modifierDatas) { + if (!data.condition) continue; + var spr:ModifierSprite = new ModifierSprite(data.name, camHUD, data.xPos, data.yPos); + add(spr); + FlxTween.tween(spr, {alpha: 0}, 0.5, { ease: FlxEase.quadInOut, startDelay: 2.5/(Conductor.bpm/100), onComplete: _ -> { - sprite.kill(); - modifierArray.remove(sprite); - sprite.destroy(); + remove(spr, true); + spr.destroy(); } }); } @@ -1763,12 +1691,9 @@ class PlayState extends MusicBeatState { camHUD.visible = true; camHUD.alpha = 0; - blackScreen.kill(); remove(blackScreen, true); blackScreen.destroy(); - FlxTween.tween(camHUD, {alpha: 1}, 2.5, { - ease: FlxEase.quadInOut - }); + FlxTween.tween(camHUD, {alpha: 1}, 2.5, {ease: FlxEase.quadInOut}); FlxTween.tween(FlxG.camera, {zoom: defaultStageZoom}, 2.5, { ease: FlxEase.quadInOut, onComplete: _ -> startCountdown() @@ -1778,7 +1703,6 @@ class PlayState extends MusicBeatState schoolIntro(doof); case 'ugh' | 'guns' | 'stress': tankIntro(); - default: callOnHscripts("onCutscene", []); startCountdown(); @@ -1806,8 +1730,6 @@ class PlayState extends MusicBeatState else if(ClientPrefs.settings.get("pauseMusic") != 'None') precacheList.set(Paths.formatToSongPath(ClientPrefs.settings.get("pauseMusic")), 'music'); - precacheList.set('alphabet', 'image'); - //cant use keyPress override because it would count EVERY key FlxG.stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyPress); FlxG.stage.addEventListener(KeyboardEvent.KEY_UP, onKeyRelease); @@ -1818,7 +1740,7 @@ class PlayState extends MusicBeatState if (customTransition && loading != null) { FlxTween.tween(loading, {alpha: 0}, 0.45, { onComplete: _ -> { - loading.kill(); + remove(loading, true); loading.destroy(); } }); @@ -1999,8 +1921,8 @@ class PlayState extends MusicBeatState if(luaDebugGroup.members.length > 34) { var blah = luaDebugGroup.members[34]; - blah.destroy(); luaDebugGroup.remove(blah, true); + blah.destroy(); } luaDebugGroup.insert(0, new DebugLuaText(text, luaDebugGroup)); #end @@ -2577,11 +2499,6 @@ class PlayState extends MusicBeatState var daNote:Note = unspawnNotes[i]; if(daNote.strumTime - 500 < time) { - daNote.active = false; - daNote.visible = false; - daNote.ignoreNote = true; - - daNote.kill(); unspawnNotes.remove(daNote); daNote.destroy(); } @@ -2594,11 +2511,6 @@ class PlayState extends MusicBeatState var daNote:Note = notes.members[i]; if(daNote.strumTime - 500 < time) { - daNote.active = false; - daNote.visible = false; - daNote.ignoreNote = true; - - daNote.kill(); notes.remove(daNote, true); daNote.destroy(); } @@ -2610,11 +2522,6 @@ class PlayState extends MusicBeatState var daNote:Note = sustains.members[i]; if(daNote.strumTime - 500 < time) { - daNote.active = false; - daNote.visible = false; - daNote.ignoreNote = true; - - daNote.kill(); sustains.remove(daNote, true); daNote.destroy(); } @@ -2712,8 +2619,23 @@ class PlayState extends MusicBeatState // Song duration in a float, useful for the time left feature songLength = FlxG.sound.music.length; - FlxTween.tween(hud.timeBar, {alpha: 1}, 0.5, {ease: FlxEase.circOut}); - FlxTween.tween(hud.timeTxt, {alpha: 1}, 0.5, {ease: FlxEase.circOut}); + hud.timeBar.scale.x = 0.01; + hud.timeBarBG.scale.x = 0.01; + if (isPixelStage) { + var loops:Int = 0; + new FlxTimer().start(0.1, tmr -> { + loops++; + hud.timeBarBG.scale.x = hud.timeBar.scale.x = FlxMath.lerp(hud.timeBar.scale.x, 1, 0.7); + hud.timeBar.alpha += 0.2; + hud.timeBarBG.alpha += 0.2; + hud.timeTxt.alpha += 0.2; + if (loops < 5) tmr.reset(0.1); + }); + } else { + FlxTween.tween(hud.timeBar, {alpha: 1, "scale.x": 1}, 0.5, {ease: FlxEase.circOut}); + FlxTween.tween(hud.timeBarBG, {alpha: 1, "scale.x": 1}, 0.5, {ease: FlxEase.circOut}); + FlxTween.tween(hud.timeTxt, {alpha: 1}, 0.5, {ease: FlxEase.circOut}); + } switch(curStage) { @@ -3141,7 +3063,6 @@ class PlayState extends MusicBeatState if(!ClientPrefs.settings.get("lowQuality")) { grpLimoParticles.forEach(function(spr:BGSprite) { if(spr.animation.curAnim.finished) { - spr.kill(); grpLimoParticles.remove(spr, true); spr.destroy(); } @@ -3273,7 +3194,7 @@ class PlayState extends MusicBeatState //not optimized! hell yeah! // but I love optimization :( - if (ClientPrefs.settings.get("scoreDisplay") == 'FNF+') hud.rightTxt.text = 'HP\n${hud.healthBar.percent}%\n\nACCURACY\n${Highscore.floorDecimal(ratingPercent * 100, 2)}%\n\nSCORE\n${FlxStringUtil.formatMoney(songScore, false)}'; + if (ClientPrefs.settings.get("scoreDisplay") == 'FNF+') hud.rightTxt.text = 'HP\n${hud.healthBar.roundedPercent}%\n\nACCURACY\n${Highscore.floorDecimal(ratingPercent * 100, 2)}%\n\nSCORE\n${FlxStringUtil.formatMoney(songScore, false)}'; if (FlxG.keys.anyJustPressed(debugKeysCharacter) && !endingSong && !inCutscene) { persistentUpdate = false; @@ -3351,21 +3272,19 @@ class PlayState extends MusicBeatState doDeathCheck(true); //NOTE SPAWNING BABY!! + //swap to recylcing soon if (unspawnNotes[0] != null) { final spawnTime:Float = (1750/songSpeed)/(FlxMath.bound(camHUD.zoom, null, 1)); //spawns within [time] ms (btw this BARELY edges close enough to the screen to not be too far ahead and not spawning on screen) while (unspawnNotes.length > 0 && unspawnNotes[0].strumTime - Conductor.songPosition < spawnTime * unspawnNotes[0].spawnTimeMult) { - var dunceNote:Note = unspawnNotes[0]; - //dunceNote.active = false; + var dunceNote:Note = unspawnNotes.shift(); if(ghostMode) ghostModeRoutine(dunceNote); if (!dunceNote.isSustainNote) notes.insert(0, dunceNote); else sustains.insert(0, dunceNote); - - unspawnNotes.splice(unspawnNotes.indexOf(dunceNote), 1); } } @@ -3483,13 +3402,9 @@ class PlayState extends MusicBeatState // Kill extremely late notes and cause misses if (Conductor.songPosition > noteKillOffset + daNote.strumTime) { - if (daNote.mustPress && !cpuControlled &&!daNote.ignoreNote && !endingSong && (daNote.tooLate || !daNote.wasGoodHit)) + if (daNote.mustPress && !cpuControlled && !daNote.ignoreNote && !endingSong && (daNote.tooLate || !daNote.wasGoodHit)) noteMiss(daNote); - daNote.active = false; - daNote.visible = false; - - daNote.kill(); group.remove(daNote, true); daNote.destroy(); } @@ -3661,14 +3576,10 @@ class PlayState extends MusicBeatState who.color = FlxColor.WHITE; phillyGlowGradient.kill(); - phillyGlowParticles.forEachAlive(function(particle:PhillyGlowParticle) { - particle.kill(); + phillyGlowParticles.forEach(function(particle:PhillyGlowParticle) { phillyGlowParticles.remove(particle, true); particle.destroy(); }); - phillyGlowParticles.forEachDead(function(particle:PhillyGlowParticle) { - phillyGlowParticles.remove(particle, true); - }); } case 1: //turn on @@ -3717,24 +3628,24 @@ class PlayState extends MusicBeatState var color:FlxColor = phillyLightsColors[curLightEvent]; if(!ClientPrefs.settings.get("lowQuality")) { + phillyGlowParticles.forEachAlive(function(particle:PhillyGlowParticle) { + if (particle.alpha > 0) { + particle.color = color; + } else { + particle.kill(); //refresh recycler + } + }); var particlesNum:Int = FlxG.random.int(8, 12); var width:Float = (2000 / particlesNum); for (j in 0...3) { for (i in 0...particlesNum) { - var particle:PhillyGlowParticle = new PhillyGlowParticle(-400 + width * i + FlxG.random.float(-width / 5, width / 5), phillyGlowGradient.originalY + 200 + (FlxG.random.float(0, 125) + j * 40), color); + var particle = phillyGlowParticles.recycle(PhillyGlowParticle); + particle.start(-400 + width * i + FlxG.random.float(-width / 5, width / 5), phillyGlowGradient.originalY + 200 + (FlxG.random.float(0, 125) + j * 40), color); phillyGlowParticles.add(particle); } } - phillyGlowParticles.forEachAlive(function(particle:PhillyGlowParticle) { - if (particle.alpha > 0) { - particle.color = color; - } - }); - phillyGlowParticles.forEachDead(function(particle:PhillyGlowParticle) { - phillyGlowParticles.remove(particle, true); - }); } phillyGlowGradient.bop(); } @@ -4062,7 +3973,6 @@ class PlayState extends MusicBeatState new FlxTimer().start(val2 / playbackRate, function(tmr:FlxTimer) { FlxTween.tween(tint, {alpha: 0}, 0.25 / playbackRate, { onComplete: _ -> { - tint.kill(); behindGfGroup.remove(tint, true); tint.destroy(); } @@ -4245,11 +4155,11 @@ class PlayState extends MusicBeatState add(sub); new FlxTimer().start(stepsToSecs(val3), function(timer:FlxTimer) { FlxTween.tween(sub, {alpha: 0}, stepsToSecs(1), {ease: FlxEase.quadInOut, onComplete: _ -> { - sub.kill(); + remove(sub, true); sub.destroy(); }}); FlxTween.tween(subBG, {alpha: 0}, stepsToSecs(1), {ease: FlxEase.quadInOut, onComplete: _ -> { - subBG.kill(); + remove(subBG, true); subBG.destroy(); }}); }); @@ -4565,7 +4475,7 @@ class PlayState extends MusicBeatState else { var curDifficulty:Int = -1; - var lastDifficultyName:String = ''; + var lastDifficultyName:String = CoolUtil.difficulties[storyDifficulty]; if(lastDifficultyName == '') { lastDifficultyName = CoolUtil.defaultDifficulty; @@ -4641,10 +4551,6 @@ class PlayState extends MusicBeatState public function KillNotes() { function killNote(note:Note, grp:Dynamic) { - note.active = false; - note.visible = false; - - note.kill(); grp.remove(note, true); note.destroy(); } @@ -4679,7 +4585,7 @@ class PlayState extends MusicBeatState for (i in 0...10) Paths.image('${numsPath}num${i}${skinOverride}'); } - public function popUpScore(note:Note = null):Void + public function popUpScore(note:Note = null):String { final noteDiff:Float = Math.abs(note.strumTime - Conductor.songPosition + ClientPrefs.settings.get("ratingOffset")); final msTiming:Float = note.strumTime - Conductor.songPosition + ClientPrefs.settings.get("ratingOffset"); @@ -4701,36 +4607,33 @@ class PlayState extends MusicBeatState totalNotesHit += (ClientPrefs.settings.get("complexAccuracy") ? -(noteDiff/205 - 1) : 0); score = -100; - if(!note.ratingDisabled) wtfs++; + wtfs++; case "shit": if (sickOnly) health -= 5; totalNotesHit += (ClientPrefs.settings.get("complexAccuracy") ? -(noteDiff/205 - 1) : 0.25); score = -50; - if(!note.ratingDisabled) shits++; + shits++; case "bad": if (sickOnly) health -= 5; totalNotesHit += (ClientPrefs.settings.get("complexAccuracy") ? -(noteDiff/205 - 1) : 0.5); score = 50; - if(!note.ratingDisabled) bads++; + bads++; case "good": if (sickOnly) health -= 5; totalNotesHit += (ClientPrefs.settings.get("complexAccuracy") ? -(noteDiff/205 - 1) : 0.75); score = 200; - if(!note.ratingDisabled) goods++; + goods++; case "sick": totalNotesHit += (ClientPrefs.settings.get("complexAccuracy") ? -(noteDiff/205 - 1) : 0.95); score = 350; - if(!note.ratingDisabled) sicks++; + sicks++; case "perfect": totalNotesHit += (ClientPrefs.settings.get("complexAccuracy") ? -(noteDiff/205 - 1) : 1); score = 600; - if(!note.ratingDisabled) perfects++; + perfects++; } note.rating = daRating; - if((daRating == 'sick' || daRating == 'perfect') && !note.noteSplashDisabled) - spawnNoteSplashOnNote(note); - switch (ratingIntensity) { case 'Default': if(daRating == 'wtf' || daRating == 'shit') { @@ -4749,15 +4652,12 @@ class PlayState extends MusicBeatState if(!practiceMode && !cpuControlled) { songScore += score; - if(!note.ratingDisabled) - { - songHits++; - totalPlayed++; - recalculateRating(); - #if desktop - ratingText = ratingName + " " + ratingFC; - #end - } + songHits++; + totalPlayed++; + recalculateRating(); + #if desktop + ratingText = ratingName + " " + ratingFC; + #end if(ClientPrefs.settings.get("scoreZoom")) hud.scoreTween(daRating); } @@ -4947,6 +4847,8 @@ class PlayState extends MusicBeatState rating.destroy(); } }); + + return daRating; } public function onKeyPress(event:KeyboardEvent):Void @@ -4987,7 +4889,6 @@ class PlayState extends MusicBeatState { for (doubleNote in pressNotes) { if (Math.abs(doubleNote.strumTime - epicNote.strumTime) < 1) { - doubleNote.kill(); if (doubleNote.isSustainNote) sustains.remove(doubleNote, true); else @@ -5104,7 +5005,6 @@ class PlayState extends MusicBeatState //Dupe note remove function noteKillCheck(note:Note, grp:Dynamic) { if (note != note && note.mustPress && note.noteData == note.noteData && Math.abs(note.strumTime - note.strumTime) < 1) { - note.kill(); grp.remove(note, true); note.destroy(); } @@ -5233,10 +5133,11 @@ class PlayState extends MusicBeatState vocals.volume = 0; } - public function gsTap(direction:Int = 1, ?miss:Bool = false):Void //GS Tap Miss + inline function gsTap(direction:Int = 1, ?miss:Bool = false):Void //GS Tap Miss { var missStr:String = miss ? 'miss' : ''; - if ((freeze && boyfriend.stunned) || boyfriend.specialAnim) return; + var char = ((SONG.notes[curSection].gfSection && SONG.notes[curSection].mustHitSection && gf != null) ? gf : boyfriend); + if ((freeze && char.stunned) || char.specialAnim) return; if(ClientPrefs.settings.get("flinching") && miss) { flinching = true; @@ -5251,17 +5152,17 @@ class PlayState extends MusicBeatState }); } - if (!boyfriend.hasMissAnimations) { - boyfriend.missing = miss; + if (!char.hasMissAnimations) { + char.missing = miss; missStr = ''; } var animToPlay:String = 'sing' + Note.keysShit.get(mania).get('anims')[direction] + missStr; var noAnimation:String = 'singUP' + missStr; - if (boyfriend.animOffsets.exists(animToPlay)) { - boyfriend.playAnim(animToPlay, true); + if (char.animOffsets.exists(animToPlay)) { + char.playAnim(animToPlay, true); } else { - boyfriend.playAnim(noAnimation, true); + char.playAnim(noAnimation, true); } } @@ -5309,7 +5210,9 @@ class PlayState extends MusicBeatState function makeCrossFade(_char:Character, _grp:FlxTypedGroup, ?noteTypeThing:Bool = false) { if (ClientPrefs.settings.get("crossFadeMode") == 'Off' || note.isSustainNote || noteTypeThing) return; - new CrossFade(_char, _grp, true); + var crossfade = _grp.recycle(CrossFade); + crossfade.resetShit(_char, true); + _grp.add(crossfade); } if (SONG.notes[curSection] != null) @@ -5369,7 +5272,6 @@ class PlayState extends MusicBeatState if (!note.isSustainNote) { - note.kill(); notes.remove(note, true); note.destroy(); } @@ -5414,19 +5316,23 @@ class PlayState extends MusicBeatState note.wasGoodHit = true; if (!note.isSustainNote) { - note.kill(); notes.remove(note, true); note.destroy(); } return; } - if (!note.isSustainNote) + var rate:String = 'sick'; + if (!note.isSustainNote && !note.ratingDisabled) { combo += 1; if(highestCombo < combo) highestCombo = combo; - popUpScore(note); + rate = popUpScore(note); } + + if (!note.isSustainNote && !note.noteSplashDisabled && (['sick', 'perfect'].contains(rate) || note.forceNoteSplash)) + spawnNoteSplashOnNote(note); + intendedHealth += note.hitHealth * healthGain; var resetFlinch:Bool = false; @@ -5483,9 +5389,13 @@ class PlayState extends MusicBeatState if (ClientPrefs.settings.get("crossFadeMode") == 'Off' || note.isSustainNote || noteTypeThing) return; switch (_gf) { case true: - new CrossFade(gf, gfCrossFade, true); + var crossfade = gfCrossFade.recycle(CrossFade); + crossfade.resetShit(gf, true); + gfCrossFade.add(crossfade); default: - new CrossFade(boyfriend, grpBFCrossFade, false); + var crossfade = grpBFCrossFade.recycle(CrossFade); + crossfade.resetShit(boyfriend, false); + grpBFCrossFade.add(crossfade); } } @@ -5523,7 +5433,6 @@ class PlayState extends MusicBeatState if (!note.isSustainNote) { - note.kill(); notes.remove(note, true); note.destroy(); } @@ -5851,16 +5760,14 @@ class PlayState extends MusicBeatState FlxTween.tween(gunsThing, {alpha: 0}, 0.2 / playbackRate, { ease: FlxEase.quadInOut, onComplete: _ -> { - gunsThing.visible = false; - gunsThing.kill(); + remove(gunsThing, true); gunsThing.destroy(); } }); FlxTween.tween(gunsExtraClouds, {alpha: 0}, 0.35 / playbackRate, { ease: FlxEase.quadInOut, onComplete: _ -> { - gunsExtraClouds.visible = false; - gunsExtraClouds.kill(); + remove(gunsExtraClouds, true); gunsExtraClouds.destroy(); } }); @@ -6404,7 +6311,7 @@ class PlayState extends MusicBeatState } } case 'FPS+': hud.scoreTxt.text = 'Score: ${FlxStringUtil.formatMoney(songScore, false)} | Breaks: $songMisses | Accuracy: ${Highscore.floorDecimal(ratingPercent * 100, 2)}%'; - case 'FNF+': hud.rightTxt.text = 'HP\n${hud.healthBar.percent}%\n\nACCURACY\n${Highscore.floorDecimal(ratingPercent * 100, 2)}%\n\nSCORE\n${FlxStringUtil.formatMoney(songScore, false)}'; + case 'FNF+': hud.rightTxt.text = 'HP\n${hud.healthBar.roundedPercent}%\n\nACCURACY\n${Highscore.floorDecimal(ratingPercent * 100, 2)}%\n\nSCORE\n${FlxStringUtil.formatMoney(songScore, false)}'; case 'Vanilla': hud.rightTxt.text = 'Score:${FlxStringUtil.formatMoney(songScore, false)}'; case 'FNM': hud.rightTxt.text = 'score:${FlxStringUtil.formatMoney(songScore, false)}'; } @@ -6454,7 +6361,9 @@ class PlayState extends MusicBeatState } } + public var autoPositionIcons:Bool = true; public function setIconPositions(?y:Bool = false) { + if (!autoPositionIcons) return; if (y) { iconP1.y = hud.healthBar.y - 75; iconP1Poison.y = iconP1.y + 5; @@ -7151,6 +7060,13 @@ class PlayState extends MusicBeatState } } +@:structInit class ModifierSpriteData { + public var name:String; + public var condition:Bool; + public var xPos:Int; + public var yPos:Int; +} + class ModifierSprite extends FlxSprite { public function new(image:String, camera:FlxCamera, gridPosX:Int, gridPosY:Int) diff --git a/source/Prompt.hx b/source/Prompt.hx index 7f7b182..8f045ba 100644 --- a/source/Prompt.hx +++ b/source/Prompt.hx @@ -112,6 +112,10 @@ class Prompt extends MusicBeatSubstate override function destroy() { open = false; + panel = FlxDestroyUtil.destroy(panel); + panelbg = FlxDestroyUtil.destroy(panelbg); + buttonAccept = FlxDestroyUtil.destroy(buttonAccept); + buttonNo = FlxDestroyUtil.destroy(buttonNo); super.destroy(); } } \ No newline at end of file diff --git a/source/StoryMenuState.hx b/source/StoryMenuState.hx index d145833..a169a20 100644 --- a/source/StoryMenuState.hx +++ b/source/StoryMenuState.hx @@ -272,8 +272,8 @@ class StoryMenuState extends MusicBeatState funnyText.setFormat("VCR OSD Mono", 64, FlxColor.RED, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); add(funnyText); FlxTween.tween(funnyText, {alpha: 0}, 0.6, { - onComplete: function(tween:FlxTween) - { + onComplete: _ -> { + remove(funnyText, true); funnyText.destroy(); } }); @@ -515,7 +515,7 @@ class StoryMenuState extends MusicBeatState } for (text in trackListGrp) { - text.kill(); + text.kill(); //why cant i remove() these texts without them breaking? text.destroy(); } diff --git a/source/TitleState.hx b/source/TitleState.hx index a13ecce..01bbf45 100644 --- a/source/TitleState.hx +++ b/source/TitleState.hx @@ -137,10 +137,10 @@ class TitleState extends MusicBeatState FlxG.save.flush(); MusicBeatState.switchState(new FlashingState()); } else { - new FlxTimer().start(1, function(tmr:FlxTimer) - { + //new FlxTimer().start(1, function(tmr:FlxTimer) + //{ startIntro(); - }); + //}); } } @@ -559,8 +559,10 @@ class TitleState extends MusicBeatState for (i in [credIcon1, credIcon2, credIcon3, credIcon4]) i.visible = true; case 1: - for (i in [credIcon1, credIcon2, credIcon3, credIcon4]) + for (i in [credIcon1, credIcon2, credIcon3, credIcon4]) { + remove(i, true); i.destroy(); + } } #end } @@ -579,8 +581,10 @@ class TitleState extends MusicBeatState remove(credGroup); #if DENPA_WATERMARKS for (i in [credIcon1, credIcon2, credIcon3, credIcon4]) - if (i != null) + if (i != null) { + remove(i, true); i.destroy(); + } #end FlxG.camera.flash(FlxColor.WHITE, 3); diff --git a/source/VanillaBG.hx b/source/VanillaBG.hx index 60a24c4..c4cc9e4 100644 --- a/source/VanillaBG.hx +++ b/source/VanillaBG.hx @@ -19,8 +19,14 @@ class PhillyGlowParticle extends FlxSprite public function new(x:Float, y:Float, color:FlxColor) { super(x, y); + start(x, y, color); + } + + public function start(x:Float, y:Float, color:FlxColor) { + setPosition(x, y); this.color = color; + alpha = 1; loadGraphic(Paths.image('effectSprites/particle')); lifeTime = FlxG.random.float(0.6, 0.9); decay = FlxG.random.float(0.8, 1); @@ -48,8 +54,6 @@ class PhillyGlowParticle extends FlxSprite if(alpha > 0) { scale.set(originalScale * alpha, originalScale * alpha); - } else { - return destroy(); //AMBATUKUM } } super.update(elapsed); diff --git a/source/editors/CharacterEditorState.hx b/source/editors/CharacterEditorState.hx index 7da0741..7d26525 100644 --- a/source/editors/CharacterEditorState.hx +++ b/source/editors/CharacterEditorState.hx @@ -111,7 +111,7 @@ class CharacterEditorState extends MusicBeatState override function create() { Paths.clearUnusedCache(); - Paths.refreshModsMaps(false, true, true); + Paths.refreshModsMaps(true, true, true); if (PlayState.curStage != null && PlayState.curStage != '') currentStage = PlayState.curStage; music = new EditorMusic(); @@ -322,7 +322,6 @@ class CharacterEditorState extends MusicBeatState while(i >= 0) { var memb:FlxBasic = bgLayer.members[i]; if(memb != null) { - memb.kill(); bgLayer.remove(memb, true); memb.destroy(); } @@ -334,7 +333,6 @@ class CharacterEditorState extends MusicBeatState while(i >= 0) { var memb:FlxBasic = frontLayer.members[i]; if(memb != null) { - memb.kill(); frontLayer.remove(memb, true); memb.destroy(); } @@ -346,7 +344,6 @@ class CharacterEditorState extends MusicBeatState while(i >= 0) { var memb:FlxBasic = fuckLayer.members[i]; if(memb != null) { - memb.kill(); fuckLayer.remove(memb, true); memb.destroy(); } @@ -1566,7 +1563,6 @@ class CharacterEditorState extends MusicBeatState while(i >= 0) { var memb:Character = charLayer.members[i]; if(memb != null) { - memb.kill(); charLayer.remove(memb); memb.destroy(); } diff --git a/source/editors/ChartingState.hx b/source/editors/ChartingState.hx index b2c2351..495c79b 100644 --- a/source/editors/ChartingState.hx +++ b/source/editors/ChartingState.hx @@ -301,7 +301,7 @@ class ChartingState extends MusicBeatState { for(listener in mouse_listeners) FlxG.stage.addEventListener(listener, handleMouseInput); Paths.clearUnusedCache(); - Paths.refreshModsMaps(false, true, true); + Paths.refreshModsMaps(true, true, true); if (PlayState.SONG != null) _song = PlayState.SONG; @@ -1139,41 +1139,30 @@ class ChartingState extends MusicBeatState for (note in _song.notes[curSection].sectionNotes) { var boob = note[1]; - if (boob>_song.options.mania){ - boob -= _song.options.mania+1; + if (boob > _song.options.mania){ + boob -= Note.ammo[_song.options.mania]; }else{ - boob += _song.options.mania+1; + boob += Note.ammo[_song.options.mania]; } var copiedNote:Array = [note[0], boob, note[2], note[3]]; duetNotes.push(copiedNote); } - for (i in duetNotes){ - _song.notes[curSection].sectionNotes.push(i); - - } + for (i in duetNotes) + _song.notes[curSection].sectionNotes.push(i); updateGrid(false); }); var mirrorButton:FlxButton = new FlxButton(210, duetButton.y + 40, "Mirror Notes", function() { - //istg this doesnt work on the right side - var duetNotes:Array> = []; for (note in _song.notes[curSection].sectionNotes) { - var boob = note[1]%(Note.ammo[_song.options.mania] * 2); + var boob = note[1] % Note.ammo[_song.options.mania]; boob = _song.options.mania - boob; - if (note[1] > _song.options.mania) boob += _song.options.mania+1; + if (note[1] > _song.options.mania) boob += Note.ammo[_song.options.mania]; note[1] = boob; - //var copiedNote:Array = [note[0], boob, note[2], note[3]]; - //duetNotes.push(copiedNote); - } - - for (i in duetNotes){ - //_song.notes[curSection].sectionNotes.push(i); - } updateGrid(false); @@ -2622,7 +2611,10 @@ class ChartingState extends MusicBeatState selectionArrow.size = GRID_SIZE; } - gridLayer.forEach(obj -> obj.destroy()); + gridLayer.forEach(obj -> { + gridLayer.remove(obj); + obj.destroy(); + }); gridLayer.clear(); gridBG = FlxGridOverlay.create(GRID_SIZE, GRID_SIZE, GRID_SIZE + GRID_SIZE * Note.ammo[_song.options.mania] * 2, Std.int(GRID_SIZE * 32 * zoomList[curZoom])); gridBG.active = false; @@ -2664,7 +2656,10 @@ class ChartingState extends MusicBeatState if (strumLineNotes != null) { - strumLineNotes.forEach(note -> note.destroy()); + strumLineNotes.forEach(note -> { + strumLineNotes.remove(note); + note.destroy(); + }); strumLineNotes.clear(); for (i in 0...(Note.ammo[_song.options.mania] * 2)){ var note:Note.StrumNote = new Note.StrumNote(GRID_SIZE * (i+1), strumLine.y, i % Note.ammo[_song.options.mania], 0); @@ -2995,16 +2990,31 @@ class ChartingState extends MusicBeatState function updateGrid(?updateNext:Bool = true):Void { renderedSustainsMap.clear(); - curRenderedNotes.forEach(note -> note.destroy()); + curRenderedNotes.forEach(note -> { + curRenderedNotes.remove(note, true); + note.destroy(); + }); curRenderedNotes.clear(); - curRenderedSustains.forEach(sus -> sus.destroy()); + curRenderedSustains.forEach(sus -> { + curRenderedSustains.remove(sus, true); + sus.destroy(); + }); curRenderedSustains.clear(); - curRenderedNoteType.forEach(txt -> txt.destroy()); + curRenderedNoteType.forEach(txt -> { + curRenderedNoteType.remove(txt, true); + txt.destroy(); + }); curRenderedNoteType.clear(); if (updateNext) { - nextRenderedNotes.forEach(note -> note.destroy()); + nextRenderedNotes.forEach(note -> { + nextRenderedNotes.remove(note, true); + note.destroy(); + }); nextRenderedNotes.clear(); - nextRenderedSustains.forEach(sus -> sus.destroy()); + nextRenderedSustains.forEach(sus -> { + nextRenderedSustains.remove(sus, true); + sus.destroy(); + }); nextRenderedSustains.clear(); } @@ -3527,8 +3537,8 @@ class ChartingState extends MusicBeatState funnyText.setFormat("VCR OSD Mono", 64, FlxColor.RED, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); add(funnyText); FlxTween.tween(funnyText, {alpha: 0}, 0.6, { - onComplete: function(tween:FlxTween) - { + onComplete: _ -> { + remove(funnyText, true); funnyText.destroy(); } }); diff --git a/source/editors/DialogueCharacterEditorState.hx b/source/editors/DialogueCharacterEditorState.hx index 08ade5b..70902f7 100644 --- a/source/editors/DialogueCharacterEditorState.hx +++ b/source/editors/DialogueCharacterEditorState.hx @@ -414,9 +414,7 @@ class DialogueCharacterEditorState extends MusicBeatState private static var DEFAULT_TEXT:String = 'Lorem ipsum dolor sit amet'; function reloadText() { if(daText != null) { - daText.killTheTimer(); - daText.kill(); - hudGroup.remove(daText); + hudGroup.remove(daText, true); daText.destroy(); } daText = new Alphabet(0, 0, DEFAULT_TEXT, false, true, 0.05, 0.7); diff --git a/source/editors/DialogueEditorState.hx b/source/editors/DialogueEditorState.hx index 823b171..11ec3ef 100644 --- a/source/editors/DialogueEditorState.hx +++ b/source/editors/DialogueEditorState.hx @@ -242,9 +242,7 @@ class DialogueEditorState extends MusicBeatState private static var DEFAULT_BUBBLETYPE:String = "normal"; function reloadText(speed:Float = 0.05, ?bold:Bool = false) { if(daText != null) { - daText.killTheTimer(); - daText.kill(); - remove(daText); + remove(daText, true); daText.destroy(); } diff --git a/source/flixel/ui/FlxBar.hx b/source/flixel/ui/FlxBar.hx index 8b60aaf..1702ef2 100644 --- a/source/flixel/ui/FlxBar.hx +++ b/source/flixel/ui/FlxBar.hx @@ -50,10 +50,15 @@ class FlxBar extends FlxSprite public var killOnEmpty:Bool = false; /** - * The percentage of how full the bar is (a value between 0 and 100) + * The percentage of how full the bar is, as a Float. (a value between 0 and 100) */ public var percent(get, set):Float; + /** + * The percentage of how full the bar is, as an Integer. (a value between 0 and 100) + */ + public var roundedPercent(get, never):Float; + /** * The current value - must always be between min and max */ @@ -217,7 +222,7 @@ class FlxBar extends FlxSprite _filledBarPoint = null; parent = null; - positionOffset = null; + positionOffset = FlxDestroyUtil.put(positionOffset); emptyCallback = null; filledCallback = null; @@ -757,7 +762,7 @@ class FlxBar extends FlxSprite var percent:Float = fraction * _maxPercent; var maxScale:Float = (_fillHorizontal) ? barWidth : barHeight; var scaleInterval:Float = maxScale / numDivisions; - var interval:Float = Math.round(Std.int(fraction * maxScale / scaleInterval) * scaleInterval); + var interval:Float = Math.round((fraction * maxScale / scaleInterval) * scaleInterval); if (_fillHorizontal) { @@ -809,7 +814,7 @@ class FlxBar extends FlxSprite if (frontFrames != null) { _filledFlxRect.copyFromFlash(_filledBarRect).round(); - if (Std.int(percent) > 0) + if (roundedPercent > 0) { _frontFrame = frontFrames.frame.clipTo(_filledFlxRect, _frontFrame); } @@ -852,7 +857,7 @@ class FlxBar extends FlxSprite if (alpha == 0) return; - if (percent > 0 && _frontFrame.type != FlxFrameType.EMPTY) + if (roundedPercent > 0 && _frontFrame.type != FlxFrameType.EMPTY) { for (camera in cameras) { @@ -916,7 +921,8 @@ class FlxBar extends FlxSprite return _maxPercent; } - return Math.floor(((value - min) / range) * _maxPercent); + //Was previously incorrectly rounded. + return ((value - min) / range) * _maxPercent; } function set_percent(newPct:Float):Float @@ -928,6 +934,11 @@ class FlxBar extends FlxSprite return newPct; } + function get_roundedPercent():Float + { + return Math.floor(percent); + } + function set_value(newValue:Float):Float { value = Math.max(min, Math.min(newValue, max)); diff --git a/source/flixel/util/FlxGradient.hx b/source/flixel/util/FlxGradient.hx index 86124c5..a4e4d07 100644 --- a/source/flixel/util/FlxGradient.hx +++ b/source/flixel/util/FlxGradient.hx @@ -111,11 +111,6 @@ class FlxGradient { height = 1; } - - var cacheName = 'gradient:$width:$height:$colors:$chunkSize:$rotation:$interpolate'; - if (FlxG.bitmap.checkCache(cacheName)) - return FlxG.bitmap.get(cacheName).bitmap; - var gradient:GradientMatrix = createGradientMatrix(width, height, colors, chunkSize, rotation); var shape = new Shape(); var interpolationMethod = interpolate ? InterpolationMethod.RGB : InterpolationMethod.LINEAR_RGB; @@ -150,7 +145,6 @@ class FlxGradient data.fillRect(remainingRect, colors[colors.length - 1]); } - FlxG.bitmap.add(data, false, cacheName); return data; }