# PH Force help

### » Sat Nov 19, 2011 11:39 am

Hi all,

Situation.

When I hold 'D' down
-X=Sprite.X +3
-Y=Sprite.Y +3
-Force=1000

Is there a way to make the sprite speed(Force) stay the same without increaseing

.'.
Make the speed stay stable form Staring of hold to the ending of hold of the 'D' key
B
7
S
2
G
1
Posts: 193
Reputation: 1,745

### » Sat Nov 19, 2011 11:44 am

Use force*timedelta and you'll get a steady supply of force, instead of tick dependant, possibly unstable one.

Also use timedelta for the +3 and such.
B
19
S
6
G
7
Posts: 1,101
Reputation: 6,146

### » Sat Nov 19, 2011 11:47 am

I never knew what does time delta does

BTW tnx for help

Stalker2472011-11-19 11:47:24
B
7
S
2
G
1
Posts: 193
Reputation: 1,745

### » Sat Nov 19, 2011 11:52 am

When I hold 'D' down
-X=Sprite.X +3
-Y=Sprite.Y +3
-Force=1000 * Timedelta
///
When I hold 'D' down
-X=Sprite.X * Timedelta
-Y=Sprite.Y * Timedelta
-Force=1000 * Timedelta

Does not work, what do you ment about the timedelta?
B
7
S
2
G
1
Posts: 193
Reputation: 1,745

### » Sat Nov 19, 2011 12:08 pm

Ah, you mean stable movement of the object when the key is held. Well, you are using ADD force so the force keeps on stacking up, becoming stronger and stronger. Use SET force and it'll have the same speed (the one you set) and when the key is let go behave according to the physical properties of the object.
B
19
S
6
G
7
Posts: 1,101
Reputation: 6,146

### » Sat Nov 19, 2011 12:22 pm

lol, Dumb me

Thanks
B
7
S
2
G
1
Posts: 193
Reputation: 1,745