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 8945181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:11:28+00:00 2026-06-15T12:11:28+00:00

H ello all, I’m creating a game where some particles are created after a

  • 0

Hello all,

I’m creating a game where some particles are created after a collision between two objects. The particles are then given a random x and y velocity and they shoot out in every direction. I’ve been trying to alter the way the particles shoot out to resemble Figure 1, where the particles shoot out at a randoom angle between 330 to 30 and 150 to 210 (I wrote the angles in degrees rather than radians for an ease in understanding). The red areas in Figure 1 are where the particles shouldn’t shoot out and the blue is where they should. I have not been able to achieve the desired effect however. I was wondering if anyone could assist with a link to helpful reading or an example in code. I have been searching google but cannot find a decent example.

Particle spawn angles, blue being able to spawn, red being unable to spawn.

Figure 1

Notes:

    – The angles are written in degrees but will need to be changed to radians because Flash uses radians, a simple conversion (Math.pi/180) added to the code should suffice.
    – Figure 1 resembles the Cartesian Coordinate system but the y axis is inverted in Flash’s coordinate system.
    – I would post the code that I have tried but it is so far from what is desired that it would not help.
  • 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-15T12:11:29+00:00Added an answer on June 15, 2026 at 12:11 pm
    var speed:Number = minSpeed + Math.random() * (maxSpeed - minSpeed);
    var angle:Number = Math.random() * 120 - 30;
    if (angle > 30) angle += 120;
    angle *= Math.PI/180;
    
    var speedX = Math.cos(angle) * speed;
    var speedY = Math.sin(angle) * speed;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ello, I am struggling with some date troubles here in PHP/MySql. I have a
Ello, ive got the Prolog function member which tells us if an element exists
I've got a loop that wants to execute to exhaustion or until some user
following is my code to call the database to find the substring ello. String
I'm creating a hash table in Perl, of an unknown size. The hash table
Ello chaps. Ok - cleaning my string like this: $clean_string = preg_replace(/[\n\r]/, ,trim($dirty_string)); ..
Ello, I would like to make maintenance mode for my website, because i daily
Ello Chaps and Chapesses! I have a Javascript array like this: var tinkerArray =
Ello, I'm using jQuery-Validation-Engine and i don't know if this is currently possible but,
Ello! I have an app bar icon and on the click event - I

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.