Ask coding questions

← Back to all posts
[KABOOM] How do you modify a sprite's rotation?
MrVoo

I'm trying to get a sprite named person, and I'm trying to change its rotation. Using person.pos.x to change position worked, why doesn't person.rotate work?

Answered by SixBeeps [earned 5 cycles]
View Answer
Voters
MrVoo
Comments
hotnewtop
SixBeeps

Maybe it's rot.

Either way, take a look at rotate(). That's a good place to start.

MrVoo

@SixBeeps I used rotate() as you said to start it at 0 degrees, and I can change that with no problem, but I want to rotate it after that. These are the things I've tried:

SixBeeps

@MrVoo Just peeked at the source code. Try person.angle = number.

MrVoo

@SixBeeps Yay it worked, thanks