PDA

View Full Version : Moving a character using a command


ishwarrior
12-12-2008, 05:18 PM
Currently on my page, I have:

- a circle with the instance name "player"
- a square with the instance name "box"
- an input textbox with the instance name "command"
- two rectangles forming a wall, each with the instance name "wall"

What I want to do is make the player move to the box when the words "go to box" are typed into the command textbox. I also need the player to walk along the shortest route, while also avoiding any obstacles (basically just the wall).

Could someone help me out?

pradvan
12-15-2008, 02:15 PM
You're trying to do too much right off the bat. Split your project in to smaller pieces.

Try to figure out the following pieces first and then combine them:

player movement
collision detection
text parsing


If you're going to try to do something very complex, you're most likely going to fail and give up. Start small.