I am trying to make a MovieClip follow another MovieClip until contact
I am trying to make a MovieClip follow another MovieClip until contact
I am trying to make a MovieClip follow another MovieClip until contact. One MovieClip moves by Accelerometer, I have done the accelerometer part. I just need the other half which is moving a Movieclip by itself towards the movieclip with accelerometer event
if(mc1.x > mc2.x){ mc2.x++; }
I tried this code but I am sure there is a simpler way to do it
– Bryan Perez
Jul 2 at 16:50
my two objects are ship and enemy, I am trying for the enemy to follow the ship until contact or shoot by the player
– Bryan Perez
Jul 2 at 16:51
Nope, no magical solutions for it. You'll need a loop, conditions for contact and alive state, and then just compare x and y relations and move the enemy depending on that information.
– kaarto
2 days ago
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
What have you tried so far?
if(mc1.x > mc2.x){ mc2.x++; }and so on?– kaarto
Jul 1 at 4:36