Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8955905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:39:42+00:00 2026-06-15T14:39:42+00:00

I will try to explain the issue as good as possible. What I want

  • 0

I will try to explain the issue as good as possible.
What I want to do is to check for collision between to objects. Also the bullet and the enemy, if it was 1 of the bullet and 1 of the enemy it would be no problem, but after one day on google and tryed like every solutions I can’t get it to work, or I find a solution that’s absolutely terrible explained.
Im going to make it easyer. I have MainClass.as that document class.
It’s one class for the Enemy and one for the Bullet. As I hope everyone understand I wan’t to check if the bullet hit’s the Enemy. Or the other way. Since the bullet’s are been made while clicking for example it is not possible to direct refere to the bullet. What I have tryed is using sprite container, it does work if i place the bullet on the enemy just to check, but if I place one under and on over that’s NOT hit the Enemy it’s still says that the enemy got hit.
Note, the Enemy are dragged on stage, since im going to have multiple of them. I could also add them with code. Ive tryed to use Array to shuffle between all the enemys but I can’t get it to work.

I know this was much text. Hope someon are willing to help me out, it is so frustrating…

Best regards HFherasen!:):)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T14:39:44+00:00Added an answer on June 15, 2026 at 2:39 pm

    Well, if you don’t use a physics engine, like Box2DFlash, it can be frustrating.

    First, you have to know the speed/frame of the bullet, because if it goes beyond the target in one frame, simple detection won’t work.
    Than, you should have a velocity and direction of the bullet.. For simplicity, lets use one point of it. (the head of the bullet, or the middle)
    The bullet usually moves a lot faster than the targets, so you can assume the targets fixed.
    The target is a rectangle, or polygon possibly rotated.

    Now you have a target, and a line for the bullet (from the point and direction).
    http://keith-hair.net/blog/2008/08/04/find-intersection-point-of-two-lines-in-as3/
    You can use this (converted to as3), with all sides of the target (or only the ones facing to a bullet), and if one matches, the shot will hit a target.
    If your bullet is slower, you can have the position change of the frames as your first line. Than you’ll know, when it hits a target. This is pretty fast, and works well. Hope it helped.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem and I will try to explain the issue: I have
First I will try to explain what I want to do. The app loads
sorry for asking this dumb question i will try to explain as good as
Ok I have a complex issue. I will try to explain clearly. I am
I will try to explain the situation as it is a little bit more
I will try to explain a simple app scenario: My app goes right to
Having trouble with each function... Will try to explain by example... In my code,
Background: I hope my question is not too vague. I will try and explain
Sorry if the post title wasn't clear, I will try to explain a little
Okay, this scenario is a little complicated, but I will try to explain it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.