The Daily Click ::. Forums ::. Klik Coding Help ::. Baddies
 

Post Reply  Post Oekaki 
 

Posted By Message

siegeon



Registered
  28/03/2008
Points
  18
2nd April, 2008 at 00:14:17 -

Evening all,

So I have been working on the "baddies" movement system. It is a basic chase system, however it moves through everything with no problems. I could use some help making it move around my backdrops.

For the chase system I use the Advance Direction Object.

I have tryed to flag the movements based on collisions but it just makes the baddie go all stupid like. So maby my code is flawed, but I need to get the movement to react to distance/and objects. If it helps I will post the code I currently have. I dont need anything fancy, this will be mostly drone movements.

Thanks







 
n/a

DeadmanDines

Best Article Writer

Registered
  27/04/2006
Points
  4758
2nd April, 2008 at 18:46:32 -

This only works for one object, but it may help you:

http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=66421#Post66421


Other Methods:
----------

A method which may also work would be to make bad guys chase the player, and have a small 'line of sight' detector, constantly firing between enemy and player.

If suddenly it loses sight of the player, it draws a line between the player and plots a midpoint where the wall colision happened. That midpoint moves away (left or right), creating a bézier curve. Detectors are placed along the curve and check if they no longer overlap an obstacle.

If not, then the bad guy will follow the curve, thereby walking around the obstacle.

---

You could do similar, but not use a bézier curve, just straight lines. Add a mid-point and move it outwards to test left adn right.

---

You could create a 'node' object which gets left behind the player. It always checks the distance between the player and the newest node, and if that distance is greater than a certain amount, a new node is generated.

Nodes older than a certain amount are destroyed.

When the badguy loses sight of the player, he borrows a big detector quickly which will check for nodes that are nearby. Starting with the newest, he tests to see if obstacles are between him and it. When he finds a clear line of sight, he runs to that node and just follows them down until he sees the player again.

(ps. please excuse the bad typing, I'm not wearing my glasses, LOL)

 
191 / 9999 * 7 + 191 * 7

siegeon



Registered
  28/03/2008
Points
  18
2nd April, 2008 at 23:26:35 -

Strange the link

http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=66421#Post66421

says access denied.

Oh never mind. I just got it to work the way I needed it to! Thank you for the help!

Image Edited by the Author.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click