Help with a little problem

Advanced game related topics
SoulReaper
Enthusiast
Enthusiast
Posts: 372
Joined: Sun Apr 03, 2005 2:14 am
Location: England

Help with a little problem

Post 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:
User avatar
GedB
Addict
Addict
Posts: 1313
Joined: Fri May 16, 2003 3:47 pm
Location: England
Contact:

Post 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.
SoulReaper
Enthusiast
Enthusiast
Posts: 372
Joined: Sun Apr 03, 2005 2:14 am
Location: England

Post by SoulReaper »

Thankyou for the information on pulses never knew about that,
i will try to do that thankyou :)
Post Reply