Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
General
»
General discussions
»
SFML Scaling
Print
Pages:
1
[
2
]
Author
Topic: SFML Scaling (Read 15405 times)
0 Members and 1 Guest are viewing this topic.
Voroz
Full Member
Posts: 128
SFML Scaling
«
Reply #15 on:
December 10, 2009, 04:46:17 pm »
i know this, but it's easier said than done ^^. Atm i am converting the floats to ints before i draw it, but it still shakes for a little while before it stops most of the time.
Logged
panithadrum
Sr. Member
Posts: 304
SFML Scaling
«
Reply #16 on:
December 10, 2009, 06:18:01 pm »
No, it's easier done than said lol
Just do something like this:
x - your current position
xto - the position you actually go to
sp - speed of movement
if(x > xto+sp) x -= sp;
else if(x < xto-sp) x += sp;
else x = xto;
Logged
Print
Pages:
1
[
2
]
SFML community forums
»
General
»
General discussions
»
SFML Scaling