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
RkMkAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
yairyConnect With a Mentor Commented:
Hi,

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.
  else
  if you are in the Exit point -
  quit, Success.
  else
  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>
  else
  call f(Location, matrix) for all
  free places that aren't blocked or a dead end.
}


Any questions ....

Yair

0
 
RkMkAuthor Commented:
Edited text of question.
0
 
HypoCommented:
As I said... If you want an example... I'll send it to yer Email!
0
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.

 
brainwareCommented:
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..

brainware@cyberjunkie.dk
0
 
RkMkAuthor Commented:
dear Hypo,
this is my email addr:
rkmk@usa.net
0
 
jack_p50Commented:
wow, crap
why are you talking so mysterious about pathfinding???
you need pathfinding, aren't you???
0
 
RkMkAuthor Commented:
yes yes i need pathfinding
i am sure you can help me ,jack, right?
0
 
RkMkAuthor Commented:
thank you. ill try.
0
All Courses

From novice to tech pro — start learning today.