GMLscripts.com

Discuss and collaborate on GML scripts
Invert

You are not logged in.

#1 2009-01-19 07:16:41

gmlsmurf
Member
Registered: 2009-01-19
Posts: 2

Tower Defence (maul)

Hi everybody,

I've got a schoolassignment where i need to make a 'Maul'.
I haven't got much experience with GML, and i was wondering how you can make a creep walk the fastest way to the "Castle". I got a script from http://gmlscripts.com/script/motion_towards,  and i understand the most of it, but when i make a maze where the creeps have tho go backwards a bit, the creep will go from the left to the right and from the right to the left, and so on.
Anyone has any ideas?
(plz don't say anything about my bad English, because i'm from Holland)

Offline

#2 2009-01-19 07:18:22

gmlsmurf
Member
Registered: 2009-01-19
Posts: 2

Re: Tower Defence (maul)

Whoops, I noticed the link has a comma on the end.

Offline

#3 2009-01-19 09:29:10

xDanielx
Member
Registered: 2009-01-02
Posts: 38

Re: Tower Defence (maul)

motion_towards and the now-built-in replacement mp_potential_step are sometimes okay for traversing an area with very small obstacles, but they're no good for navigating more complex environments. For that you should use a shortest-path algorithm like A*, which mp_grid_path implements.

Last edited by xDanielx (2009-01-19 09:29:35)

Offline

#4 2009-01-20 05:34:56

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: Tower Defence (maul)

Paul23 posted a pathfinding example here, unfortunately it was hosted of 64Digits. You might try contacting him here or at GMC:
http://www.gmlscripts.com/forums/viewtopic.php?id=39

You also might want to give this GMC tutorial a read:
http://gmc.yoyogames.com/index.php?showtopic=413985

And this GMC tutorial is about Tower Defense specifically:
http://gmc.yoyogames.com/index.php?showtopic=368985


Abusing forum power since 1986.

Offline

Board footer

Powered by FluxBB