Skip to content

Commit

Permalink
Merge branch 'develop' into feature/discord-rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
AltronMaxX committed May 29, 2024
2 parents ffdf4f7 + 60d90c6 commit 46b7723
Show file tree
Hide file tree
Showing 27 changed files with 238 additions and 96 deletions.
12 changes: 12 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Add Documentation tag to PR's changing markdown files, or anyhting in the docs folder
Documentation:
- changed-files:
- any-glob-to-any-file:
- any-glob-to-any-file:
- docs/*
- '**/*.md'

# Adds Haxe tag to PR's changing haxe code files
Haxe:
- changed-files:
- any-glob-to-any-file: '**/*.hx'
14 changes: 14 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: "Pull Request Labeler"
on:
- pull_request_target

jobs:
labeler:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
with:
sync-labels: true
7 changes: 7 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
"type": "lime",
"request": "launch"
},
{
// Launch in native/CPP on Windows/OSX/Linux (without compiling)
"name": "Debug",
"type": "lime",
"request": "launch",
"preLaunchTask": null
},
{
// Launch in browser
"name": "HTML5 Debug",
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@ All notable changes will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.3.3] - 2024-05-14
### Changed
- Cleaned up some code in `PlayAnimationSongEvent.hx` (thanks BurgerBalls!)
### Fixed
- Fix Web Loading Bar (thanks lemz1!)
- Don't allow any more inputs when exiting freeplay (thanks gamerbros!)
- Fixed using mouse wheel to scroll on freeplay (thanks JugieNoob!)
- Fixed the reset's of the health icons, score, and notes when re-entering gameplay from gameover (thanks ImCodist!)
- Fixed the chart editor character selector's hitbox width (thanks MadBear422!)
- Fixed camera stutter once a wipe transition to the Main Menu completes (thanks ImCodist!)
- Fixed an issue where hold note would be invisible for a single frame (thanks ImCodist!)
- Fix tween accumulation on title screen when pressing Y multiple times (thanks TheGaloXx!)
- Fix for a game over easter egg so you don't accidentally exit it when viewing
- Fix a crash when querying FlxG.state in the crash handler
- Fix an issue where the Freeplay menu never displays 100% clear
- Chart debug key now properly returns you to the previous chart editor session if you were playtesting a chart (thanks nebulazorua!)
- Hopefully fixed Freeplay crashes on AMD gpu's

## [0.3.2] - 2024-05-03
### Added
- Added `,` and `.` keybinds to the Chart Editor. These place Focus Camera events at the playhead, for the opponent and player respectively.
Expand Down
2 changes: 1 addition & 1 deletion Project.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<!-- _________________________ Application Settings _________________________ -->
<app title="Friday Night Funkin'" file="Funkin" packageName="com.funkin.fnf" package="com.funkin.fnf" main="Main" version="0.3.2" company="ninjamuffin99" />
<app title="Friday Night Funkin'" file="Funkin" packageName="com.funkin.fnf" package="com.funkin.fnf" main="Main" version="0.3.3" company="ninjamuffin99" />
<!--Switch Export with Unique ApplicationID and Icon-->
<set name="APP_ID" value="0x0100f6c013bbc000" />

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Friday Night Funkin'

Friday Night Funkin' is a rhythm game. Built using HaxeFlixel for Ludem Dare 47.
Friday Night Funkin' is a rhythm game. Built using HaxeFlixel for Ludum Dare 47.

This game was made with love to Newgrounds and it's community. Extra love to Tom Fulp.

Expand Down
2 changes: 1 addition & 1 deletion assets
4 changes: 4 additions & 0 deletions docs/COMPILING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@
- HTML5: Compiles without any extra setup
6. If you are targeting for native, you may need to run `lime rebuild PLATFORM` and `lime rebuild PLATFORM -debug`
7. `lime test PLATFORM` ! Add `-debug` to enable several debug features such as time travel (`PgUp`/`PgDn` in Play State).

# Troubleshooting

- During the cloning process, you may experience an error along the lines of `error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)` due to poor connectivity. A common fix is to run ` git config --global http.postBuffer 4096M`.
48 changes: 24 additions & 24 deletions docs/Funkin' Debug Hotkeys.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
# Funkin' Debug Hotkeys

