This commit is contained in:
lunarcleint
2023-08-10 18:46:49 -07:00
7 changed files with 216 additions and 44 deletions
+6
View File
@@ -0,0 +1,6 @@
<!DOCTYPE codename-engine-character>
<character icon="bf-pixel-dead" x="200" y="570" isGF="false" scale="6" flipX="true" isPlayer="true" antialiasing="false" sprite="bf-pixel-dead">
<anim x="0" loop="false" y="0" fps="24" anim="BF Dies pixel" name="firstDeath"/>
<anim x="-5" loop="true" y="-2" fps="24" anim="Retry Loop" name="deathLoop"/>
<anim x="-5" loop="false" y="-2" fps="24" anim="RETRY CONFIRM" name="deathConfirm"/>
</character>
+1 -1
View File
@@ -1,5 +1,5 @@
<!DOCTYPE codename-engine-character>
<character isPlayer="true" flipX="true" x="200" y="570" antialiasing="false" scale="6" camx="-200" camy="-20">
<character isPlayer="true" flipX="true" x="200" y="570" antialiasing="false" scale="6" camx="-200" camy="-20" gameOverChar="bf-pixel-dead">
<anim name="idle" anim="BF IDLE" fps="24" loop="false" x="0" y="0" />
<!-- Offsets are actually multiplied by scale -->
Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

