AnimationEngine Arcade "shooter" strategy?
johnpatten at mac.com
Fri Jan 15 22:09:06 CST 2010
I just have one little issue with the example. I have the aeEnterFrame deleting the grc "target" when there is a collision between the projectile and the grc "target." However, after it deletes the grc it throws up the script dialog box immediately with "password required" for the AnimationEngine stack.
I think it's related to the aeMoveDone call, because after I delete the grc "target" it can't complete the aeMoveTo nestled in the aeMoveDone call anymore.
I attempted to trap for this by adding some conditions based on the number of grc "target" (s), so that if it = 0 it would just exit aeMoveDone. That didn't seem to help. Any suggestions?
Thanks for your help!
Date: Fri, 15 Jan 2010 01:45:43 +0100
From: Malte Pfaff-Brill <revolution at derbrill.de>
Subject: Re: AnimationEngine Arcade "shooter" strategy?
To: use-revolution at lists.runrev.com
Message-ID: <C68C4F21-E294-4F1F-9D62-82805C460630 at derbrill.de>
Content-Type: text/plain; charset=us-ascii
if you use AE 2.9 or higher, aeMoveTo is your friend.
aeMoveTo is a one line command that moves your object. it automatically sets up the needed timer to move the object and moves it from its current location to an end point you specify. You can apply an easing effect to the movement, which makes it look quite nicely. Also, aeMoveTo sends callback messages, while the object is moving.
Here is a starter. Assumes AE is in use and a button "projectile" and a button "target" exist. Also an image "cannon" Script is in the card:
set the loc of btn "projectile" to the loc of image "cannon"
aeMoveTo the long ID of btn "projectile",the mouseLoc,400,"inOut"
if intersect(btn "projectile",btn "target") then
--more sophisticated collision detection goes here
Hope that helps,
More information about the use-livecode