`F4` (EVERYWHERE) - Leave Current State and move to Main Menu
`F5` (EVERYWHERE) - Hot Reload Data Files
Most of this functionality is only available on debug builds of the game!

`Y` (Title Screen) - WOAH
## Any State
- `F2`: ***OVERLAY***: Enables the Flixel debug overlay, which has partial support for scripting.
- `F3`: ***SCREENSHOT***: Takes a screenshot of the game and saves it to the local `screenshots` directory. Works outside of debug builds too!
- `F4`: ***EJECT***: Forcibly switch state to the Main Menu (with no extra transition). Useful if you're stuck in a level and you need to get out!
- `F5`: ***HOT RELOAD***: Forcibly reload the game's scripts and data files, then restart the current state. If any files in the `assets` folder have been modified, the game should process the changes for you! NOTE: Known bug, this does not reset song charts or song scripts, but it should reset everything else (such as stage layout data and character animation data).
- `CTRL-SHIFT-L`: ***FORCE CRASH***: Immediately crash the game with a detailed crash log and a stack trace.

`~` (Main Menu) - Access Debug Menu
## **Play State**
- `H`: ***HIDE UI***: Makes the user interface invisible. Works in Pause Menu, great for screenshots.
- `1`: ***END SONG***: Immediately ends the song and moves to Results Screen on Freeplay, or next song on Story Mode.
- `2`: ***GAIN HEALTH***: Debug function, add 10% to the player's health.
- `3`: ***LOSE HEALTH***: Debug function, subtract 5% to the player's health.
- `9`: NEATO!
- `PAGEUP` (MacOS: `Fn-Up`): ***FORWARDS TIME TRAVEL****: Move forward by 2 sections. Hold SHIFT to move forward by 20 sections instead.
- `PAGEDOWN` (MacOS: `Fn-Down`): ***BACKWARDS TIME TRAVEL****: Move backward by 2 sections. Hold SHIFT to move backward by 20 sections instead.

`U` (Play) - Open Stage Editor State
`H` (Play) - Show/Hide HUD
`1` (Play) - End Song
`2` (Play) - Add 10% Health
`3` (Play) - Subtract 5% Health
`7` (Play) - (NOT WORKING) Open Chart Editor
`8` (Play) - Open Animation Editor
`9` (Play) - (Easter Egg) Classic Health Icon
`PGUP`/`Fn+Up` (Play) - Skip Forward In Time
`PGDN`/`Fn+Down` (Play) - 🦃 That's right, we're going to go BACK IN TIME
## **Freeplay State**
- `F` (Freeplay Menu) - Move to Favorites
- `Q` (Freeplay Menu) - Back one category
- `E` (Freeplay Menu) - Forward one category

