Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / rotate sprite

Author
Message
Lost Kid
20
Years of Service
User Offline
Joined: 16th Feb 2005
Location: Usa
Posted: 10th May 2005 12:45 Edited at: 10th May 2005 12:45
When i use rotate sprite in my code the sprite rotates around but also jumps upward like, was'nt quite sure how to make my sprites move left so i've been fiddeling around w/ this and just cant get it right can anyone help?.



Attachments

Login to view attachments
UnderLord
21
Years of Service
User Offline
Joined: 2nd Aug 2003
Location:
Posted: 10th May 2005 13:16
Else
Rotate Sprite 1,0
i think if you get rid of that it might work

but im not sure check out my tutorial which has the rotate command in it search for "another tutorial"

When we talk to god, we're praying. When god talks to us, we're schizophrenic.
Schizophrenic beats eating alone.
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 10th May 2005 22:47
You don't use rotate sprite to move left and right. Easier to keep track of sprite position with variables.



Boo!
pizzaman
21
Years of Service
User Offline
Joined: 18th Feb 2004
Location: Gateshead, UK
Posted: 10th May 2005 22:50
The reason the sprite jumps is because the point at which the sprite rotates is the top-left corner, not the center of the sprite. You can use the offset sprite command to specify where the sprite will rotate from.

I'm not too sure the way you want your sprite to move, but I modified your example code a little to how I think you want it to move.



spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 10th May 2005 22:51
Or if you want to control sprite like a car, you do use rotate sprite:



Boo!
Lost Kid
20
Years of Service
User Offline
Joined: 16th Feb 2005
Location: Usa
Posted: 11th May 2005 02:14
@pizzaman

Thats exactly the way I needed it thank you so much!

@spooky's 2nd post

Thats almost the same as pizzaman's code, but thanks for showing me your code, cause I or someone else could use it for making a little fun 2d game.

Thanks Everyone!,
LK

Login to post a reply

Server time is: 2025-05-17 16:12:10
Your offset time is: 2025-05-17 16:12:10