fixed a lot of stupid bugs

This commit is contained in:
Yoshman29
2022-12-13 22:51:54 +01:00
parent 53f9389715
commit 43492f89d4
20 changed files with 75 additions and 53 deletions
+1 -1
View File
@@ -138,7 +138,7 @@
<haxeflag name="--macro" value="include('flixel')" />
<haxeflag name="--macro" value="include('away3d')" />
<haxeflag name="--macro" value="include('flx3d')" />
<haxeflag name="--macro" value="include('sys')" if="sys"/>
<haxeflag name="--macro" value="include('sys')" unless="html5"/>
<!-- HAXE STUFF !-->
<haxeflag name="--macro" value="include('DateTools')" />
+1 -1
View File
@@ -1,5 +1,5 @@
<!DOCTYPE codename-engine-character>
<character isPlayer="true" flipX="true" x="0" y="350" icon="bf">
<character isPlayer="true" flipX="true" x="0" y="350" icon="bf" camx="25">
<anim name="idle" anim="BF idle dance" fps="24" loop="false" x="-5" y="0"/>
<anim name="singUP" anim="BF NOTE UP0" fps="24" loop="false" x="-29" y="27"/>
<anim name="singLEFT" anim="BF NOTE LEFT0" fps="24" loop="false" x="12" y="-6"/>
+1 -1
View File
@@ -1,5 +1,5 @@
<!DOCTYPE codename-engine-character>
<character isPlayer="false" flipX="true" x="-200" y="300" camx="200">
<character isPlayer="false" flipX="true" x="100" y="300" camx="-100">
<anim name="idle" anim="Pico Idle Dance" fps="24" loop="false" x="0" y="0" />
<!-- Sing Animations -->
+4
View File
@@ -0,0 +1,4 @@
function beatHit(curBeat) {
if (curBeat != 79 && curBeat % 8 == 7)
boyfriend.playAnim("hey");
}
-10
View File
@@ -1,10 +0,0 @@
import funkin.system.Conductor;
import flixel.tweens.FlxTween;
import funkin.scripting.events.NoteHitEvent;
function onPlayerHit(event:NoteHitEvent) {
if (event.note.isSustainNote) return;
event.preventDeletion();
FlxTween.tween(event.note, {strumTime: event.note.strumTime + (Conductor.crochet * 2)}, Conductor.crochet / 500, {ease: FlxEase.cubeOut});
event.note.wasGoodHit = false;
}
-5
View File
@@ -1,5 +0,0 @@
function create() {
startVideo(Paths.video("garfield"), function() {
close();
});
}
-1
View File
@@ -1,6 +1,5 @@
<!DOCTYPE codename-engine-stage>
<stage zoom="1.05" name="mall-evil" folder="stages/mall/">
<!-- BG LIMOS !-->
<sprite name="bg" x="-400" y="-500" sprite="evilBG" scroll="0.2"/>
<sprite name="evilTree" x="300" y="-300" sprite="evilTree" scroll="0.2"/>
<sprite name="evilSnow" x="-200" y="700" sprite="evilSnow" />
+3 -10
View File
@@ -1,19 +1,12 @@
<!DOCTYPE codename-engine-stage>
<stage zoom="0.8" name="mall" folder="stages/mall/">
<!-- BG LIMOS !-->
<sprite name="bg" x="-1000" y="-500" sprite="bgWalls" scroll="0.2"/>
<sprite name="upperBoppers" x="-240" y="-90" sprite="upperBop" scroll="0.2">
<anim name="bop" anim="Upper Crowd Bob" fps="24" loop="false" />
</sprite>
<sprite name="upperBoppers" x="-240" y="-90" sprite="upperBop" scroll="0.2" />
<sprite name="bgEscalator" x="-1100" y="-600" sprite="bgEscalator" scroll="0.3" scale="0.9" updateHitbox="true"/>
<sprite name="tree" x="370" y="-250" sprite="christmasTree" scroll="0.4"/>
<sprite name="bottomBoppers" x="-300" y="140" sprite="bottomBop" scroll="0.9">
<anim name="bop" anim="Bottom Level Boppers" fps="24" loop="false" />
</sprite>
<sprite name="bottomBoppers" x="-300" y="140" sprite="bottomBop" scroll="0.9"/>
<sprite name="fgSnow" x="-600" y="700" sprite="fgSnow"/>
<sprite name="santa" x="-840" y="150" sprite="santa" beatAnim="idle">
<anim name="idle" anim="santa idle in fear" fps="24" loop="false" />
</sprite>
<sprite name="santa" x="-840" y="150" sprite="santa"/>
<girlfriend />
<dad />
+1 -1
View File
@@ -1,5 +1,5 @@
<!DOCTYPE codename-engine-stage>
<stage zoom="0.5" name="school-evil" folder="stages/school/" >
<sprite name="bg" x="400" y="200" sprite="animatedEvilSchool"
antialiasing="false" scale="6" scrollx="0.8" scrolly="0.9"/>
antialiasing="false" scale="6" scrollx="0.8" scrolly="0.9" type="loop"/>
</stage>
+7 -7
View File
@@ -1,24 +1,24 @@
<!DOCTYPE codename-engine-stage>
<stage zoom="1" folder="stages/school/" >
<sprite name="bgSky" x="0" y="0" sprite="weebSky"
<sprite name="bgSky" x="-12" y="0" sprite="weebSky"
antialiasing="false" scale="6" scroll="0.1" updateHitbox="true"/>
<sprite name="bgSchool" x="-200" y="0" sprite="weebSchool"
<sprite name="bgSchool" x="-216" y="0" sprite="weebSchool"
antialiasing="false" scale="6" scrollx="0.6" scrolly="0.9" updateHitbox="true"/>
<sprite name="bgStreet" x="-200" y="0" sprite="weebStreet"
<sprite name="bgStreet" x="-204" y="0" sprite="weebStreet"
antialiasing="false" scale="6" scroll="0.95" updateHitbox="true"/>
<sprite name="fgTrees" x="-30" y="130" sprite="weebTreesBack"
antialiasing="false" scale="4.8" scroll="0.9" updateHitbox="true"/>
antialiasing="false" scale="4.8" scroll="0.9" updateHitbox="true" type="loop"/>
<sprite name="bgTrees" x="-1180" y="-1600" sprite="weebTrees"
antialiasing="false" scale="8.4" scroll="0.85" updateHitbox="true"/>
antialiasing="false" scale="8.4" scroll="0.85" updateHitbox="true" type="loop"/>
<sprite name="treeLeaves" x="-200" y="-40" sprite="petals"
antialiasing="false" scale="6" scroll="0.85" updateHitbox="true"/>
antialiasing="false" scale="6" scroll="0.85" updateHitbox="true" type="loop"/>
<sprite name="bgGirls" x="-100" y="190" sprite="bgFreaks" scroll="0.9" scale="6" antialiasing="false" updateHitbox="true" beatAnim="danceLeft,danceRight">
<sprite name="bgGirls" x="-100" y="190" sprite="bgFreaks" scroll="0.9" scale="6" antialiasing="false" updateHitbox="true">
<anim name="danceLeft" anim="BG girls group" indices="0,1,2,3,4,5,6,7,8,9,10,11,12,13" fps="24" loop="false"/>
<anim name="danceRight" anim="BG girls group" indices="15,16,17,18,19,20,21,22,23,24,25,26,27,28,29" fps="24" loop="false"/>
</sprite>
+2 -2
View File
@@ -1,7 +1,7 @@
<!DOCTYPE codename-engine-stage>
<stage zoom="1.05" name="spooky" folder="stages/spooky/">
<sprite name="bg" x="-200" y="-100" sprite="halloween_bg" anim="idle" beatAnim="none">
<anim name="idle" anim="halloweem bg0"/>
<sprite name="bg" x="-200" y="-100" sprite="halloween_bg" anim="idle" type="none">
<anim name="idle" anim="halloweem bg0" type="loop" />
<anim name="lightning" anim="halloweem bg lightning strike" loop="false"/>
</sprite>
</stage>
+1 -1
View File
@@ -12,7 +12,7 @@
<sprite name="smokeLeft" x="-200" y="-100" sprite="smokeLeft" scroll="0.4" zoomfactor="0.6"/>
<sprite name="smokeRight" x="1100" y="-100" sprite="smokeRight" scroll="0.4" zoomfactor="0.6"/>
<sprite name="tankWatchtower" x="100" y="50" sprite="tankWatchtower" scroll="0.5" onBeat="true" zoomfactor="0.7"/>
<sprite name="tankRolling" x="300" y="300" sprite="tankRolling" scroll="0.5" zoomfactor="0.8"/>
<sprite name="tankRolling" x="300" y="300" sprite="tankRolling" scroll="0.5" zoomfactor="0.8" type="loop"/>
<sprite name="tankGround" x="-420" y="-150" sprite="tankGround" scale="1.15" updateHitbox="true" zoomfactor="1.0"/>
<!-- CHARACTERS -->
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
1462
1466
+1
View File
@@ -58,6 +58,7 @@ class FlxView3D extends FlxSprite
{
Main.instance.removeChild(view);
view.dispose();
_loader.disposeWithChildren();
super.destroy();
if (bmp != null)
{
+9 -9
View File
@@ -792,10 +792,10 @@ class PlayState extends MusicBeatState
}
}
#end
// if (__wasAutoPause && __songPlaying) {
// inst.play();
// vocals.play();
// }
if (__wasAutoPause && __songPlaying) {
inst.play();
vocals.play();
}
super.onFocus();
}
@@ -809,11 +809,11 @@ class PlayState extends MusicBeatState
DiscordClient.changePresence(detailsPausedText, SONG.song + " (" + difficultyText + ")", iconRPC);
}
#end
// if (__wasAutoPause = FlxG.autoPause) {
// __songPlaying = inst.playing;
// inst.pause();
// vocals.pause();
// }
if (__wasAutoPause = FlxG.autoPause) {
__songPlaying = inst.playing;
inst.pause();
vocals.pause();
}
super.onFocusLost();
+1 -1
View File
@@ -57,7 +57,7 @@ class Stage extends FlxBasic implements IBeatReceiver {
case "sprite" | "spr" | "sparrow":
if (!node.has.sprite || !node.has.name || !node.has.x || !node.has.y) continue;
var spr = XMLUtil.createSpriteFromXML(node, spritesParentFolder);
var spr = XMLUtil.createSpriteFromXML(node, spritesParentFolder, BEAT);
if (!node.has.zoomfactor && PlayState.instance != null)
spr.initialZoom = PlayState.instance.defaultCamZoom;
+17
View File
@@ -8,7 +8,24 @@ import flixel.math.FlxMath;
import funkin.interfaces.IBeatReceiver;
import flixel.FlxSprite;
@:enum
abstract XMLAnimType(Int) {
var NONE = 0;
var BEAT = 1;
var LOOP = 2;
public static function fromString(str:String, def:XMLAnimType = NONE) {
return switch(str.trim().toLowerCase()) {
case "none": NONE;
case "beat" | "onbeat": BEAT;
case "loop": LOOP;
default: def;
}
}
}
class XMLSprite extends FlxSprite implements IBeatReceiver {
public var spriteAnimType:XMLAnimType = NONE;
public var beatAnims:Array<String> = [];
public var name:String;
public var zoomFactor:Float = 1;
+25 -2
View File
@@ -1,5 +1,6 @@
package funkin.system;
import funkin.system.XMLSprite.XMLAnimType;
import flixel.math.FlxMath;
import funkin.interfaces.IBeatReceiver;
import haxe.xml.Access;
@@ -44,15 +45,19 @@ class XMLUtil {
/**
* Creates a new sprite based on a XML node.
*/
public static function createSpriteFromXML(node:Access, parentFolder:String = "", ?cl:Class<XMLSprite>):XMLSprite {
public static function createSpriteFromXML(node:Access, parentFolder:String = "", defaultAnimType:XMLAnimType = BEAT, ?cl:Class<XMLSprite>):XMLSprite {
if (parentFolder == null) parentFolder = "";
var spr = cl != null ? Type.createInstance(cl, []) : new XMLSprite();
var spr:XMLSprite = cl != null ? Type.createInstance(cl, []) : new XMLSprite();
spr.name = node.getAtt("name");
spr.antialiasing = true;
spr.loadAnimatedGraphic(Paths.image('$parentFolder${node.getAtt("sprite")}', null, true));
spr.spriteAnimType = defaultAnimType;
if (node.has.type)
spr.spriteAnimType = XMLAnimType.fromString(node.att.type, spr.spriteAnimType);
var x:Null<Float> = node.has.x ? Std.parseFloat(node.att.x) : null;
var y:Null<Float> = node.has.y ? Std.parseFloat(node.att.y) : null;
if (x != null) spr.x = x;
@@ -91,17 +96,23 @@ class XMLUtil {
* @param anim Animation (Must be a `anim` XML node)
*/
public static function addXMLAnimation(sprite:FlxSprite, anim:Access, loop:Bool = false):ErrorCode {
var animType:XMLAnimType = NONE;
if (sprite is XMLSprite)
animType = cast(sprite, XMLSprite).spriteAnimType;
var animData:AnimData = {
name: null,
anim: null,
fps: 24,
loop: loop,
animType: animType,
x: 0,
y: 0,
indices: []
};
if (anim.has.name) animData.name = anim.att.name;
if (anim.has.type) animData.animType = XMLAnimType.fromString(anim.att.type, animData.animType);
if (anim.has.anim) animData.anim = anim.att.anim;
if (anim.has.fps) animData.fps = Std.parseInt(anim.att.fps);
if (anim.has.x) animData.x = Std.parseFloat(anim.att.x);
@@ -127,6 +138,17 @@ class XMLUtil {
if (sprite is IOffsetCompatible)
cast(sprite, IOffsetCompatible).addOffset(animData.name, animData.x, animData.y);
if (sprite is XMLSprite) {
var xmlSpr = cast(sprite, XMLSprite);
switch(animData.animType) {
case BEAT:
xmlSpr.beatAnims.push(animData.name);
case LOOP:
xmlSpr.animation.play(animData.name);
default:
// nothing
}
}
return OK;
}
return MISSING_PROPERTY;
@@ -141,4 +163,5 @@ typedef AnimData = {
var x:Float;
var y:Float;
var indices:Array<Int>;
var animType:XMLAnimType;
}