latest build

This commit is contained in:
Yoshman29
2022-10-27 14:34:54 +02:00
parent 8432587fc0
commit 2398a44ed8
16 changed files with 112 additions and 34 deletions
+1
View File
@@ -0,0 +1 @@
lime test windows -Dbeta
+1 -1
View File
@@ -1 +1 @@
776 779
Binary file not shown.
@@ -5,8 +5,4 @@ function beatHit(curBeat:Int) {
case 200: case 200:
camZoomingInterval = 4; camZoomingInterval = 4;
} }
}
function onPlayerHit(event:NoteHitEvent) {
event.direction = 3 - event.direction;
} }
Binary file not shown.

After

Width:  |  Height:  |  Size: 174 B

@@ -0,0 +1,15 @@
<theme folder="desktop/ui/">
<!-- WINDOW!! !-->
<captionActive path="caption" textColor="255,255,255" left="5" top="30" right="5" bottom="5" />
<captionInactive path="captionInactive" textColor="216,228,248" left="5" top="30" right="5" bottom="5" />
<captionButtons path="captionButtons" size="21,21" margin="2,0" offset="4,6" />
<!-- BUTTONS !-->
<normalButton path="button" textColor="0,0,0" left="4" top="4" right="4" bottom="4" />
<hoverButton path="buttonHover" textColor="0,0,0" left="4" top="4" right="4" bottom="4" />
<pressedButton path="buttonPressed" textColor="0,0,0" left="4" top="4" right="4" bottom="4" />
<disabledButton path="buttonDisabled" textColor="128,128,128" left="4" top="4" right="4" bottom="4" />
<!-- TEXT !-->
<text font="%WinDir%/fonts/tahoma.ttf" size="11"/>
</theme>
Binary file not shown.

After

Width:  |  Height:  |  Size: 686 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 818 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 689 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

File diff suppressed because one or more lines are too long
+39 -28
View File
@@ -773,8 +773,8 @@ class PlayState extends MusicBeatState
if (health > 2) if (health > 2)
health = 2; health = 2;
iconP1.health = health / 2; iconP1.health = healthBar.percent;
iconP2.health = 1 - (health / 2); iconP2.health = 1 - (healthBar.percent);
/* if (FlxG.keys.justPressed.NINE) /* if (FlxG.keys.justPressed.NINE)
FlxG.switchState(new Charting()); */ FlxG.switchState(new Charting()); */
@@ -945,29 +945,6 @@ class PlayState extends MusicBeatState
var toDelete:Array<Note> = []; var toDelete:Array<Note> = [];
notes.forEachAlive(function(daNote:Note) notes.forEachAlive(function(daNote:Note)
{ {
if (daNote.mustPress)
{
daNote.canBeHit = (daNote.strumTime > Conductor.songPosition - (Conductor.safeZoneOffset * daNote.latePressWindow)
&& daNote.strumTime < Conductor.songPosition + (Conductor.safeZoneOffset * daNote.earlyPressWindow));
if (daNote.strumTime < Conductor.songPosition - Conductor.safeZoneOffset && !daNote.wasGoodHit)
daNote.tooLate = true;
}
else
daNote.canBeHit = false;
if (!daNote.mustPress && !daNote.wasGoodHit && daNote.strumTime <= Conductor.songPosition) goodNoteHit(daNote);
// TODO: FIXED STEP CROCHET PER NOTES FOR BPM CHANGES
if (daNote.wasGoodHit && daNote.isSustainNote && daNote.strumTime + (Conductor.stepCrochet) < Conductor.songPosition) {
deleteNote(daNote);
return;
}
if (daNote.tooLate) {
noteMiss(daNote);
return;
}
var strum:Strum = null; var strum:Strum = null;
for(e in (daNote.mustPress ? playerStrums : cpuStrums).members) { for(e in (daNote.mustPress ? playerStrums : cpuStrums).members) {
if (e.ID == daNote.noteData % 4) { if (e.ID == daNote.noteData % 4) {
@@ -975,10 +952,44 @@ class PlayState extends MusicBeatState
break; break;
} }
} }
if (strum == null) return;
var event = PlayState.instance.scripts.event("onNoteUpdate", new NoteUpdateEvent(daNote, elapsed, strum));
if (!event.cancelled) {
if (event.__updateHitWindow) {
if (daNote.mustPress)
{
daNote.canBeHit = (daNote.strumTime > Conductor.songPosition - (Conductor.safeZoneOffset * daNote.latePressWindow)
&& daNote.strumTime < Conductor.songPosition + (Conductor.safeZoneOffset * daNote.earlyPressWindow));
if (daNote.strumTime < Conductor.songPosition - Conductor.safeZoneOffset && !daNote.wasGoodHit)
daNote.tooLate = true;
}
else
daNote.canBeHit = false;
}
if (event.__autoCPUHit && !daNote.mustPress && !daNote.wasGoodHit && daNote.strumTime <= Conductor.songPosition) goodNoteHit(daNote);
// TODO: FIXED STEP CROCHET PER NOTES FOR BPM CHANGES
strum.updateNotePosition(daNote); if (daNote.wasGoodHit && daNote.isSustainNote && daNote.strumTime + (Conductor.stepCrochet) < Conductor.songPosition) {
strum.updateClipRect(daNote); deleteNote(daNote);
return;
}
if (daNote.tooLate) {
noteMiss(daNote);
return;
}
if (event.strum == null) return;
if (event.__reposNote) event.strum.updateNotePosition(daNote);
event.strum.updateClipRect(daNote);
PlayState.instance.scripts.event("onNoteUpdatePost", event);
}
}); });
} }
@@ -0,0 +1,55 @@
package funkin.scripting.events;
import funkin.game.Note;
import funkin.game.Strum;
class NoteUpdateEvent extends CancellableEvent {
@:dox(hide) public var __updateHitWindow = true;
@:dox(hide) public var __autoCPUHit = true;
@:dox(hide) public var __reposNote = true;
/**
* Note that is being updated
*/
public var note:Note;
/**
* Time elapsed since last frame
*/
public var elapsed:Float;
/**
* Note's strum (can be changed)
*/
public var strum:Strum;
public function new(note:Note, elapsed:Float, strum:Strum) {
super();
this.note = note;
this.elapsed = elapsed;
this.strum = strum;
}
/**
* Cancels the hit window update.
*/
public function cancelWindowUpdate() {
__updateHitWindow = false;
}
@:dox(hide) public function preventWindowUpdate() { cancelWindowUpdate(); }
/**
* Cancels the automatic CPU hit.
*/
public function cancelAutoCPUHit() {
__autoCPUHit = false;
}
@:dox(hide) public function preventAutoCPUHit() { cancelAutoCPUHit(); }
/**
* Cancels the note position update (note will freeze).
*/
public function cancelPositionUpdate() {
__reposNote = false;
}
@:dox(hide) public function preventPositionUpdate() { cancelPositionUpdate(); }
}