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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:05:09+00:00 2026-05-23T07:05:09+00:00

I want a simple algorithm in As3 that finds the shortest path in a

  • 0

I want a simple algorithm in As3 that finds the shortest path in a simple grid, i need complete path not the only both points or the length.

check image here: http://screencast.com/t/GmR5YaO4L

so i need all the square numbers of the grid that comes in the path from A to B.

  • 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-05-23T07:05:09+00:00Added an answer on May 23, 2026 at 7:05 am

    Although A* is kind of overkill when there are no obstacles, you might as well use it since I wrote a library for it in AS3: http://www.newarteest.com/flash/astar.html


    EDIT: If you are anything less than 100% sure the pathfinding will never have obstacles then I still recommend A* because that gives you the most flexibility, but in your specific case it’s pretty easy to find the path without obstacles because you only move once horizontally then vertically (or the other way around) as opposed to diagonally.

    First subtract the x and y components of the positions to determine which way is longer and start moving in that direction. Then when the objects are in the same position on that axis, switch to moving in the other direction.

    Depending on your needs you can easily build a loop or recursive function that finds the entire path before you traverse it, but it may be simpler to move the object in the correct direction without knowing the entire path ahead of time. While finding the path you need to loop through all the nodes anyway, so you could avoid having to loop through the nodes twice.

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

Sidebar

Related Questions

As a self-development exercise, I want to develop a simple classification algorithm that, given
I want a simple function that receives a string and returns an array of
Say you want a simple maze on an N by M grid, with one
I just want a simple tool that will help me quickly write scripts/packages that
I just want a simple SVG image that has some arbitrary text on an
I only want a simple Splash Screen Example. Get the Code, Insert my picture,
I have simple map-reduce type algorithm, which I want to implement in python and
I want to provide my application with simple licensing mechanism based on RSA algorithm.
For a random event generator I'm writing I need a simple algorithm to generate
I've developed an equation parser using a simple stack algorithm that will handle binary

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.