开发者

actionscript 3, flash game ai, path OR automatic movement

开发者 https://www.devze.com 2023-03-28 15:14 出处:网络
I am creating a flash game and I\'ve hit a problem I have four objects, lets call them img1 through img4

I am creating a flash game and I've hit a problem

I have four objects, lets call them img1 through img4

I need them to move around a maze, witch is made up of blocks (maze.wall.block1 to block53)

I have seen tutorials on creating a path however these all involve the object to be added to the stage, where as I am doing it in a as3 class.

So my question is either: How can I create a path manualy on the stage, then create an object to follow the path in the as3 class, OR how can I add very simple ai to the img object to move around but change direction when the hitTestObject开发者_JS百科 triggers on the maze.wall.blocks?

Thanks


Why don't you create your own pathfinding implementation since your game seems tile based? Trust me - it's pretty easy and rewarding!

This is the best article I have seen on pathfinding - it's easy to understand:

Link

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号