forums

TNT Basic Forums > Programming Q&A
Hardware sprite rotation
< Last Thread     Next Thread >
Author
Thread        Post A Reply

09-16-2002 09:26

Posted by:
Scoops

Find more posts by Scoops

I seem to be having trouble getting this to work. Could someone put up a quick bit of code to illustrate the best way to get it working. Also can you use floating point variables as the rotation angle or is the rotation angle only the difference from the last rotation made as opposed saying 180 is pointing south, 0 is pointing north and so on. Hope you can help, cheers!!

09-17-2002 02:10

Posted by:
Holmes

Click Here to Email Holmes   Find more posts by Holmes

Here's some code:

graphics mode hardware 640,480

Load images 128

int rotatefactor

while not mouse button
rotatefactor=rotatefactor+1
set sprite rotation 0,rotatefactor
sprite 0,200,200,0
draw frame
wend

You can use either float or int for the rotation, the rotation is always this number and not the difference between it and the last rotation. So yeah, 180 will be south, 0 north.

Happy coding!

09-18-2002 23:35

Posted by:
Scoops

Find more posts by Scoops

Thanks for that. I had put the sprite bank as 128 initially instead of 0, changing it fixed the problem. Incidentally, do you find hardware mode offers you better speed? My rotation doesn't seem as smooth as when I had individual sprites for each part of the rotation.

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.