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! / Rotating Sprites 360

Author
Message
ConorH
22
Years of Service
User Offline
Joined: 5th Feb 2003
Location:
Posted: 28th Jul 2005 00:43
Is it possible to make a sprite roatate through 360 degrees with just a single image?

its my new rat tail dog!
Mr Pointless
20
Years of Service
User Offline
Joined: 17th Oct 2004
Location: Stuck in the UK
Posted: 28th Jul 2005 04:34
Hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm..........

rotate sprite sprite number,angle

Oh s***, there goes the planet.
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 28th Jul 2005 04:36
Which is only in Darkbasic Pro.
ConorH
22
Years of Service
User Offline
Joined: 5th Feb 2003
Location:
Posted: 28th Jul 2005 06:10
Is there any way to rotate about its centre?

its my new rat tail dog!
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 28th Jul 2005 09:06
I haven't tried it myself but I assume if you use offset sprite first so that the sprite is offset to the center of the image. It should rotate around that center.
pizzaman
21
Years of Service
User Offline
Joined: 18th Feb 2004
Location: Gateshead, UK
Posted: 28th Jul 2005 10:27
Yeah Grog's right, you offset the sprite to its center to get it to rotate around its center.

Edizzle
20
Years of Service
User Offline
Joined: 22nd Aug 2004
Location:
Posted: 28th Jul 2005 15:41
and how would he do that

http://edizzle.100free.com
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 28th Jul 2005 16:34 Edited at: 29th Jul 2005 01:21
Use the image size to determine how far in on the x and y to go. This image (skull.bmp) is 155x219. The center is about 77x109. So after the sprite is created use "offset sprite 1,77,109". To see if the image center has been achieved rem off "hide mouse" (or move the mouse to the corners to see the image rotate around the center).

This code rotates the skull picture clockwise. To make it go counter clockwise change the "wrapvalue(p)" to "wrapvalue(-p)".

Hope this helps.

Attachments

Login to view attachments
UnderLord
21
Years of Service
User Offline
Joined: 2nd Aug 2003
Location:
Posted: 28th Jul 2005 23:28
You know i made a 2d movement tutorial for a reason......so questions like this could go answered

http://forum.thegamecreators.com/?m=forum_view&t=52156&b=4

The spaceship in this tutorial rotates 360 degree's using only 1 image and rotates from its center. Easy read the included text file for more insight (click the download button on the bottom right of the first post)

Trigonometry, Geometry, Physics OH MY!
ConorH
22
Years of Service
User Offline
Joined: 5th Feb 2003
Location:
Posted: 29th Jul 2005 01:18
Thanks Underlord! mwah

its my new rat tail dog!
UnderLord
21
Years of Service
User Offline
Joined: 2nd Aug 2003
Location:
Posted: 29th Jul 2005 15:17
i think i coulda done without the mwah.......

When we talk to god, we're praying. When god talks to us, we're schizophrenic.
Plasma Robo
19
Years of Service
User Offline
Joined: 13th Sep 2005
Location:
Posted: 14th Sep 2005 02:41
Hey, how do you rotate a background around the middle of a screen and have it scroll... I have tried everything! Nothing works well!

I have all the answers. Sigh.

Login to post a reply

Server time is: 2025-05-17 16:40:05
Your offset time is: 2025-05-17 16:40:05