`F` (Freeplay Menu) - Move to Favorites
`P` (Freeplay Menu) - Switch to Pico (probably doesn't work)
`T` (Freeplay Menu) - Start typing in search bar
`Q` (Freeplay Menu) - Back one letter
`E` (Freeplay Menu) - Forward one letter
## **Title State**
- `Y` - WOAH

`Arrows` (Stage Editor) - Move Prop
`Ctrl-Z` (Stage Editor) - Undo
`Y` (Stage Editor) - Leave Stage Editor

`H` (Pause Menu) - Hide the Pause Menu UI (good for screenshots!)
## **Main Menu**
- `~`: ***DEBUG****: Opens a menu to access the Chart Editor and other work-in-progress editors. Rebindable in the options menu.
- `CTRL-ALT-SHIFT-W`: ***ALL ACCESS***: Unlocks all songs in Freeplay. Only available on debug builds.
4 changes: 2 additions & 2 deletions hmm.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"name": "funkin.vis",
"type": "git",
"dir": null,
"ref": "98c9db09f0bbfedfe67a84538a5814aaef80bdea",
"ref": "2aa654b974507ab51ab1724d2d97e75726fd7d78",
"url": "https://github.com/FunkinCrew/funkVis"
},
{
Expand Down Expand Up @@ -80,7 +80,7 @@
"name": "hxCodec",
"type": "git",
"dir": null,
"ref": "c0c7f2680cc190c932a549c2e2fdd9b0ba2bd10e",
"ref": "61b98a7a353b7f529a8fec84ed9afc919a2dffdd",
"url": "https://github.com/FunkinCrew/hxCodec"
},
{
Expand Down
8 changes: 4 additions & 4 deletions source/funkin/Conductor.hx
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ class Conductor
else if (currentTimeChange != null && this.songPosition > 0.0)
{
// roundDecimal prevents representing 8 as 7.9999999
this.currentStepTime = FlxMath.roundDecimal((currentTimeChange.beatTime * 4) + (this.songPosition - currentTimeChange.timeStamp) / stepLengthMs, 6);
this.currentStepTime = FlxMath.roundDecimal((currentTimeChange.beatTime * Constants.STEPS_PER_BEAT) + (this.songPosition - currentTimeChange.timeStamp) / stepLengthMs, 6);
this.currentBeatTime = currentStepTime / Constants.STEPS_PER_BEAT;
this.currentMeasureTime = currentStepTime / stepsPerMeasure;
this.currentStep = Math.floor(currentStepTime);
Expand Down Expand Up @@ -564,7 +564,7 @@ class Conductor
if (ms >= timeChange.timeStamp)
{
lastTimeChange = timeChange;
resultStep = lastTimeChange.beatTime * 4;
resultStep = lastTimeChange.beatTime * Constants.STEPS_PER_BEAT;
}
else
{
Expand Down Expand Up @@ -600,7 +600,7 @@ class Conductor
var lastTimeChange:SongTimeChange = timeChanges[0];
for (timeChange in timeChanges)
{
if (stepTime >= timeChange.beatTime * 4)
if (stepTime >= timeChange.beatTime * Constants.STEPS_PER_BEAT)
{
lastTimeChange = timeChange;
resultMs = lastTimeChange.timeStamp;
Expand All @@ -613,7 +613,7 @@ class Conductor
}

var lastStepLengthMs:Float = ((Constants.SECS_PER_MIN / lastTimeChange.bpm) * Constants.MS_PER_SEC) / timeSignatureNumerator;
resultMs += (stepTime - lastTimeChange.beatTime * 4) * lastStepLengthMs;
resultMs += (stepTime - lastTimeChange.beatTime * Constants.STEPS_PER_BEAT) * lastStepLengthMs;

return resultMs;
}
Expand Down
8 changes: 4 additions & 4 deletions source/funkin/graphics/shaders/StrokeShader.hx
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,18 @@ class StrokeShader extends FlxShader

void main()
{
vec4 sample = flixel_texture2D(bitmap, openfl_TextureCoordv);
if (sample.a == 0.) {
vec4 gay = flixel_texture2D(bitmap, openfl_TextureCoordv);
if (gay.a == 0.) {
float w = size.x / openfl_TextureSize.x;
float h = size.y / openfl_TextureSize.y;

if (flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x + w, openfl_TextureCoordv.y)).a != 0.
|| flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x - w, openfl_TextureCoordv.y)).a != 0.
|| flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x, openfl_TextureCoordv.y + h)).a != 0.
|| flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x, openfl_TextureCoordv.y - h)).a != 0.)
sample = color;
gay = color;
}
gl_FragColor = sample;
gl_FragColor = gay;
}
')
public function new(color:FlxColor = 0xFFFFFFFF, width:Float = 1, height:Float = 1)
Expand Down
15 changes: 14 additions & 1 deletion source/funkin/input/Controls.hx
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,14 @@ class Controls extends FlxActionSet
action.inputs[i].inputID = toAdd;
}
hasReplaced = true;
} else if (input.device == KEYBOARD && input.inputID == toAdd) {
// This key is already bound!
if (hasReplaced) {
// Remove the duplicate keybind, don't replace.
action.inputs.remove(input);
} else {
hasReplaced = true;
}
}
}

