• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Help with collision in Adobe Animate

New Here ,
Apr 12, 2023 Apr 12, 2023

Copy link to clipboard

Copied

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

Views

161

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 12, 2023 Apr 12, 2023

Copy link to clipboard

Copied

html5 or as3?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 13, 2023 Apr 13, 2023

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines