mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-11-30 03:25:47 -05:00
Use animOffsets
directly.
This commit is contained in:
parent
dd86934712
commit
f6334fb30b
1 changed files with 2 additions and 13 deletions
|
@ -68,11 +68,6 @@ class Bopper extends StageProp implements IPlayStateScriptedClass
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Internally used to define the animation offsets to apply.
|
|
||||||
*/
|
|
||||||
var _currentAnimOffset:FlxPoint = FlxPoint.get();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The offset of the character relative to the position specified by the stage.
|
* The offset of the character relative to the position specified by the stage.
|
||||||
*/
|
*/
|
||||||
|
@ -101,7 +96,6 @@ class Bopper extends StageProp implements IPlayStateScriptedClass
|
||||||
if (animOffsets == null) animOffsets = [0, 0];
|
if (animOffsets == null) animOffsets = [0, 0];
|
||||||
if ((animOffsets[0] == value[0]) && (animOffsets[1] == value[1])) return value;
|
if ((animOffsets[0] == value[0]) && (animOffsets[1] == value[1])) return value;
|
||||||
|
|
||||||
_currentAnimOffset.set(value[0], value[1]);
|
|
||||||
return animOffsets = value;
|
return animOffsets = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -354,16 +348,11 @@ class Bopper extends StageProp implements IPlayStateScriptedClass
|
||||||
override function getScreenPosition(?result:FlxPoint, ?camera:FlxCamera):FlxPoint
|
override function getScreenPosition(?result:FlxPoint, ?camera:FlxCamera):FlxPoint
|
||||||
{
|
{
|
||||||
var output:FlxPoint = super.getScreenPosition(result, camera);
|
var output:FlxPoint = super.getScreenPosition(result, camera);
|
||||||
output -= _currentAnimOffset;
|
output.x -= animOffsets[0];
|
||||||
|
output.y -= animOffsets[1];
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
override function destroy():Void
|
|
||||||
{
|
|
||||||
_currentAnimOffset = flixel.util.FlxDestroyUtil.put(_currentAnimOffset);
|
|
||||||
super.destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function onPause(event:PauseScriptEvent) {}
|
public function onPause(event:PauseScriptEvent) {}
|
||||||
|
|
||||||
public function onResume(event:ScriptEvent) {}
|
public function onResume(event:ScriptEvent) {}
|
||||||
|
|
Loading…
Reference in a new issue