+131
View File
@@ -0,0 +1,131 @@
<?xml version="1.0" encoding="utf-8"?>
<TextureAtlas imagePath="bf-pixel-dead.png">
<!-- if you read this you're epic. -->
<!-- manual tweaks done on BF Dies pixel last 2 frames -->
<SubTexture name="BF Dies pixel0000" x="0" y="0" width="90" height="81"/>
<SubTexture name="BF Dies pixel0001" x="100" y="0" width="90" height="81"/>
<SubTexture name="BF Dies pixel0002" x="200" y="0" width="90" height="81"/>
<SubTexture name="BF Dies pixel0003" x="300" y="0" width="90" height="81"/>
<SubTexture name="BF Dies pixel0004" x="300" y="0" width="90" height="81"/>
<SubTexture name="BF Dies pixel0005" x="400" y="0" width="90" height="81"/>
<SubTexture name="BF Dies pixel0006" x="400" y="0" width="90" height="81"/>
<SubTexture name="BF Dies pixel0007" x="500" y="0" width="90" height="81"/>
<SubTexture name="BF Dies pixel0008" x="500" y="0" width="90" height="81"/>
<SubTexture name="BF Dies pixel0009" x="500" y="0" width="90" height="81"/>
<SubTexture name="BF Dies pixel0010" x="500" y="0" width="90" height="81"/>
<SubTexture name="BF Dies pixel0011" x="500" y="0" width="90" height="81"/>
<SubTexture name="BF Dies pixel0012" x="500" y="0" width="90" height="81"/>
<SubTexture name="BF Dies pixel0013" x="500" y="0" width="90" height="81"/>
<SubTexture name="BF Dies pixel0014" x="500" y="0" width="90" height="81"/>
<SubTexture name="BF Dies pixel0015" x="500" y="0" width="90" height="81"/>
<SubTexture name="BF Dies pixel0016" x="600" y="0" width="90" height="81"/>
<SubTexture name="BF Dies pixel0017" x="600" y="0" width="90" height="81"/>
<SubTexture name="BF Dies pixel0018" x="600" y="0" width="90" height="81"/>
<SubTexture name="BF Dies pixel0019" x="700" y="0" width="90" height="81"/>
<SubTexture name="BF Dies pixel0020" x="700" y="0" width="90" height="81"/>
<SubTexture name="BF Dies pixel0021" x="700" y="0" width="90" height="81"/>
<SubTexture name="BF Dies pixel0022" x="800" y="0" width="90" height="81"/>
<SubTexture name="BF Dies pixel0023" x="800" y="0" width="90" height="81"/>
<SubTexture name="BF Dies pixel0024" x="900" y="0" width="90" height="81"/>
<SubTexture name="BF Dies pixel0025" x="0" y="91" width="90" height="81"/>
<SubTexture name="BF Dies pixel0026" x="0" y="91" width="90" height="81"/>
<SubTexture name="BF Dies pixel0027" x="100" y="91" width="90" height="81"/>
<SubTexture name="BF Dies pixel0028" x="100" y="91" width="90" height="81"/>
<SubTexture name="BF Dies pixel0029" x="200" y="91" width="90" height="81"/>
<SubTexture name="BF Dies pixel0030" x="200" y="91" width="90" height="81"/>
<SubTexture name="BF Dies pixel0031" x="300" y="91" width="90" height="81"/>
<SubTexture name="BF Dies pixel0032" x="300" y="91" width="90" height="81"/>
<SubTexture name="BF Dies pixel0033" x="300" y="91" width="90" height="81"/>
<SubTexture name="BF Dies pixel0034" x="400" y="91" width="90" height="81"/>
<SubTexture name="BF Dies pixel0035" x="500" y="91" width="90" height="81"/>
<SubTexture name="BF Dies pixel0036" x="600" y="91" width="90" height="81"/>
<SubTexture name="BF Dies pixel0037" x="700" y="91" width="90" height="81"/>
<SubTexture name="BF Dies pixel0038" x="800" y="91" width="90" height="81"/>
<SubTexture name="BF Dies pixel0039" x="900" y="91" width="90" height="81"/>
<SubTexture name="BF Dies pixel0040" x="0" y="182" width="90" height="81"/>
<SubTexture name="BF Dies pixel0041" x="100" y="182" width="90" height="81"/>
<SubTexture name="BF Dies pixel0042" x="200" y="182" width="90" height="81"/>
<SubTexture name="BF Dies pixel0043" x="300" y="182" width="90" height="81"/>
<SubTexture name="BF Dies pixel0044" x="400" y="182" width="90" height="81"/>
<SubTexture name="BF Dies pixel0045" x="500" y="182" width="90" height="81"/>
<SubTexture name="BF Dies pixel0046" x="600" y="182" width="90" height="81"/>
<SubTexture name="BF Dies pixel0047" x="700" y="182" width="90" height="81"/>
<SubTexture name="BF Dies pixel0048" x="800" y="182" width="90" height="81"/>
<SubTexture name="BF Dies pixel0049" x="900" y="182" width="90" height="81"/>
<SubTexture name="BF Dies pixel0050" x="0" y="273" width="90" height="81"/>
<SubTexture name="BF Dies pixel0051" x="100" y="273" width="90" height="81"/>
<SubTexture name="BF Dies pixel0052" x="200" y="273" width="90" height="81"/>
<SubTexture name="BF Dies pixel0053" x="300" y="273" width="90" height="81"/>
<SubTexture name="BF Dies pixel0054" x="400" y="273" width="90" height="81"/>
<SubTexture name="BF Dies pixel0055" x="500" y="273" width="90" height="81"/>
<SubTexture name="BF Dies pixel0056" x="691" y="448" width="90" height="81"/>
<SubTexture name="BF Dies pixel0057" x="691" y="448" width="90" height="81"/>
<SubTexture name="RETRY CONFIRM0000" x="600" y="273" width="77" height="76"/>
<SubTexture name="RETRY CONFIRM0001" x="687" y="273" width="77" height="76"/>
<SubTexture name="RETRY CONFIRM0002" x="687" y="273" width="77" height="76"/>
<SubTexture name="RETRY CONFIRM0003" x="774" y="273" width="77" height="76"/>
<SubTexture name="RETRY CONFIRM0004" x="774" y="273" width="77" height="76"/>
<SubTexture name="RETRY CONFIRM0005" x="861" y="273" width="77" height="76"/>
<SubTexture name="RETRY CONFIRM0006" x="861" y="273" width="77" height="76"/>
<SubTexture name="RETRY CONFIRM0007" x="0" y="364" width="77" height="76"/>
<SubTexture name="RETRY CONFIRM0008" x="87" y="364" width="77" height="76"/>
<SubTexture name="RETRY CONFIRM0009" x="174" y="364" width="77" height="76"/>
<SubTexture name="RETRY CONFIRM0010" x="261" y="364" width="77" height="76"/>
<SubTexture name="RETRY CONFIRM0011" x="348" y="364" width="77" height="76"/>
<SubTexture name="RETRY CONFIRM0012" x="435" y="364" width="77" height="76"/>
<SubTexture name="RETRY CONFIRM0013" x="522" y="364" width="77" height="76"/>
<SubTexture name="RETRY CONFIRM0014" x="609" y="364" width="77" height="76"/>
<SubTexture name="RETRY CONFIRM0015" x="696" y="364" width="77" height="76"/>
<SubTexture name="RETRY CONFIRM0016" x="783" y="364" width="77" height="76"/>
<SubTexture name="RETRY CONFIRM0017" x="870" y="364" width="77" height="76"/>
<SubTexture name="RETRY CONFIRM0018" x="0" y="450" width="77" height="76"/>
<SubTexture name="RETRY CONFIRM0019" x="87" y="450" width="77" height="76"/>
<SubTexture name="RETRY CONFIRM0020" x="174" y="450" width="77" height="76"/>
<SubTexture name="RETRY CONFIRM0021" x="261" y="450" width="77" height="76"/>
<SubTexture name="RETRY CONFIRM0022" x="348" y="450" width="77" height="76"/>
<SubTexture name="RETRY CONFIRM0023" x="435" y="450" width="77" height="76"/>
<SubTexture name="RETRY CONFIRM0024" x="522" y="450" width="77" height="76"/>
<SubTexture name="RETRY CONFIRM0025" x="609" y="450" width="77" height="76"/>
<SubTexture name="RETRY CONFIRM0026" x="696" y="450" width="77" height="76"/>
<SubTexture name="RETRY CONFIRM0027" x="696" y="450" width="77" height="76"/>
<SubTexture name="RETRY CONFIRM0028" x="696" y="450" width="77" height="76"/>
<SubTexture name="RETRY CONFIRM0029" x="696" y="450" width="77" height="76"/>
<SubTexture name="RETRY CONFIRM0030" x="696" y="450" width="77" height="76"/>
<SubTexture name="RETRY CONFIRM0031" x="696" y="450" width="77" height="76"/>
<SubTexture name="RETRY CONFIRM0032" x="696" y="450" width="77" height="76"/>
<SubTexture name="RETRY CONFIRM0033" x="696" y="450" width="77" height="76"/>
<SubTexture name="Retry Loop0000" x="783" y="450" width="77" height="76"/>
<SubTexture name="Retry Loop0001" x="870" y="450" width="77" height="76"/>
<SubTexture name="Retry Loop0002" x="870" y="450" width="77" height="76"/>
<SubTexture name="Retry Loop0003" x="0" y="536" width="77" height="76"/>
<SubTexture name="Retry Loop0004" x="0" y="536" width="77" height="76"/>
<SubTexture name="Retry Loop0005" x="696" y="450" width="77" height="76"/>
<SubTexture name="Retry Loop0006" x="696" y="450" width="77" height="76"/>
<SubTexture name="Retry Loop0007" x="87" y="536" width="77" height="76"/>
<SubTexture name="Retry Loop0008" x="696" y="450" width="77" height="76"/>
<SubTexture name="Retry Loop0009" x="696" y="450" width="77" height="76"/>
<SubTexture name="Retry Loop0010" x="696" y="450" width="77" height="76"/>
<SubTexture name="Retry Loop0011" x="696" y="450" width="77" height="76"/>
<SubTexture name="Retry Loop0012" x="696" y="450" width="77" height="76"/>
<SubTexture name="Retry Loop0013" x="696" y="450" width="77" height="76"/>
<SubTexture name="Retry Loop0014" x="696" y="450" width="77" height="76"/>
<SubTexture name="Retry Loop0015" x="696" y="450" width="77" height="76"/>
<SubTexture name="Retry Loop0016" x="696" y="450" width="77" height="76"/>
<SubTexture name="Retry Loop0017" x="783" y="450" width="77" height="76"/>
<SubTexture name="Retry Loop0018" x="870" y="450" width="77" height="76"/>
<SubTexture name="Retry Loop0019" x="870" y="450" width="77" height="76"/>
<SubTexture name="Retry Loop0020" x="0" y="536" width="77" height="76"/>
<SubTexture name="Retry Loop0021" x="0" y="536" width="77" height="76"/>
<SubTexture name="Retry Loop0022" x="696" y="450" width="77" height="76"/>
<SubTexture name="Retry Loop0023" x="696" y="450" width="77" height="76"/>
<SubTexture name="Retry Loop0024" x="696" y="450" width="77" height="76"/>
<SubTexture name="Retry Loop0025" x="696" y="450" width="77" height="76"/>
<SubTexture name="Retry Loop0026" x="696" y="450" width="77" height="76"/>
<SubTexture name="Retry Loop0027" x="696" y="450" width="77" height="76"/>
<SubTexture name="Retry Loop0028" x="696" y="450" width="77" height="76"/>
<SubTexture name="Retry Loop0029" x="696" y="450" width="77" height="76"/>
<SubTexture name="Retry Loop0030" x="87" y="536" width="77" height="76"/>
<SubTexture name="Retry Loop0031" x="696" y="450" width="77" height="76"/>
<SubTexture name="Retry Loop0032" x="696" y="450" width="77" height="76"/>
<SubTexture name="Retry Loop0033" x="696" y="450" width="77" height="76"/>
</TextureAtlas>
@@ -368,7 +368,7 @@ class FunkinShader extends FlxShader implements IHScriptCustomBehaviour {
}
if (!Reflect.hasField(data, name)) return null;
var field = Reflect.field(data, name);
var cl = Std.string(Type.getClass(field));
var cl = Type.getClassName(Type.getClass(field));
// cant do "field is ShaderInput" for some reason
if (cl.startsWith("openfl.display.ShaderParameter")) {
@@ -393,8 +393,7 @@ class FunkinShader extends FlxShader implements IHScriptCustomBehaviour {
return val;
} else {
var field = Reflect.field(data, name);
var cl = Std.string(Type.getClass(field));
var cl = Type.getClassName(Type.getClass(field));
// cant do "field is ShaderInput" for some reason
if (cl.startsWith("openfl.display.ShaderParameter")) {
@:privateAccess
+71 -37
View File
@@ -49,58 +49,92 @@ class NativeAPI {
/**
* Sets the console colors
*/
public static function setConsoleColors(foregroundColor:ConsoleColor = LIGHTGRAY, ?backgroundColor:ConsoleColor = BLACK) {
public static function setConsoleColors(foregroundColor:ConsoleColor = NONE, ?backgroundColor:ConsoleColor = NONE) {
#if windows
if(foregroundColor == NONE)
foregroundColor = LIGHTGRAY;
if(backgroundColor == NONE)
backgroundColor = BLACK;
var fg = cast(foregroundColor, Int);
var bg = cast(backgroundColor, Int);
Windows.setConsoleColors((bg * 16) + fg);
#else
Sys.print("\x1b[0m");
if(foregroundColor != NONE)
Sys.print("\x1b[" + Std.int(consoleColorToANSI(foregroundColor)) + "m");
if(backgroundColor != NONE)
Sys.print("\x1b[" + Std.int(consoleColorToANSI(backgroundColor) + 10) + "m");
#end
}
public static function consoleColorToANSI(color:ConsoleColor) {
return switch(color) {
case BLACK: 30;
case DARKBLUE: 34;
case DARKGREEN: 32;
case DARKCYAN: 36;
case DARKRED: 31;
case DARKMAGENTA: 35;
case DARKYELLOW: 33;
case LIGHTGRAY: 37;
case GRAY: 90;
case BLUE: 94;
case GREEN: 92;
case CYAN: 96;
case RED: 91;
case MAGENTA: 95;
case YELLOW: 93;
case WHITE | _: 97;
}
}
public static function consoleColorToOpenFL(color:ConsoleColor) {
return switch(color) {
case BLACK: 0xFF000000;
case DARKBLUE: 0xFF000088;
case DARKGREEN: 0xFF008800;
case DARKCYAN: 0xFF008888;
case DARKRED: 0xFF880000;
case DARKMAGENTA: 0xFF880000;
case BLACK: 0xFF000000;
case DARKBLUE: 0xFF000088;
case DARKGREEN: 0xFF008800;
case DARKCYAN: 0xFF008888;
case DARKRED: 0xFF880000;
case DARKMAGENTA: 0xFF880000;
case DARKYELLOW: 0xFF888800;
case LIGHTGRAY: 0xFFBBBBBB;
case GRAY: 0xFF888888;
case BLUE: 0xFF0000FF;
case GREEN: 0xFF00FF00;
case CYAN: 0xFF00FFFF;
case RED: 0xFFFF0000;
case MAGENTA: 0xFFFF00FF;
case LIGHTGRAY: 0xFFBBBBBB;
case GRAY: 0xFF888888;
case BLUE: 0xFF0000FF;
case GREEN: 0xFF00FF00;
case CYAN: 0xFF00FFFF;
case RED: 0xFFFF0000;
case MAGENTA: 0xFFFF00FF;
case YELLOW: 0xFFFFFF00;
case WHITE | _: 0xFFFFFFFF;
case WHITE | _: 0xFFFFFFFF;
}
}
}
@:enum abstract ConsoleColor(Int) {
var BLACK:ConsoleColor = 0;
var DARKBLUE:ConsoleColor = 1;
var DARKGREEN:ConsoleColor = 2;
var DARKCYAN:ConsoleColor = 3;
var DARKRED:ConsoleColor = 4;
var DARKMAGENTA:ConsoleColor = 5;
var DARKYELLOW:ConsoleColor = 6;
var LIGHTGRAY:ConsoleColor = 7;
var GRAY:ConsoleColor = 8;
var BLUE:ConsoleColor = 9;
var GREEN:ConsoleColor = 10;
var CYAN:ConsoleColor = 11;
var RED:ConsoleColor = 12;
var MAGENTA:ConsoleColor = 13;
var YELLOW:ConsoleColor = 14;
var WHITE:ConsoleColor = 15;
enum abstract ConsoleColor(Int) {
var BLACK = 0;
var DARKBLUE = 1;
var DARKGREEN = 2;
var DARKCYAN = 3;
var DARKRED = 4;
var DARKMAGENTA = 5;
var DARKYELLOW = 6;
var LIGHTGRAY = 7;
var GRAY = 8;
var BLUE = 9;
var GREEN = 10;
var CYAN = 11;
var RED = 12;
var MAGENTA = 13;
var YELLOW = 14;
var WHITE = 15;
var NONE = -1;
}
@:enum abstract MessageBoxIcon(Int) {
var MSG_ERROR:MessageBoxIcon = 0x00000010;
var MSG_QUESTION:MessageBoxIcon = 0x00000020;
var MSG_WARNING:MessageBoxIcon = 0x00000030;
var MSG_INFORMATION:MessageBoxIcon = 0x00000040;
enum abstract MessageBoxIcon(Int) {
var MSG_ERROR = 0x00000010;
var MSG_QUESTION = 0x00000020;
var MSG_WARNING = 0x00000030;
var MSG_INFORMATION = 0x00000040;
}
@@ -30,9 +30,11 @@ class CharacterGhostsHandler extends FlxTypedGroup<Character> {
public function removeGhost(anim:String) {
var ghost:Character = animGhosts.get(anim);
@:privateAccess ghost.animation._curAnim = null;
animGhosts.remove(anim);
ghost.destroy();
@:privateAccess if (ghost != null) {
ghost.animation._curAnim = null;
animGhosts.remove(anim);
ghost.destroy();
}
}
public function updateInfos(xml:Xml) {