Pathfinding
I''m designing a game right now that I hope to make in the future(when I finally understand pointers). The game is 2d, with a 9 by 7 grid as the playing area. The basic objective is to manuver spheres, that fall to the bottom of the grid, in order to create "paths" between them. Every sphere has four sides (Up, Down, Left, Right), and each of these sides can be Red, Green, Or Blue. One path is created when one side of a sphere touches around sphere''s side with the same color (ie. one sphere with a blue left side lands to the right of a sphere with a blue right side). When you get a certain amount of interconnecting paths, all the spheres in that path will be destroyed, and any sphere on top of them will fall, and if they create a long enough path they''ll be destroyed, etc.
Currently, I''m playing with the A* algorhythm, but instead of finding the path from one point to another, I''m trying to find the actual number of paths. Am I heading in the right direction? Is there a more efficient way to logically check for these paths?
''''You shall be as Gods!'''' Xenogears
''''You handle the salads until you get killed!'''' Space Ghost C2C
''You shall be as Gods!'' Xenogears''You handle the salads until you get killed!'' Space Ghost C2C
A* is more for directed searches... you probably want something simpler like depth-first search, where instead of terminating when you find the goal, you increment a counter.
[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost ]
[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost ]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement