adopt the new scheme for keeping actor/prop positions tracked
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# @install: lix --silent download "gh://github.com/kiss-lang/hollywoo#cc37d8d33bccb9507af9418171ac1ae809c53660" into hollywoo/0.0.0/github/cc37d8d33bccb9507af9418171ac1ae809c53660
|
# @install: lix --silent download "gh://github.com/kiss-lang/hollywoo#bdba63cc6132c347bd98045bb30bbae3022ca0b5" into hollywoo/0.0.0/github/bdba63cc6132c347bd98045bb30bbae3022ca0b5
|
||||||
# @run: haxelib run-dir hollywoo "${HAXE_LIBCACHE}/hollywoo/0.0.0/github/cc37d8d33bccb9507af9418171ac1ae809c53660"
|
# @run: haxelib run-dir hollywoo "${HAXE_LIBCACHE}/hollywoo/0.0.0/github/bdba63cc6132c347bd98045bb30bbae3022ca0b5"
|
||||||
-lib kiss
|
-lib kiss
|
||||||
-lib kiss-tools
|
-lib kiss-tools
|
||||||
-cp ${HAXE_LIBCACHE}/hollywoo/0.0.0/github/cc37d8d33bccb9507af9418171ac1ae809c53660/src/
|
-cp ${HAXE_LIBCACHE}/hollywoo/0.0.0/github/bdba63cc6132c347bd98045bb30bbae3022ca0b5/src/
|
||||||
-D hollywoo=0.0.0
|
-D hollywoo=0.0.0
|
@@ -1140,13 +1140,4 @@
|
|||||||
(set FlxG.mouse.visible false))
|
(set FlxG.mouse.visible false))
|
||||||
|
|
||||||
(method :FlxLightSource offsetLightSource [:FlxLightSource source :StagePosition offset]
|
(method :FlxLightSource offsetLightSource [:FlxLightSource source :StagePosition offset]
|
||||||
(new FlxLightSource (for point source.points (FlxPoint.get (+ point.x offset.x) (+ point.y offset.y))) source.color))
|
(new FlxLightSource (for point source.points (FlxPoint.get (+ point.x offset.x) (+ point.y offset.y))) source.color))
|
||||||
|
|
||||||
// I'll be proven wrong, but for now I actually think position
|
|
||||||
// is a reasonable indicator of identity for props and actors
|
|
||||||
// that are *currently* in the scene:
|
|
||||||
(method :Bool propEquals [:FlxSprite propA :FlxSprite propB]
|
|
||||||
(and (= propA.x propB.x) (= propA.y propB.y)))
|
|
||||||
|
|
||||||
(method :Bool actorEquals [:ActorFlxSprite actorA :ActorFlxSprite actorB]
|
|
||||||
(and (= actorA.x actorB.x) (= actorA.y actorB.y)))
|
|
@@ -219,18 +219,8 @@
|
|||||||
(linearMotion skipping cSprite (+ destX xOffset) (+ destY yOffset) speed (when (= lastCSprite cSprite) cc))))))
|
(linearMotion skipping cSprite (+ destX xOffset) (+ destY yOffset) speed (when (= lastCSprite cSprite) cc))))))
|
||||||
|
|
||||||
@:keep
|
@:keep
|
||||||
(method linearMotionTo [:Bool skipping :FlxSprite sprite :String positionKey :Float speed &opt :Void->Void cc :String soundLoop :Float volumeMod :Array<FlxSprite> connectedSprites]
|
(method linearMotionTo [:Bool skipping :FlxSprite sprite :String spriteKey :String positionKey :Float speed &opt :Void->Void cc :String soundLoop :Float volumeMod :Array<FlxSprite> connectedSprites]
|
||||||
(let [holderType (typeCase [sprite]
|
(let [position (resolvePosition positionKey spriteKey)]
|
||||||
// Try-catch: Sometimes I've used ActorFlxSprite for props
|
|
||||||
([:ActorFlxSprite actorSprite]
|
|
||||||
(try
|
|
||||||
(hollywoo.Movie.PositionHolder.Actor
|
|
||||||
(getActorName actorSprite))
|
|
||||||
(catch [e]
|
|
||||||
(hollywoo.Movie.PositionHolder.Prop (getPropName actorSprite)))))
|
|
||||||
([:FlxSprite propSprite] (hollywoo.Movie.PositionHolder.Prop (getPropName propSprite)))
|
|
||||||
(never otherwise))
|
|
||||||
position (resolvePosition positionKey holderType)]
|
|
||||||
(linearMotion skipping sprite position.x position.y speed cc soundLoop volumeMod connectedSprites)))
|
(linearMotion skipping sprite position.x position.y speed cc soundLoop volumeMod connectedSprites)))
|
||||||
|
|
||||||
(defMacro _linearMotionTo [withMacro await objectKey positionKey speed soundLoop volumeMod connectedSprites]
|
(defMacro _linearMotionTo [withMacro await objectKey positionKey speed soundLoop volumeMod connectedSprites]
|
||||||
@@ -238,6 +228,7 @@
|
|||||||
(linearMotionTo
|
(linearMotionTo
|
||||||
skipping
|
skipping
|
||||||
o
|
o
|
||||||
|
realKey_o
|
||||||
,positionKey
|
,positionKey
|
||||||
,speed
|
,speed
|
||||||
,(if (eval await) `cc `null)
|
,(if (eval await) `cc `null)
|
||||||
|
Reference in New Issue
Block a user