-
[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.
http://www.haydenaud.com/sean/tactics.swf
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!
-
Senior Member
You need to build walkable area by going out of char position and adding walkable tiles to the path.
See for example this thread:
http://board.flashkit.com/board/showthread.php?t=746514
-
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|