The Daily Click ::. Forums ::. Klik Coding Help ::. Path movement control
 

Post Reply  Post Oekaki 
 

Posted By Message

Dave S.



Registered
  26/09/2003
Points
  924
29th November, 2007 at 10:59:02 -

How do I get an active object to follow a line or path without using the built in path movement. The speed can remain constant but I would need reverse. The line it runs on would only have 90 degree angles when changing direction.

 
n/a

Joe.H

Evil Faker

Registered
  19/08/2002
Points
  3305
29th November, 2007 at 11:06:44 -

http://www.create-games.com/download.asp?id=6921

 
My signature is never too big!!!

nim



Registered
  17/05/2002
Points
  7232
29th November, 2007 at 13:52:11 -

At the simplest level, you could create invisible blocks which would change the direction of the object following the path. For example:

Create "dirChangeBlock" at (40,30)
+ Set direction to 8 [or 0,16 or 24]

"Object" collides with "dirChangeBlock"
>> Set direction of "Object" to current direction of "dirChangeBlock"

Do you need this to work for a constantly changing, dynamic path around other obstacles? In that case, check out the link Joe posted. Could you give us some more context?

 
//

Dave S.



Registered
  26/09/2003
Points
  924
29th November, 2007 at 15:49:32 -

Nim... I looked at Code Monkeys link but couldn't get it to load as it had an extension MMF didn't recognize.

If you think of a fuse which burns at a constant rate or better still a ghost train that follows a track. I would need limited control over it though... maybe stop or reverse.

 
n/a

nim



Registered
  17/05/2002
Points
  7232
29th November, 2007 at 17:22:57 -

Well, I think this may be what you're looking for. Below are two screenshots from a game I was working on back in Easter. Basically the bunny follows the path through the garden and the player rotates easter eggs around it to avoid them colliding with water/trees/etc. Excuse the cheesy theme - it was for an Easter competition!

Image
Normal game

Image
Game with hidden blocks shown - start, finish and direction changes.

Sorry it's not a step-by-step solution but I hope this helps. Half the fun of making games is working things out by yourself, anyway (IMO)

Edit: The bunny game sucked, by the way.

Image Edited by the Author.

 
//

Dave S.



Registered
  26/09/2003
Points
  924
30th November, 2007 at 04:01:55 -

... hey that's neat... did you ever finish the game? I was thinking along the same lines... if active object is traveling North and is equal to the x,y coordinates of 'direction block1'... then change direction of active object to west (or whatever)... thanks for your assistance.

 
n/a

nim



Registered
  17/05/2002
Points
  7232
1st December, 2007 at 12:53:24 -

I didn't finish the game, it was basically a failed prototype.. but I got pretty far before realising that it just didn't work as a game idea. I'd still like to use the level editor for something else. Good luck with your own game!

 
//

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
1st December, 2007 at 14:00:51 -

Hey that's a great idea Nim!

It's a pain to use the path movement sometimes but your way you could make enemies do all kinds of cool things.

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!
   

Post Reply



 



Advertisement

Worth A Click