Expand Down Expand Up @@ -989,6 +997,7 @@ class Controls extends FlxActionSet
for (control in Control.createAll())
{
var inputs:Array<Int> = Reflect.field(data, control.getName());
inputs = inputs.unique();
if (inputs != null)
{
if (inputs.length == 0) {
Expand Down Expand Up @@ -1038,7 +1047,11 @@ class Controls extends FlxActionSet
var inputs = getInputsFor(control, device);
isEmpty = isEmpty && inputs.length == 0;

if (inputs.length == 0) inputs = [FlxKey.NONE];
if (inputs.length == 0) {
inputs = [FlxKey.NONE];
} else {
inputs = inputs.unique();
}

Reflect.setField(data, control.getName(), inputs);
}
Expand Down
7 changes: 6 additions & 1 deletion source/funkin/play/GameOverSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ class GameOverSubState extends MusicBeatSubState

var isChartingMode:Bool = false;

var mustNotExit:Bool = false;

var transparent:Bool;

static final CAMERA_ZOOM_DURATION:Float = 0.5;
Expand Down Expand Up @@ -160,6 +162,8 @@ class GameOverSubState extends MusicBeatSubState
@:nullSafety(Off)
function setCameraTarget():Void
{
if (PlayState.instance.isMinimalMode || boyfriend == null) return;

// Assign a camera follow point to the boyfriend's position.
cameraFollowPoint = new FlxObject(PlayState.instance.cameraFollowPoint.x, PlayState.instance.cameraFollowPoint.y, 1, 1);
cameraFollowPoint.x = boyfriend.getGraphicMidpoint().x;
Expand Down Expand Up @@ -240,7 +244,7 @@ class GameOverSubState extends MusicBeatSubState
}

// KEYBOARD ONLY: Return to the menu when pressing the assigned key.
if (controls.BACK)
if (controls.BACK && !mustNotExit)
{
blueballed = false;
PlayState.instance.deathCounter = 0;
Expand All @@ -252,6 +256,7 @@ class GameOverSubState extends MusicBeatSubState
this.close();
if (FlxG.sound.music != null) FlxG.sound.music.pause(); // Don't reset song position!
PlayState.instance.close(); // This only works because PlayState is a substate!
return;
}
else if (PlayStatePlaylist.isStoryMode)
{
Expand Down
55 changes: 41 additions & 14 deletions source/funkin/play/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,8 @@ class PlayState extends MusicBeatSubState

resetCamera();

var fromDeathState = isPlayerDying;

persistentUpdate = true;
persistentDraw = true;

Expand Down Expand Up @@ -851,8 +853,11 @@ class PlayState extends MusicBeatSubState

if (currentStage != null) currentStage.resetStage();

playerStrumline.vwooshNotes();
opponentStrumline.vwooshNotes();
if (!fromDeathState)
{
playerStrumline.vwooshNotes();
opponentStrumline.vwooshNotes();
}

playerStrumline.clean();
opponentStrumline.clean();
Expand Down Expand Up @@ -1063,6 +1068,25 @@ class PlayState extends MusicBeatSubState

function moveToGameOver():Void
{
// Reset and update a bunch of values in advance for the transition back from the game over substate.
playerStrumline.clean();
opponentStrumline.clean();

songScore = 0;
updateScoreText();

health = Constants.HEALTH_STARTING;
healthLerp = health;

healthBar.value = healthLerp;

if (!isMinimalMode)
{
iconP1.updatePosition();
iconP2.updatePosition();
}

// Transition to the game over substate.
var gameOverSubState = new GameOverSubState(
{
isChartingMode: isChartingMode,
Expand Down Expand Up @@ -1694,12 +1718,7 @@ class PlayState extends MusicBeatSubState
*/
function initStrumlines():Void
{
var noteStyleId:String = switch (currentStageId)
{
case 'school': 'pixel';
case 'schoolEvil': 'pixel';
default: Constants.DEFAULT_NOTE_STYLE;
}
var noteStyleId:String = currentChart.noteStyle;
var noteStyle:NoteStyle = NoteStyleRegistry.instance.fetchEntry(noteStyleId);
if (noteStyle == null) noteStyle = NoteStyleRegistry.instance.fetchDefault();

Expand Down Expand Up @@ -2537,12 +2556,20 @@ class PlayState extends MusicBeatSubState
// Redirect to the chart editor playing the current song.
if (controls.DEBUG_CHART)
{
disableKeys = true;
persistentUpdate = false;
FlxG.switchState(() -> new ChartEditorState(
{
targetSongId: currentSong.id,
}));
if (isChartingMode)
{
if (FlxG.sound.music != null) FlxG.sound.music.pause(); // Don't reset song position!
this.close(); // This only works because PlayState is a substate!
}
else
{
disableKeys = true;
persistentUpdate = false;
FlxG.switchState(() -> new ChartEditorState(
{
targetSongId: currentSong.id,
}));
}
}
#end

Expand Down
Loading

0 comments on commit 46b7723

Please sign in to comment.