moveCharacter
This commit is contained in:
@@ -78,6 +78,10 @@
|
|||||||
(currentState.remove character.actor)
|
(currentState.remove character.actor)
|
||||||
(cc))
|
(cc))
|
||||||
|
|
||||||
|
(method :Void moveCharacter [:Character<FlxStagePosition,FlxStageFacing,ActorFlxSprite> character fromPos fromFacing toPos toFacing :Continuation cc]
|
||||||
|
(hideCharacter character
|
||||||
|
->:Void (showCharacter character ReAppearance cc)))
|
||||||
|
|
||||||
(prop &mut :Null<Continuation> nextCC)
|
(prop &mut :Null<Continuation> nextCC)
|
||||||
(method onContinue [:FlxActionDigital continueAction]
|
(method onContinue [:FlxActionDigital continueAction]
|
||||||
(whenLet [cc nextCC]
|
(whenLet [cc nextCC]
|
||||||
|
@@ -15,6 +15,7 @@ interface Director<Set, StagePosition, StageFacing, ScreenPosition, Actor, Sound
|
|||||||
function showScene(scene:Scene<Set, StagePosition, StageFacing, ScreenPosition, Actor, Prop>, appearance:Appearance, cc:Continuation):Void;
|
function showScene(scene:Scene<Set, StagePosition, StageFacing, ScreenPosition, Actor, Prop>, appearance:Appearance, cc:Continuation):Void;
|
||||||
function showCharacter(character:Character<StagePosition, StageFacing, Actor>, appearance:Appearance, cc:Continuation):Void;
|
function showCharacter(character:Character<StagePosition, StageFacing, Actor>, appearance:Appearance, cc:Continuation):Void;
|
||||||
function hideCharacter(character:Character<StagePosition, StageFacing, Actor>, cc:Continuation):Void;
|
function hideCharacter(character:Character<StagePosition, StageFacing, Actor>, cc:Continuation):Void;
|
||||||
|
function moveCharacter(character:Character<StagePosition, StageFacing, Actor>, fromPos:StagePosition, fromFacing:StageFacing, toPos:StagePosition, toFacing:StageFacing, cc:Continuation):Void;
|
||||||
function playSound(sound:Sound, volumeMod:Float, waitForEnd:Bool, cc:Continuation):Void;
|
function playSound(sound:Sound, volumeMod:Float, waitForEnd:Bool, cc:Continuation):Void;
|
||||||
function playSong(song:Song, volumeMod:Float, loop:Bool, waitForEnd:Bool, cc:Continuation):Void;
|
function playSong(song:Song, volumeMod:Float, loop:Bool, waitForEnd:Bool, cc:Continuation):Void;
|
||||||
function stopSong():Void;
|
function stopSong():Void;
|
||||||
|
@@ -230,6 +230,14 @@
|
|||||||
(.remove .characters (_currentScene) actorName)
|
(.remove .characters (_currentScene) actorName)
|
||||||
(director.hideCharacter c cc)))
|
(director.hideCharacter c cc)))
|
||||||
|
|
||||||
|
(hollywooMethod moveCharacter false [actorName :StagePosition newPosition :StageFacing newFacing :Continuation cc]
|
||||||
|
(let [c (dictGet .characters (_currentScene) actorName)
|
||||||
|
oldPosition c.stagePosition
|
||||||
|
oldFacing c.stageFacing]
|
||||||
|
(set c.stagePosition newPosition)
|
||||||
|
(set c.stageFacing newFacing)
|
||||||
|
(director.moveCharacter c oldPosition oldFacing newPosition newFacing cc)))
|
||||||
|
|
||||||
// TODO moveCharacter remove them, add them to another scene
|
// TODO moveCharacter remove them, add them to another scene
|
||||||
// TODO moveCharacterAndFollow remove them, add them to another scene, set that the scene
|
// TODO moveCharacterAndFollow remove them, add them to another scene, set that the scene
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user