try fix getProp/ActorName

This commit is contained in:
2024-09-25 17:25:31 -05:00
parent f8669a1de7
commit fb75ed2b52
2 changed files with 13 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
# @install: lix --silent download "gh://github.com/kiss-lang/hollywoo#dd9e50269643e0672e0787c2dc4dda20727c6184" into hollywoo/0.0.0/github/dd9e50269643e0672e0787c2dc4dda20727c6184
# @run: haxelib run-dir hollywoo "${HAXE_LIBCACHE}/hollywoo/0.0.0/github/dd9e50269643e0672e0787c2dc4dda20727c6184"
# @install: lix --silent download "gh://github.com/kiss-lang/hollywoo#e54f37b540c60e3509dcb62761687f3e2d8b677e" into hollywoo/0.0.0/github/e54f37b540c60e3509dcb62761687f3e2d8b677e
# @run: haxelib run-dir hollywoo "${HAXE_LIBCACHE}/hollywoo/0.0.0/github/e54f37b540c60e3509dcb62761687f3e2d8b677e"
-lib kiss
-lib kiss-tools
-cp ${HAXE_LIBCACHE}/hollywoo/0.0.0/github/dd9e50269643e0672e0787c2dc4dda20727c6184/src/
-cp ${HAXE_LIBCACHE}/hollywoo/0.0.0/github/e54f37b540c60e3509dcb62761687f3e2d8b677e/src/
-D hollywoo=0.0.0

View File

@@ -1117,4 +1117,13 @@
(set FlxG.mouse.visible false))
(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)))