Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
Graphics
»
Can you make a sprite move the way it's rotated?
Print
Pages: [
1
]
Author
Topic: Can you make a sprite move the way it's rotated? (Read 1386 times)
0 Members and 2 Guests are viewing this topic.
Bonediggerninja
Newbie
Posts: 10
Can you make a sprite move the way it's rotated?
«
on:
February 08, 2017, 07:13:33 am »
Can you make a sprite move the way it's rotated?
For example
sprite.
setRotation
(
60
)
;
sprite.
move
(
60
)
;
//but in the way it's rotated;
Thanks in advance?
Logged
Laurent
Administrator
Hero Member
Posts: 32498
Re: Can you make a sprite move the way it's rotated?
«
Reply #1 on:
February 08, 2017, 07:44:19 am »
sprite.
move
(
std
::
cos
(
angle
)
*
distance, std
::
sin
(
angle
)
*
distance
)
;
Logged
Laurent Gomila - SFML developer
Print
Pages: [
1
]
SFML community forums
»
Help
»
Graphics
»
Can you make a sprite move the way it's rotated?