Fix issues with HTML5 and note drawing

This commit is contained in:
CuckyDev 2021-07-11 18:36:12 -04:00
parent ad89799f58
commit 321badd0b2
3 changed files with 143 additions and 141 deletions

View File

@ -10,8 +10,10 @@ import flixel.ui.FlxBar;
import haxe.Exception;
import flixel.tweens.FlxEase;
import flixel.tweens.FlxTween;
#if cpp
import sys.FileSystem;
import sys.io.File;
#end
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.addons.transition.FlxTransitionSprite.GraphicTransTileDiamond;
@ -67,25 +69,7 @@ class Caching extends MusicBeatState
kadeLogo.alpha = 0;
PlayerSettings.init();
#if windows
DiscordClient.initialize();
Application.current.onExit.add (function (exitCode) {
DiscordClient.shutdown();
});
#end
Highscore.load();
FlxG.save.bind('funkin', 'ninjamuffin99');
KadeEngineData.initSave();
#if cpp
if (FlxG.save.data.cacheImages)
{
trace("caching images...");
@ -104,7 +88,7 @@ class Caching extends MusicBeatState
{
music.push(i);
}
#end
toBeDone = Lambda.count(images) + Lambda.count(music);
@ -118,6 +102,7 @@ class Caching extends MusicBeatState
trace('starting caching..');
#if cpp
// update thread
sys.thread.Thread.create(() -> {
@ -139,6 +124,7 @@ class Caching extends MusicBeatState
sys.thread.Thread.create(() -> {
cache();
});
#end
super.create();
}
@ -153,7 +139,6 @@ class Caching extends MusicBeatState
function cache()
{
trace("LOADING: " + toBeDone + " OBJECTS.");
for (i in images)

View File

@ -89,6 +89,24 @@ class Main extends Sprite
toggleFPS(FlxG.save.data.fps);
#end
PlayerSettings.init();
#if windows
DiscordClient.initialize();
Application.current.onExit.add (function (exitCode) {
DiscordClient.shutdown();
});
#end
Highscore.load();
FlxG.save.bind('funkin', 'ninjamuffin99');
KadeEngineData.initSave();
}
var game:FlxGame;

View File

@ -67,11 +67,6 @@ class Note extends FlxSprite
this.prevNote = prevNote;
isSustainNote = sustainNote;
this.noteData = noteData;
if (!inCharter)
x = PlayState.strumLineNotes.members[Math.floor(Math.abs(noteData))].x;
else
x += 50;
// MAKE SURE ITS DEFINITELY OFF SCREEN?
y -= 2000;
@ -91,12 +86,16 @@ class Note extends FlxSprite
if (this.strumTime < 0 )
this.strumTime = 0;
this.noteData = noteData;
var daStage:String = PlayState.curStage;
//defaults if no noteStyle was found in chart
var noteTypeCheck:String = 'normal';
if (PlayState.curStage.startsWith('school'))
noteTypeCheck = 'pixel';
if (!inCharter)
if (inCharter)
{
frames = Paths.getSparrowAtlas('NOTE_assets');
@ -180,20 +179,20 @@ class Note extends FlxSprite
noteScore * 0.2;
alpha = 0.6;
x += width / 2 + 17;
if (noteTypeCheck == 'pixel')
x -= 8;
//x += width / 2;
x += width / 2;
originColor = prevNote.originColor;
animation.play(dataColor[originColor] + 'holdend'); // This works both for normal colors and quantization colors
updateHitbox();
//x -= width / 2;
x -= width / 2;
//if (PlayState.curStage.startsWith('school'))
// x += 30;
if (noteTypeCheck == 'pixel')
x += 30;
if (inCharter)
x += 30;
if (prevNote.isSustainNote)
{