pico!!!!
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
||||
<!DOCTYPE codename-engine-character>
|
||||
<character isPlayer="false" flipX="true" x="0" y="300" cam_x="600" >
|
||||
<character isPlayer="false" flipX="true" x="-200" y="300" cam_x="600" >
|
||||
<anim name="idle" anim="Pico Idle Dance" fps="24" loop="false" x="0" y="0" />
|
||||
|
||||
<!-- Sing Animations -->
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
var lights:FlxSprite;
|
||||
|
||||
function create() {
|
||||
lights = stage.getSprite("")
|
||||
}
|
||||
|
||||
function update(elapsed:Float) {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<!DOCTYPE codename-engine-stage>
|
||||
<stage zoom="1.05" name="spooky" folder="stages/philly/">
|
||||
<sprite name="bg" x="-100" y="0" sprite="sky" scroll="0.1"/>
|
||||
<sprite name="city" x="-10" y="0" sprite="city" scroll="0.3" scale="0.85" updateHitbox="true"/>
|
||||
<sprite name="light" x="-10" y="0" sprite="win0" scroll="0.3" scale="0.85" updateHitbox="true"/>
|
||||
<sprite name="streetBehind" x="-40" y="50" sprite="behindTrain" />
|
||||
<sprite name="phillyTrain" x="2000" y="360" sprite="train" />
|
||||
<sprite name="street" x="-40" y="50" sprite="street" />
|
||||
</stage>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 30 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 30 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 30 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 30 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 30 KiB |
+1
-1
@@ -1 +1 @@
|
||||
190
|
||||
193
|
||||
@@ -849,19 +849,19 @@ class PlayState extends MusicBeatState
|
||||
{
|
||||
camFollow.setPosition(boyfriend.getMidpoint().x - 100, boyfriend.getMidpoint().y - 100);
|
||||
|
||||
switch (curStage)
|
||||
{
|
||||
case 'limo':
|
||||
camFollow.x = boyfriend.getMidpoint().x - 300;
|
||||
case 'mall':
|
||||
camFollow.y = boyfriend.getMidpoint().y - 200;
|
||||
case 'school':
|
||||
camFollow.x = boyfriend.getMidpoint().x - 200;
|
||||
camFollow.y = boyfriend.getMidpoint().y - 200;
|
||||
case 'schoolEvil':
|
||||
camFollow.x = boyfriend.getMidpoint().x - 200;
|
||||
camFollow.y = boyfriend.getMidpoint().y - 200;
|
||||
}
|
||||
// switch (curStage)
|
||||
// {
|
||||
// case 'limo':
|
||||
// camFollow.x = boyfriend.getMidpoint().x - 300;
|
||||
// case 'mall':
|
||||
// camFollow.y = boyfriend.getMidpoint().y - 200;
|
||||
// case 'school':
|
||||
// camFollow.x = boyfriend.getMidpoint().x - 200;
|
||||
// camFollow.y = boyfriend.getMidpoint().y - 200;
|
||||
// case 'schoolEvil':
|
||||
// camFollow.x = boyfriend.getMidpoint().x - 200;
|
||||
// camFollow.y = boyfriend.getMidpoint().y - 200;
|
||||
// }
|
||||
|
||||
camFollow.x += boyfriend.globalOffset.x;
|
||||
camFollow.y += boyfriend.globalOffset.y;
|
||||
|
||||
@@ -9,7 +9,12 @@ import funkin.interfaces.IBeatReceiver;
|
||||
class Stage extends FlxBasic implements IBeatReceiver {
|
||||
public var stageXML:Access;
|
||||
public var stageSprites:Map<String, FlxSprite> = [];
|
||||
public var stageScript:Script;
|
||||
|
||||
public function getSprite(name:String) {
|
||||
return stageSprites[name];
|
||||
}
|
||||
|
||||
public function new(stage:String) {
|
||||
super();
|
||||
if (PlayState.instance == null) return;
|
||||
@@ -51,6 +56,12 @@ class Stage extends FlxBasic implements IBeatReceiver {
|
||||
var scroll:Null<Float> = Std.parseFloat(node.att.scroll);
|
||||
if (scroll != null) spr.scrollFactor.set(scroll, scroll);
|
||||
}
|
||||
if (node.has.scale) {
|
||||
var scale:Null<Float> = Std.parseFloat(node.att.scale);
|
||||
if (scale != null) spr.scale.set(scale, scale);
|
||||
}
|
||||
if (node.has.updateHitbox && node.att.updateHitbox == "true") spr.updateHitbox();
|
||||
|
||||
for(anim in node.nodes.anim) CoolUtil.addXMLAnimation(spr, anim);
|
||||
|
||||
stageSprites.set(node.att.name, spr);
|
||||
|
||||
@@ -4,5 +4,15 @@ package funkin.scripting;
|
||||
* Simple class for empty scripts or scripts whose language isn't imported yet.
|
||||
*/
|
||||
class DummyScript extends Script {
|
||||
public var variables:Map<String, Dynamic> = [];
|
||||
|
||||
public override function get(v:String) {return variables.get(v);}
|
||||
public override function set(v:String, v2:Dynamic) {return variables.set(v, v2);}
|
||||
public override function onCall(method:String, parameters:Array<Dynamic>):Dynamic {
|
||||
var func = variables.get(method);
|
||||
if (Reflect.isFunction(func))
|
||||
return (parameters != null && parameters.length > 0) ? Reflect.callMethod(null, func, parameters) : func();
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -21,15 +21,32 @@ class HScript extends Script {
|
||||
return;
|
||||
}
|
||||
interp.errorHandler = _errorHandler;
|
||||
interp.execute(expr);
|
||||
}
|
||||
|
||||
private function _errorHandler(error:Error) {
|
||||
this.error('$fileName:${error.line}: ${error.toString()}');
|
||||
}
|
||||
|
||||
public override function call(func:String, ?parameters:Array<Dynamic>):Dynamic {
|
||||
// TODO: call
|
||||
super.call(func, parameters);
|
||||
public override function setParent(parent:Dynamic) {
|
||||
interp.scriptObject = parent;
|
||||
}
|
||||
|
||||
private override function onCall(funcName:String, parameters:Array<Dynamic>):Dynamic {
|
||||
if (interp == null) return null;
|
||||
|
||||
var func = interp.variables.get(funcName);
|
||||
if (Reflect.isFunction(func))
|
||||
return (parameters != null && parameters.length > 0) ? Reflect.callMethod(null, func, parameters) : func();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public override function get(val:String):Dynamic {
|
||||
return interp.variables.get(val);
|
||||
}
|
||||
|
||||
public override function set(val:String, value:Dynamic) {
|
||||
interp.variables.set(val, value);
|
||||
}
|
||||
}
|
||||
@@ -41,7 +41,7 @@ class Script {
|
||||
}
|
||||
|
||||
/**
|
||||
* [Description]
|
||||
* [Description] Creates a new instance of the script class.
|
||||
* @param path
|
||||
*/
|
||||
public function new(path:String) {
|
||||
@@ -58,13 +58,28 @@ class Script {
|
||||
* @param path Path to the script.
|
||||
*/
|
||||
public function onCreate(path:String) {}
|
||||
|
||||
/**
|
||||
* [Description] Calls the function `func` defined in the script.
|
||||
* @param func Name of the function
|
||||
* @param parameters (Optional) Parameters of the function.
|
||||
* @return Dynamic Result (if void, then null)
|
||||
*/
|
||||
public function call(func:String, ?parameters:Array<Dynamic>):Dynamic {return null;}
|
||||
public function call(func:String, ?parameters:Array<Dynamic>):Dynamic {
|
||||
var oldScript = curScript;
|
||||
curScript = this;
|
||||
|
||||
var result = onCall(func, parameters == null ? [] : parameters);
|
||||
|
||||
curScript = oldScript;
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* [Description] Sets a script's parent object so that its properties can be accessed easily. Ex: Passing `PlayState.instace` will allow `boyfriend` to be typed instead of `PlayState.instance.boyfriend`.
|
||||
* @param variable Parent variable.
|
||||
*/
|
||||
public function setParent(variable:Dynamic) {}
|
||||
|
||||
/**
|
||||
* [Description] Gets the variable `variable` from the script's variables.
|
||||
@@ -89,4 +104,11 @@ class Script {
|
||||
// TODO: Logs (like on YCE)
|
||||
trace('$text');
|
||||
}
|
||||
|
||||
/**
|
||||
* PRIVATE HANDLERS - DO NOT TOUCH
|
||||
*/
|
||||
private function onCall(func:String, parameters:Array<Dynamic>):Dynamic {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user