Fix issues with HTML5 and note drawing
This commit is contained in:
parent
ad89799f58
commit
321badd0b2
@ -10,8 +10,10 @@ import flixel.ui.FlxBar;
|
|||||||
import haxe.Exception;
|
import haxe.Exception;
|
||||||
import flixel.tweens.FlxEase;
|
import flixel.tweens.FlxEase;
|
||||||
import flixel.tweens.FlxTween;
|
import flixel.tweens.FlxTween;
|
||||||
|
#if cpp
|
||||||
import sys.FileSystem;
|
import sys.FileSystem;
|
||||||
import sys.io.File;
|
import sys.io.File;
|
||||||
|
#end
|
||||||
import flixel.FlxG;
|
import flixel.FlxG;
|
||||||
import flixel.FlxSprite;
|
import flixel.FlxSprite;
|
||||||
import flixel.addons.transition.FlxTransitionSprite.GraphicTransTileDiamond;
|
import flixel.addons.transition.FlxTransitionSprite.GraphicTransTileDiamond;
|
||||||
@ -67,25 +69,7 @@ class Caching extends MusicBeatState
|
|||||||
|
|
||||||
kadeLogo.alpha = 0;
|
kadeLogo.alpha = 0;
|
||||||
|
|
||||||
PlayerSettings.init();
|
#if cpp
|
||||||
|
|
||||||
#if windows
|
|
||||||
DiscordClient.initialize();
|
|
||||||
|
|
||||||
Application.current.onExit.add (function (exitCode) {
|
|
||||||
DiscordClient.shutdown();
|
|
||||||
});
|
|
||||||
|
|
||||||
#end
|
|
||||||
|
|
||||||
|
|
||||||
Highscore.load();
|
|
||||||
|
|
||||||
FlxG.save.bind('funkin', 'ninjamuffin99');
|
|
||||||
|
|
||||||
KadeEngineData.initSave();
|
|
||||||
|
|
||||||
|
|
||||||
if (FlxG.save.data.cacheImages)
|
if (FlxG.save.data.cacheImages)
|
||||||
{
|
{
|
||||||
trace("caching images...");
|
trace("caching images...");
|
||||||
@ -104,7 +88,7 @@ class Caching extends MusicBeatState
|
|||||||
{
|
{
|
||||||
music.push(i);
|
music.push(i);
|
||||||
}
|
}
|
||||||
|
#end
|
||||||
|
|
||||||
toBeDone = Lambda.count(images) + Lambda.count(music);
|
toBeDone = Lambda.count(images) + Lambda.count(music);
|
||||||
|
|
||||||
@ -118,6 +102,7 @@ class Caching extends MusicBeatState
|
|||||||
|
|
||||||
trace('starting caching..');
|
trace('starting caching..');
|
||||||
|
|
||||||
|
#if cpp
|
||||||
// update thread
|
// update thread
|
||||||
|
|
||||||
sys.thread.Thread.create(() -> {
|
sys.thread.Thread.create(() -> {
|
||||||
@ -139,6 +124,7 @@ class Caching extends MusicBeatState
|
|||||||
sys.thread.Thread.create(() -> {
|
sys.thread.Thread.create(() -> {
|
||||||
cache();
|
cache();
|
||||||
});
|
});
|
||||||
|
#end
|
||||||
|
|
||||||
super.create();
|
super.create();
|
||||||
}
|
}
|
||||||
@ -153,7 +139,6 @@ class Caching extends MusicBeatState
|
|||||||
|
|
||||||
function cache()
|
function cache()
|
||||||
{
|
{
|
||||||
|
|
||||||
trace("LOADING: " + toBeDone + " OBJECTS.");
|
trace("LOADING: " + toBeDone + " OBJECTS.");
|
||||||
|
|
||||||
for (i in images)
|
for (i in images)
|
||||||
|
@ -89,6 +89,24 @@ class Main extends Sprite
|
|||||||
toggleFPS(FlxG.save.data.fps);
|
toggleFPS(FlxG.save.data.fps);
|
||||||
|
|
||||||
#end
|
#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;
|
var game:FlxGame;
|
||||||
|
@ -67,11 +67,6 @@ class Note extends FlxSprite
|
|||||||
this.prevNote = prevNote;
|
this.prevNote = prevNote;
|
||||||
isSustainNote = sustainNote;
|
isSustainNote = sustainNote;
|
||||||
|
|
||||||
this.noteData = noteData;
|
|
||||||
|
|
||||||
if (!inCharter)
|
|
||||||
x = PlayState.strumLineNotes.members[Math.floor(Math.abs(noteData))].x;
|
|
||||||
else
|
|
||||||
x += 50;
|
x += 50;
|
||||||
// MAKE SURE ITS DEFINITELY OFF SCREEN?
|
// MAKE SURE ITS DEFINITELY OFF SCREEN?
|
||||||
y -= 2000;
|
y -= 2000;
|
||||||
@ -91,12 +86,16 @@ class Note extends FlxSprite
|
|||||||
if (this.strumTime < 0 )
|
if (this.strumTime < 0 )
|
||||||
this.strumTime = 0;
|
this.strumTime = 0;
|
||||||
|
|
||||||
|
this.noteData = noteData;
|
||||||
|
|
||||||
var daStage:String = PlayState.curStage;
|
var daStage:String = PlayState.curStage;
|
||||||
|
|
||||||
//defaults if no noteStyle was found in chart
|
//defaults if no noteStyle was found in chart
|
||||||
var noteTypeCheck:String = 'normal';
|
var noteTypeCheck:String = 'normal';
|
||||||
|
if (PlayState.curStage.startsWith('school'))
|
||||||
|
noteTypeCheck = 'pixel';
|
||||||
|
|
||||||
if (!inCharter)
|
if (inCharter)
|
||||||
{
|
{
|
||||||
frames = Paths.getSparrowAtlas('NOTE_assets');
|
frames = Paths.getSparrowAtlas('NOTE_assets');
|
||||||
|
|
||||||
@ -180,20 +179,20 @@ class Note extends FlxSprite
|
|||||||
noteScore * 0.2;
|
noteScore * 0.2;
|
||||||
alpha = 0.6;
|
alpha = 0.6;
|
||||||
|
|
||||||
x += width / 2 + 17;
|
x += width / 2;
|
||||||
if (noteTypeCheck == 'pixel')
|
|
||||||
x -= 8;
|
|
||||||
//x += width / 2;
|
|
||||||
|
|
||||||
originColor = prevNote.originColor;
|
originColor = prevNote.originColor;
|
||||||
|
|
||||||
animation.play(dataColor[originColor] + 'holdend'); // This works both for normal colors and quantization colors
|
animation.play(dataColor[originColor] + 'holdend'); // This works both for normal colors and quantization colors
|
||||||
updateHitbox();
|
updateHitbox();
|
||||||
|
|
||||||
//x -= width / 2;
|
x -= width / 2;
|
||||||
|
|
||||||
//if (PlayState.curStage.startsWith('school'))
|
if (noteTypeCheck == 'pixel')
|
||||||
// x += 30;
|
x += 30;
|
||||||
|
|
||||||
|
if (inCharter)
|
||||||
|
x += 30;
|
||||||
|
|
||||||
if (prevNote.isSustainNote)
|
if (prevNote.isSustainNote)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user