week 6 have started development

This commit is contained in:
Yoshman29
2022-11-04 04:06:31 +01:00
parent 9d4176d0ca
commit 930d6833ef
50 changed files with 283 additions and 30 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+38
View File
@@ -0,0 +1,38 @@
import funkin.system.Paths;
var daPixelZoom = 6;
// function onStrumCreation(event) {
// event.cancel();
// var strum = event.strum;
// strum.loadGraphic(Paths.image('stages/school/arrows-pixels'), true, 17, 17);
// strum.animation.add("scroll", [6 + strum.ID]);
// }
function onNoteCreation(event) {
event.cancel();
var note = event.note;
if (event.note.isSustainNote) {
note.loadGraphic(Paths.image('stages/school/ui/arrowEnds'), true, 7, 6);
note.animation.add("hold", [event.strumID]);
note.animation.add("holdend", [4 + event.strumID]);
} else {
note.loadGraphic(Paths.image('stages/school/ui/arrows-pixels'), true, 17, 17);
note.animation.add("scroll", [4 + event.strumID]);
}
note.scale.set(daPixelZoom, daPixelZoom);
note.updateHitbox();
}
function onStrumCreation(event) {
event.cancel();
var strum = event.strum;
strum.loadGraphic(Paths.image('stages/school/ui/arrows-pixels'), true, 17, 17);
strum.animation.add("static", [event.strumID]);
strum.animation.add("pressed", [4 + event.strumID, 8 + event.strumID], 12, false);
strum.animation.add("confirm", [12 + event.strumID, 16 + event.strumID], 24, false);
strum.scale.set(daPixelZoom, daPixelZoom);
strum.updateHitbox();
}
+3
View File
@@ -0,0 +1,3 @@
function create() {
importScript("data/scripts/pixel");
}
+4
View File
@@ -0,0 +1,4 @@
<!DOCTYPE codename-engine-stage>
<stage zoom="1.05" name="spooky" folder="stages/school/">
<sprite name="bg" x="-200" y="-100" sprite="halloween_bg" />
</stage>
Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 418 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<TextureAtlas imagePath="dialogueBox-evil.png">
<!-- Created with Adobe Animate version 20.0.0.17400 -->
<!-- http://www.adobe.com/products/animate.html -->
<SubTexture name="Spirit Textbox spawn instance 10000" x="0" y="0" width="249" height="145"/>
<SubTexture name="Spirit Textbox spawn instance 10001" x="0" y="0" width="249" height="145"/>
<SubTexture name="Spirit Textbox spawn instance 10002" x="259" y="0" width="249" height="145"/>
<SubTexture name="Spirit Textbox spawn instance 10003" x="259" y="0" width="249" height="145"/>
<SubTexture name="Spirit Textbox spawn instance 10004" x="0" y="155" width="249" height="145"/>
<SubTexture name="Spirit Textbox spawn instance 10005" x="0" y="155" width="249" height="145"/>
<SubTexture name="Spirit Textbox spawn instance 10006" x="259" y="155" width="249" height="145"/>
<SubTexture name="Spirit Textbox spawn instance 10007" x="259" y="155" width="249" height="145"/>
<SubTexture name="Spirit Textbox spawn instance 10008" x="0" y="310" width="249" height="145"/>
<SubTexture name="Spirit Textbox spawn instance 10009" x="0" y="310" width="249" height="145"/>
<SubTexture name="Spirit Textbox spawn instance 10010" x="259" y="310" width="249" height="145"/>
<SubTexture name="Spirit Textbox spawn instance 10011" x="259" y="310" width="249" height="145"/>
</TextureAtlas>
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<TextureAtlas imagePath="dialogueBox-pixel.png">
<!-- Created with Adobe Animate version 20.0.0.17400 -->
<!-- http://www.adobe.com/products/animate.html -->
<SubTexture name="Text Box Appear instance 10000" x="0" y="0" width="249" height="144"/>
<SubTexture name="Text Box Appear instance 10001" x="259" y="0" width="249" height="144"/>
<SubTexture name="Text Box Appear instance 10002" x="0" y="154" width="249" height="144"/>
<SubTexture name="Text Box Appear instance 10003" x="259" y="154" width="249" height="144"/>
<SubTexture name="Text Box Appear instance 10004" x="259" y="154" width="249" height="144"/>
</TextureAtlas>
Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<TextureAtlas imagePath="dialogueBox-senpaiMad.png">
<!-- Created with Adobe Animate version 20.0.0.17400 -->
<!-- http://www.adobe.com/products/animate.html -->
<SubTexture name="SENPAI ANGRY IMPACT SPEECH instance 10000" x="0" y="0" width="249" height="144"/>
<SubTexture name="SENPAI ANGRY IMPACT SPEECH instance 10001" x="259" y="0" width="249" height="144"/>
<SubTexture name="SENPAI ANGRY IMPACT SPEECH instance 10002" x="0" y="154" width="249" height="144"/>
<SubTexture name="SENPAI ANGRY IMPACT SPEECH instance 10003" x="259" y="154" width="249" height="144"/>
<SubTexture name="SENPAI ANGRY IMPACT SPEECH instance 10004" x="0" y="308" width="249" height="144"/>
<SubTexture name="SENPAI ANGRY IMPACT SPEECH instance 10005" x="0" y="308" width="249" height="144"/>
<SubTexture name="SENPAI ANGRY IMPACT SPEECH instance 10006" x="259" y="308" width="249" height="144"/>
<SubTexture name="SENPAI ANGRY IMPACT SPEECH instance 10007" x="259" y="308" width="249" height="144"/>
</TextureAtlas>
Binary file not shown.

