Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: [GM] Motion planing grid issues  (Read 971 times)

0 Members and 1 Guest are viewing this topic.

Jed

[GM] Motion planing grid issues
« on: December 07, 2006, 05:10:55 pm »
Okay basically, I want to use a gird system to navigate around the room. I've got it set up, it detects solid fine(tested with mp_grid_draw();). Now my question is, how do I get obj_player to move from its current positon to movetox,movetoy at a variable speed? mp_grid_path(id,path,xstart,ystart,xgoal,ygoal,allowdiag) doesn't exactly tell me much in the way of how to do it and my fiddling around has turned up naught. Appart from this, its all fine as far as I can tell.
Logged

mit

Re: [GM] Motion planing grid issues
« Reply #1 on: December 07, 2006, 06:59:20 pm »
  • QBASIC programmer since age 4. Take that, world.
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 1079
If you've set everything up properly, then it shoud all work.

mp_grid_path(
id is the variable holding the id you got when you set up mp_grid_create().
path is the id of the path to output it into. If you don't want to replace any, add a new one before with path_add().
xstart,ystart,xgoal,ygoal are self explanatory.
allowdiag indicates whether to allow diagonal movement.
)

Make sure it returned true - otherwise no path was calculated.

To follow the path, just use normal path-controlling functions.
I can't help you any more than that.
Logged
Programmer / Spriter / Level designer / Game Director / Web Designer / Music Sequencer for
Random Highscore table:

Play the Kousou Arcade today!
  • Kousou Games
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.017 seconds with 38 queries.

anything