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

@@ -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)))