A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [MX] Limiting accessable areas in tile-based system

  1. #1
    Join Date
    Aug 2006

    [MX] Limiting accessable areas in tile-based system

    Hey everyone. I've been beating myself up over this for a bit now, and the internet isn't being very helpful so far... I've reached a difficult point in my tile-based turn-based strategery game. It's essentially a bad-graphics 2D mock-up of Final Fantasy Tactics... been playing FFTA2 so much I can't resist the urge to try to make something better.

    Anyway, my predicament is that I have no idea how to accurately detect unreachable areas. Each turn a character can move a set number of squares, so you click on your guy and then you click on where you want to go. Through a convoluted mess of code, I managed to place highlights on all the squares within range-- 3 squares in this case-- but I haven't the slightest as to how to detect unreachable areas. Disabling the obstacles themselves is fine and easy, but if a multitude of obstacles block off an area, how do I detect this without tangling up my code even further?

    Here's an example of what I've got so far. Click on the man to see his movement range. I haven't finished blocking off all the obstacles yet; I thought I'd better figure this out first.

    If any more details or any .fla's are needed, just let me know and I'll happily provide them. If anyone can could give me a tip, solution, or a link to a helpful tutorial of some sort, I'd be much obliged. Thanks!

  2. #2
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    You need to build walkable area by going out of char position and adding walkable tiles to the path.

    See for example this thread:

  3. #3
    Join Date
    Aug 2006
    Thank you very very much! That totally solved my problem. These are the most useful flash forums I know, thanks to people like you and alillm.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width

HTML5 Development Center