After

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 628 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 553 B

+1 -1
View File
@@ -1 +1 @@
1084
1095
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+10 -1
View File
@@ -1,5 +1,6 @@
package funkin.game;
import flixel.FlxCamera;
import flixel.FlxSprite;
import flixel.graphics.frames.FlxAtlasFrames;
import flixel.math.FlxMath;
@@ -55,6 +56,9 @@ class Note extends FlxSprite
public var noteAngle:Null<Float> = null;
public var noteType(get, null):String;
@:dox(hide) public var __strumCameras:Array<FlxCamera> = null;
private function get_noteType() {
return PlayState.instance.getNoteType(noteTypeID);
}
@@ -117,7 +121,6 @@ class Note extends FlxSprite
}
}
animation.play("scroll");
if (isSustainNote && prevNote != null)
{
@@ -131,6 +134,8 @@ class Note extends FlxSprite
prevNote.nextSustain = this;
prevNote.animation.play('hold');
}
} else {
animation.play("scroll");
}
}
@@ -138,6 +143,9 @@ class Note extends FlxSprite
public var angleOffsets:Bool = true;
override function draw() {
@:privateAccess var oldDefaultCameras = FlxCamera._defaultCameras;
@:privateAccess if (__strumCameras != null) FlxCamera._defaultCameras = __strumCameras;
var negativeScroll = isSustainNote && nextSustain != null && lastScrollSpeed < 0;
if (negativeScroll) offset.y *= -1;
@@ -183,6 +191,7 @@ class Note extends FlxSprite
}
super.draw();
if (negativeScroll) offset.y *= -1;
@:privateAccess FlxCamera._defaultCameras = oldDefaultCameras;
}
// The * 0.5 is so that it's easier to hit them too late, instead of too early
+14 -6
View File
@@ -300,9 +300,9 @@ class PlayState extends MusicBeatState
add(icon);
}
scoreTxt = new FunkinText(healthBarBG.x + 50, healthBarBG.y + 30, Std.int(healthBarBG.width - 100), "Score:0", 20);
missesTxt = new FunkinText(healthBarBG.x + 50, healthBarBG.y + 30, Std.int(healthBarBG.width - 100), "Misses:0", 20);
accuracyTxt = new FunkinText(healthBarBG.x + 50, healthBarBG.y + 30, Std.int(healthBarBG.width - 100), "Accuracy:-%", 20);
scoreTxt = new FunkinText(healthBarBG.x + 50, healthBarBG.y + 30, Std.int(healthBarBG.width - 100), "Score:0", 16);
missesTxt = new FunkinText(healthBarBG.x + 50, healthBarBG.y + 30, Std.int(healthBarBG.width - 100), "Misses:0", 16);
accuracyTxt = new FunkinText(healthBarBG.x + 50, healthBarBG.y + 30, Std.int(healthBarBG.width - 100), "Accuracy:-%", 16);
for(text in [scoreTxt, missesTxt, accuracyTxt]) {
text.scrollFactor.set();
@@ -1236,9 +1236,11 @@ class PlayState extends MusicBeatState
});
}
notes.forEachAlive(function(note:Note) {
for(e in funcsToExec) e(note);
});
if (funcsToExec.length > 0) {
notes.forEachAlive(function(note:Note) {
for(e in funcsToExec) e(note);
});
}
for(e in notePerStrum) if (e != null) goodNoteHit(e);
for(e in additionalNotes) goodNoteHit(e);
@@ -1326,6 +1328,12 @@ class PlayState extends MusicBeatState
if (event.unmuteVocals) vocals.volume = 1;
if (event.enableCamZooming) camZooming = true;
if (event.autoHitLastSustain) {
if (note.nextSustain != null && note.nextSustain.nextSustain == null) {
// its a tail!!
note.wasGoodHit = true;
}
}
if (event.deleteNote && !note.isSustainNote) deleteNote(note);
}
+15 -10
View File
@@ -1,9 +1,10 @@
package funkin.game;
import funkin.options.Options;
import flixel.FlxSprite;
import flixel.FlxCamera;
import flixel.math.FlxMath;
import flixel.math.FlxPoint;
import funkin.options.Options;
import funkin.system.Conductor;
class Strum extends FlxSprite {
@@ -12,8 +13,9 @@ class Strum extends FlxSprite {
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 var lastDrawCameras(default, null):Array<FlxCamera> = [];
public function getScrollSpeed(?note:Note) {
if (note != null && note.scrollSpeed != null) return note.scrollSpeed;
if (scrollSpeed != null) return scrollSpeed;
@@ -26,12 +28,6 @@ class Strum extends FlxSprite {
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);
@@ -42,14 +38,23 @@ class Strum extends FlxSprite {
}
}
public override function draw() {
lastDrawCameras = [for(c in cameras) c];
super.draw();
}
public function updateNotePosition(daNote:Note) {
if (!daNote.exists) return;
var offset = FlxPoint.get(daNote.isSustainNote ? ((Note.swagWidth - daNote.width) / 2) : 0, (Conductor.songPosition - daNote.strumTime) * (0.45 * FlxMath.roundDecimal(getScrollSpeed(daNote), 2)));
var realOffset = FlxPoint.get(0, 0);
daNote.__strumCameras = lastDrawCameras;
if (daNote.isSustainNote) offset.y -= Note.swagWidth / 2;
daNote.scrollFactor.set(scrollFactor.x, scrollFactor.y);
var noteAngle = getNotesAngle(daNote);
daNote.angle = daNote.isSustainNote ? noteAngle : angle;
if (Std.int(noteAngle % 360) != 0) {
@@ -61,8 +66,8 @@ class Strum extends FlxSprite {
realOffset.x = offset.x;
realOffset.y = offset.y;
}
if (!downscroll)
realOffset.y *= -1;
realOffset.y *= -1;
daNote.setPosition(x + realOffset.x, y + realOffset.y);
offset.put();
+16
View File
@@ -14,6 +14,22 @@ class ScriptPack extends Script {
}
}
public function new(name:String) {
additionalDefaultVariables["importScript"] = importScript;
super(name);
}
public function importScript(path:String):Script {
var script = Script.create(Paths.script(path));
if (script is DummyScript) {
throw 'Script at ${path} does not exist.';
return null;
}
add(script);
script.load();
return script;
}
public override function call(func:String, ?parameters:Array<Dynamic>):Dynamic {
for(e in scripts)
e.call(func, parameters);
@@ -8,6 +8,7 @@ class NoteHitEvent extends CancellableEvent {
@:dox(hide) public var deleteNote:Bool = true;
@:dox(hide) public var unmuteVocals:Bool = true;
@:dox(hide) public var enableCamZooming:Bool = true;
@:dox(hide) public var autoHitLastSustain:Bool = true;
/**
Whenever a miss should be added.
@@ -103,4 +104,13 @@ class NoteHitEvent extends CancellableEvent {
}
@:dox(hide)
public function cancelCamZooming() {preventCamZooming();}
/**
* Prevents the sustain tail (the last one) from being automatically hit when the sustain before it is hit.
*/
public function preventLastSustainHit() {
autoHitLastSustain = false;
}
@:dox(hide)
public function cancelLastSustainHit() {preventLastSustainHit();}
}
+2
View File
@@ -48,6 +48,7 @@ class Logs {
case WARNING: logText(' WARNING ', DARKYELLOW);
case ERROR: logText(' ERROR ', DARKRED);
case TRACE: logText(' TRACE ', GRAY);
case VERBOSE: logText(' VERBOSE ', DARKMAGENTA);
default: logText(' INFORMATION ', CYAN);
},
logText('] ')
@@ -98,6 +99,7 @@ enum abstract Level(Int) {
var WARNING = 1;
var ERROR = 2;
var TRACE = 3;
var VERBOSE = 4;
}
typedef LogText = {
var text:String;
+118
View File
@@ -0,0 +1,118 @@
package lime.utils;
import haxe.PosInfos;
import funkin.system.Logs as FunkinLogs;
#if !lime_debug
@:fileXml('tags="haxe,release"')
@:noDebug
#end
class Log
{
public static var level:LogLevel;
public static function debug(message:Dynamic, ?info:PosInfos):Void
{
if (level >= LogLevel.DEBUG)
{
#if js
untyped __js__("console").debug("[" + info.className + "] " + message);
#else
println("[" + info.className + "] " + Std.string(message));
#end
}
}
public static function error(message:Dynamic, ?info:PosInfos):Void
{
if (level >= LogLevel.ERROR)
{
var message = '[${info.className}] $message';
FunkinLogs.trace(message, ERROR, RED);
}
}
public static function info(message:Dynamic, ?info:PosInfos):Void
{
if (level >= LogLevel.INFO)
FunkinLogs.trace('[${info.className}] $message', INFO, RED);
}
public static inline function print(message:Dynamic):Void
{
#if sys
Sys.print(Std.string(message));
#elseif flash
untyped __global__["trace"](Std.string(message));
#elseif js
untyped __js__("console").log(message);
#else
trace(message);
#end
}
public static inline function println(message:Dynamic):Void
{
#if sys
Sys.println(Std.string(message));
#elseif flash
untyped __global__["trace"](Std.string(message));
#elseif js
untyped __js__("console").log(message);
#else
trace(Std.string(message));
#end
}
public static function verbose(message:Dynamic, ?info:PosInfos):Void
{
if (level >= LogLevel.VERBOSE)
FunkinLogs.trace('[${info.className}] $message', VERBOSE);
}
public static function warn(message:Dynamic, ?info:PosInfos):Void
{
if (level >= LogLevel.WARN)
{
FunkinLogs.trace('[${info.className}] $message', WARNING, YELLOW);
}
}
private static function __init__():Void
{
#if no_traces
level = NONE;
#elseif verbose
level = VERBOSE;
#else
#if sys
var args = Sys.args();
if (args.indexOf("-v") > -1 || args.indexOf("-verbose") > -1)
{
level = VERBOSE;
}
else
#end
{
#if debug
level = DEBUG;
#else
level = INFO;
#end
}
#end
#if js
if (untyped __js__("typeof console") == "undefined")
{
untyped __js__("console = {}");
}
if (untyped __js__("console").log == null)
{
untyped __js__("console").log = function() {};
}
#end
}
}