The Daily Click ::. Forums ::. Non-Klik Coding Help ::. Delaying values?
 

Post Reply  Post Oekaki 
 

Posted By Message

Dr. James MD

Addict

Registered
  08/12/2003
Points
  11941

First GOTW AwardSecond GOTW AwardThird GOTW AwardPicture Me This -Round 26- Winner!
5th September, 2007 at 07:38:06 -

Wozzup crew.

How would you go around delaying a value? I've got one object and I need another object to follow it after about a second or so. Just can't wrap my head around this one.

 
Image
http://uk.youtube.com/watch?v=j--8iXVv2_U
On the sixth day God created Manchester
"You gotta get that sand out your vaj!" x13
www.bossbaddie.com

DaVince

This fool just HAD to have a custom rating

Registered
  04/09/2004
Points
  7998

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
5th September, 2007 at 09:06:32 -

A way to do it:

Have a 1 dimensional array with 50 spaces (or more if he needs to wait more than 50 frames = 1 second).
Once you start walking, the other dude isn't close enough to you anymore and you start putting your current position in the 50th element, and push the previous value in that element one back.
Once there's a value in element 0 (or 1?) in the array, start positioining the other dude at that position.

You might want to store strings in the array so you can save both X and Y every frame, not just one value.

 
Old member (~2004-2007).

Tim

I'm on here way too much

Registered
  25/08/2006
Points
  132

You've Been Circy'd!Clickzine StaffSilverNova MemberVIP MemberTurtle Power!Evil klikerWii OwnerHero of TimeGhostbuster!Pokemon Ball!
5th September, 2007 at 10:45:39 -

"Every 1 second:"

Yeah I know.. not the best way. Is it to make one guy follow the other? Just outta curiosity

 
http://www.SilverNova.co.uk


DaVince

This fool just HAD to have a custom rating

Registered
  04/09/2004
Points
  7998

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
5th September, 2007 at 10:49:26 -

"Every 1 second" would result in him moving one pixel every second or so, unless you make a "walk to coordinates" system.

 
Old member (~2004-2007).

Dr. James MD

Addict

Registered
  08/12/2003
Points
  11941

First GOTW AwardSecond GOTW AwardThird GOTW AwardPicture Me This -Round 26- Winner!
5th September, 2007 at 13:18:36 -

I tried something like that DaVince, but ended up rushing into town so it wasn't complete. Might see if it can be done that way after all.

 
Image
http://uk.youtube.com/watch?v=j--8iXVv2_U
On the sixth day God created Manchester
"You gotta get that sand out your vaj!" x13
www.bossbaddie.com

Tim

I'm on here way too much

Registered
  25/08/2006
Points
  132

You've Been Circy'd!Clickzine StaffSilverNova MemberVIP MemberTurtle Power!Evil klikerWii OwnerHero of TimeGhostbuster!Pokemon Ball!
5th September, 2007 at 18:45:06 -

Pretty darn good. LOL @ sprite

 
http://www.SilverNova.co.uk

   

Post Reply



 



Advertisement

Worth A Click