some testing stuff

This commit is contained in:
Yoshman29
2022-10-20 00:03:00 +02:00
parent 4c1f9f58e3
commit 03c87027d2
8 changed files with 61 additions and 32 deletions
-4
View File
@@ -5,8 +5,4 @@ function beatHit(curBeat:Int) {
case 200:
camZoomingInterval = 4;
}
}
function onPlayerHit(event:NoteHitEvent) {
event.direction = 3 - event.direction;
}
+1 -1
View File
@@ -1 +1 @@
562
569
+1 -1
View File
@@ -20,7 +20,7 @@ class WindowContentSprite extends FlxSprite {
public override function update(elapsed:Float) {
super.update(elapsed);
cam.render()
// cam.render()
}
public override function draw() {
super.draw();
+27
View File
@@ -5,6 +5,7 @@ import flixel.graphics.frames.FlxAtlasFrames;
import flixel.math.FlxMath;
import flixel.util.FlxColor;
import flixel.math.FlxRect;
import flixel.math.FlxPoint;
import funkin.system.Conductor;
#if polymod
import polymod.format.ParseRules.TargetSignatureElement;
@@ -180,6 +181,32 @@ class Note extends FlxSprite
}
}
public var angleOffsets:Bool = true;
override function draw() {
if (angleOffsets && Std.int(angle % 360) != 0) {
var oldOffset = FlxPoint.get(offset.x, offset.y);
// var oldOrigin = FlxPoint.get(origin.x, origin.y);
offset.set(
(Math.cos(angle / 180 * Math.PI) * offset.x) + (Math.sin(angle / 180 * Math.PI) * offset.y),
(Math.sin(angle / 180 * Math.PI) * offset.x) + (Math.cos(angle / 180 * Math.PI) * offset.y));
// origin.set(
// (-Math.cos(angle / 180 * Math.PI) * origin.x) + (-Math.sin(angle / 180 * Math.PI) * origin.y),
// (-Math.sin(angle / 180 * Math.PI) * origin.x) + (-Math.cos(angle / 180 * Math.PI) * origin.y));
super.draw();
offset.set(oldOffset.x, oldOffset.y);
// origin.set(oldOrigin.x, oldOrigin.y);
oldOffset.put();
// oldOrigin.put();
return;
}
super.draw();
}
override function update(elapsed:Float)
{
super.update(elapsed);
+2
View File
@@ -1,5 +1,6 @@
package funkin.game;
import funkin.options.Options;
import funkin.scripting.Script;
import flixel.util.FlxDestroyUtil;
#if desktop
@@ -119,6 +120,7 @@ class PlayState extends MusicBeatState
public var songScore:Int = 0;
public var downscroll:Bool = Options.downscroll;
public var misses:Int = 0;
public var scoreTxt:FlxText;
public var missesTxt:FlxText;
+29 -3
View File
@@ -1,5 +1,6 @@
package funkin.game;
import funkin.options.Options;
import flixel.FlxSprite;
import flixel.math.FlxMath;
import flixel.math.FlxPoint;
@@ -10,12 +11,25 @@ class Strum extends FlxSprite {
public var lastHit:Float = -5000;
public var scrollSpeed:Null<Float> = null; // custom scroll speed per strum
public var noteAngle:Null<Float> = null; // custom scroll speed per strum
public var downscroll:Null<Bool> = false; // custom downscroll per strum
public function getScrollSpeed() {
if (scrollSpeed != null) return scrollSpeed;
if (PlayState.instance != null) return PlayState.instance.scrollSpeed;
return 1;
}
public function getNotesAngle() {
if (noteAngle != null) return noteAngle;
return angle;
}
public function getDownscroll() {
if (downscroll != null) return downscroll;
if (PlayState.instance != null) return PlayState.instance.downscroll;
return Options.downscroll;
}
public override function update(elapsed:Float) {
super.update(elapsed);
@@ -28,12 +42,24 @@ class Strum extends FlxSprite {
public function updateNotePosition(daNote:Note) {
var offset = FlxPoint.get(daNote.isSustainNote ? ((Note.swagWidth - daNote.width) / 2) : 0, (Conductor.songPosition - daNote.strumTime) * (0.45 * FlxMath.roundDecimal(PlayState.instance.scrollSpeed, 2)));
var realOffset = FlxPoint.get(0, 0);
if (daNote.isSustainNote) offset.y -= Note.swagWidth / 2;
// TODO: angle stuff
daNote.x = x + offset.x;
daNote.y = y - offset.y;
var noteAngle = getNotesAngle();
daNote.angle = daNote.isSustainNote ? noteAngle : angle;
if (Std.int(noteAngle % 360) != 0) {
realOffset.x = (Math.cos(noteAngle / 180 * Math.PI) * offset.x) + (Math.sin(noteAngle / 180 * Math.PI) * offset.y);
realOffset.y = (Math.sin(noteAngle / 180 * Math.PI) * offset.x) + (Math.cos(noteAngle / 180 * Math.PI) * offset.y);
} else {
realOffset.x = offset.x;
realOffset.y = offset.y;
}
if (!downscroll)
realOffset.y *= -1;
daNote.setPosition(x + realOffset.x, y + realOffset.y);
offset.put();
realOffset.put();
}
public function updateClipRect(daNote:Note) {
-22
View File
@@ -121,28 +121,6 @@ class ModsFolder {
#end
}
public static function checkForOutdatedAssets(assets:ModsAssetLibrary) {
// TODO: Fix this
#if sys
@:privateAccess
for(asset=>path in assets.paths) {
if (asset == null || path == null) continue;
var editedTime:Null<Float> = assets.getEditedTime(asset);
if (editedTime == null) continue;
try {
var stat = FileSystem.stat(path);
if (stat.mtime.getTime() > editedTime) {
// refresh
trace('Refreshing ${asset}');
Assets.cache.clear(asset);
@:privateAccess
FlxG.bitmap.removeKey(asset);
}
}
}
#end
}
private static function onStateSwitch(newState:FlxState) {
Assets.cache.clear();
lime.utils.Assets.cache.clear();
@@ -141,7 +141,7 @@ class KeybindsOptions extends MusicBeatSubstate {
k++;
for(e in category.settings) {
// TODO!!
var xOffset:Float = 200;
var sparrowIcon:String = null;
var sparrowAnim:String = null;