Skip to main content
Participant
April 13, 2023
Question

Help with collision in Adobe Animate

  • April 13, 2023
  • 2 replies
  • 281 views

I'm currently trying to make a very simple game where the player can click an up or down arrow to move a spaceship while avoiding objects. I need to try and figure out what code to add in to add a game over state whenever the player runs into any objects that fly past. Ideally, I'd like to add some sort or scoring system too, but at the very least I want to detect when the ship collides with an item. I've tried looking at several different Youtube tutorials, but nothing has come close enough to solving my issue. Does anyone have a good resource they could point me to? Or, would you know what I should add into the code to make this work? Thank you

    This topic has been closed for replies.

    2 replies

    JoãoCésar17023019
    Community Expert
    Community Expert
    April 13, 2023

    Hi.

     

    If it's HTML5 Canvas:

    - Use the localToLocal and the hitTest methods. Please check this tutorial for more info.

     

    If it's AS3:

    - Use the hitTestObject or hitTestPoint methods.

     

    In both cases, you could just use a simple circle collision as well.

     

    Please let us know if you need further assistance.

     

    Regards,

    JC

    kglad
    Community Expert
    Community Expert
    April 13, 2023

    html5 or as3?