Page 1 of 1

Help with a little problem

Posted: Thu Apr 21, 2005 4:58 pm
by SoulReaper
Hello :)

what i am trying to do is to get a sprite to follow a pattern i have a data for direction e.g.

pattern data is direction on calculator pad...

pattern_data:
data 06,09,03,00

delay_data
data 40,30,50,00

my problem starts when i want to increase the speed of the sprite,
the delay needs to be adjusted with the speed increase.

maybe there is some fancey calculation for this
here is a table i think i have the value correct
:)

Speed 05 06 07 7.5 08 09 10 15 20

Delay 40 37 33 30 26 23 20 15 10

/1.1 /1.2 /1.3 /1.5 /1.7 /2 /2.6 /4.0

I hope this makes sense - maybe some kind person out there could find it in their heart to help :)
Kevin :cry:

Posted: Thu Apr 21, 2005 6:01 pm
by GedB
Kevin,

Rather than trying to adjust you're data, give each sprite its own 'pulse.'

For example, it may have a pulse of moving 4 times every second, or every 250 milliseconds.

The delays would be in relation to these pulses.

Then all you have to do to change the sprites speed it to change it's pulse. Only one value needs updating.

Posted: Thu Apr 21, 2005 6:34 pm
by SoulReaper
Thankyou for the information on pulses never knew about that,
i will try to do that thankyou :)