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>
|
<!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" />
|
<anim name="idle" anim="Pico Idle Dance" fps="24" loop="false" x="0" y="0" />
|
||||||
|
|
||||||
<!-- Sing Animations -->
|
<!-- 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);
|
camFollow.setPosition(boyfriend.getMidpoint().x - 100, boyfriend.getMidpoint().y - 100);
|
||||||
|
|
||||||
switch (curStage)
|
// switch (curStage)
|
||||||
{
|
// {
|
||||||
case 'limo':
|
// case 'limo':
|
||||||
camFollow.x = boyfriend.getMidpoint().x - 300;
|
// camFollow.x = boyfriend.getMidpoint().x - 300;
|
||||||
case 'mall':
|
// case 'mall':
|
||||||
camFollow.y = boyfriend.getMidpoint().y - 200;
|
// camFollow.y = boyfriend.getMidpoint().y - 200;
|
||||||
case 'school':
|
// case 'school':
|
||||||
camFollow.x = boyfriend.getMidpoint().x - 200;
|
// camFollow.x = boyfriend.getMidpoint().x - 200;
|
||||||
camFollow.y = boyfriend.getMidpoint().y - 200;
|
// camFollow.y = boyfriend.getMidpoint().y - 200;
|
||||||
case 'schoolEvil':
|
// case 'schoolEvil':
|
||||||
camFollow.x = boyfriend.getMidpoint().x - 200;
|
// camFollow.x = boyfriend.getMidpoint().x - 200;
|
||||||
camFollow.y = boyfriend.getMidpoint().y - 200;
|
// camFollow.y = boyfriend.getMidpoint().y - 200;
|
||||||
}
|
// }
|
||||||
|
|
||||||
camFollow.x += boyfriend.globalOffset.x;
|
camFollow.x += boyfriend.globalOffset.x;
|
||||||
camFollow.y += boyfriend.globalOffset.y;
|
camFollow.y += boyfriend.globalOffset.y;
|
||||||
|
|||||||
@@ -9,6 +9,11 @@ import funkin.interfaces.IBeatReceiver;
|
|||||||
class Stage extends FlxBasic implements IBeatReceiver {
|
class Stage extends FlxBasic implements IBeatReceiver {
|
||||||
public var stageXML:Access;
|
public var stageXML:Access;
|
||||||
public var stageSprites:Map<String, FlxSprite> = [];
|
public var stageSprites:Map<String, FlxSprite> = [];
|
||||||
|
public var stageScript:Script;
|
||||||
|
|
||||||
|
public function getSprite(name:String) {
|
||||||
|
return stageSprites[name];
|
||||||
|
}
|
||||||
|
|
||||||
public function new(stage:String) {
|
public function new(stage:String) {
|
||||||
super();
|
super();
|
||||||
@@ -51,6 +56,12 @@ class Stage extends FlxBasic implements IBeatReceiver {
|
|||||||
var scroll:Null<Float> = Std.parseFloat(node.att.scroll);
|
var scroll:Null<Float> = Std.parseFloat(node.att.scroll);
|
||||||
if (scroll != null) spr.scrollFactor.set(scroll, 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);
|
for(anim in node.nodes.anim) CoolUtil.addXMLAnimation(spr, anim);
|
||||||
|
|
||||||
stageSprites.set(node.att.name, spr);
|
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.
|
* Simple class for empty scripts or scripts whose language isn't imported yet.
|
||||||
*/
|
*/
|
||||||
class DummyScript extends Script {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
interp.errorHandler = _errorHandler;
|
interp.errorHandler = _errorHandler;
|
||||||
|
interp.execute(expr);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function _errorHandler(error:Error) {
|
private function _errorHandler(error:Error) {
|
||||||
this.error('$fileName:${error.line}: ${error.toString()}');
|
this.error('$fileName:${error.line}: ${error.toString()}');
|
||||||
}
|
}
|
||||||
|
|
||||||
public override function call(func:String, ?parameters:Array<Dynamic>):Dynamic {
|
public override function setParent(parent:Dynamic) {
|
||||||
// TODO: call
|
interp.scriptObject = parent;
|
||||||
super.call(func, parameters);
|
}
|
||||||
|
|
||||||
|
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;
|
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
|
* @param path
|
||||||
*/
|
*/
|
||||||
public function new(path:String) {
|
public function new(path:String) {
|
||||||
@@ -58,13 +58,28 @@ class Script {
|
|||||||
* @param path Path to the script.
|
* @param path Path to the script.
|
||||||
*/
|
*/
|
||||||
public function onCreate(path:String) {}
|
public function onCreate(path:String) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* [Description] Calls the function `func` defined in the script.
|
* [Description] Calls the function `func` defined in the script.
|
||||||
* @param func Name of the function
|
* @param func Name of the function
|
||||||
* @param parameters (Optional) Parameters of the function.
|
* @param parameters (Optional) Parameters of the function.
|
||||||
* @return Dynamic Result (if void, then null)
|
* @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.
|
* [Description] Gets the variable `variable` from the script's variables.
|
||||||
@@ -89,4 +104,11 @@ class Script {
|
|||||||
// TODO: Logs (like on YCE)
|
// TODO: Logs (like on YCE)
|
||||||
trace('$text');
|
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