how can i write a game like this...(using mouse)

it is a top-view game. The map include
blocks(be able to walk through/ not able) and characters.

i want the character whom is under control walks to anyplace i need, and he avoids the blocks that unable to walk through, reachs the goal.

Have you played games such as Command&Conquer, StarCraft or Commandos?
you just point dest with mouse then he runs and avoids the things.

thank you
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

yairyConnect With a Mentor Commented:

if there are no blocks between
the enter and exit point:

I would calculate each step the Length
from the immidiate neighbour points to me to the exit point.
I would choose the shortest length each time.

If there might be block, it isn't as simple:
one should can use Backtracking
to find the path.

heres a recurse "rough" definition:

f(location, matrix)
  if you are at the enter pos and have
  nowhere to go - quit, failer.
  if you are in the Exit point -
  quit, Success.
  if you don't have any place to go
  (all is block (except the from where
  you came)) mark the place as DeadEnd.
  <do nothing, the recurse will pop you
  to the prev. position>
  call f(Location, matrix) for all
  free places that aren't blocked or a dead end.

Any questions ....


RkMkAuthor Commented:
Edited text of question.
As I said... If you want an example... I'll send it to yer Email!
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Hypo: if you have such written in good old Pascal/asm i would really like to check it out.. i know how to write games like that and 3d but thats under win32.. not seen much Pascal last years and would be nice to see some graphix coding in dos again..
RkMkAuthor Commented:
dear Hypo,
this is my email addr:
wow, crap
why are you talking so mysterious about pathfinding???
you need pathfinding, aren't you???
RkMkAuthor Commented:
yes yes i need pathfinding
i am sure you can help me ,jack, right?
RkMkAuthor Commented:
thank you. ill try.
All Courses

From novice to tech pro — start learning today.