forums

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

08-13-2003 02:04

Posted by:
Stephen Lund

Location:
Michigan USA

Click Here to Email Stephen Lund   Find more posts by Stephen Lund

Hi

I'm tring to make a sprite rotate and i trid every thig and nothing works, any suggestions

Stephen

08-13-2003 10:34

Posted by:
JAS

Click Here to Email JAS   Find more posts by JAS

I haven't played with this yet, but just make sure that your graphics mode is on hardware - it only works in hardware mode.

Hope that helps!

08-13-2003 11:57

Posted by:
Martin

Click Here to Email Martin   Find more posts by Martin

Animate the sprite: draw it in say 4 positions and use the code to run through them.
Martin

08-13-2003 15:34

Posted by:
Stephen Lund

Location:
Michigan USA

Click Here to Email Stephen Lund   Find more posts by Stephen Lund

I was not using hardware mode and i switch it to it and it still does it work this is my code

graphics mode hardware 1024,768
load images 128

set sprite rotation 0,70
sprite 128,500,500,0
draw frame
while true
wend

Stphen

08-14-2003 11:22

Posted by:
mark_667

Location:
England

Click Here to Email mark_667   Find more posts by mark_667

I can see at least one thing wrong with your code here, mainly this loop:

quote:

graphics mode hardware 1024,768
load images 128

set sprite rotation 0,70
sprite 128,500,500,0
draw frame
while true
wend



there is nothing between the start and end of the while and wend to indicate that it should be taking place, presumably you mean while the code is executing. It should look something like this:

graphics mode hardware 1024,768
load images 128

while true
set sprite rotation 0,70
sprite 128,500,500,0
draw frame
wend

Also, the condition you used has not been declared anywhere shouldn't it be something like:

graphics mode hardware 1024,768
load images 128
int something=true

while something=true
'Do something here
set sprite rotation 0,70
sprite 128,500,500,0
draw frame
wend

I stand to be corrected, of course, but I hope this helps.
Mark_667

08-14-2003 23:38

Posted by:
Stephen Lund

Location:
Michigan USA

Click Here to Email Stephen Lund   Find more posts by Stephen Lund

I tried that and it did not work):
do you have any more suggestions

Stephen

08-15-2003 14:40

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

That should work. Do you have an image 0 in bank 128?

08-15-2003 17:18

Posted by:
Stephen Lund

Location:
Michigan USA

Click Here to Email Stephen Lund   Find more posts by Stephen Lund

yes i do

08-16-2003 11:54

Posted by:
mark_667

Location:
England

Click Here to Email mark_667   Find more posts by mark_667

Do your sprites appear normally, or is the trouble only when you try the sprite rotation? If so, it may be down to a bug, as far as I can see you're doing everything right.

08-16-2003 14:46

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

Whats your computer? Older computers ( OS 8.6 ) can experience real trouble with hardware mode.

08-17-2003 02:17

Posted by:
eekaydee

Location:
CA, USA

Click Here to Email eekaydee   Find more posts by eekaydee

quote:
graphics mode hardware 1024,768
load images 128

while true
set sprite rotation 0,70
sprite 128,500,500,0
draw frame
wend



You are setting sprite 0's rotation but there is no sprite 0.
You are setting the sprite's angle to 70 degrees every time. It seems to me like you would like to make it continue to rotate every frame. If so then try this:

quote:

graphics mode hardware 1024,768
load images 128
int angle=70
while true
angle=angle+10
set sprite rotation 128,angle
sprite 128,500,500,0
draw frame
wend



08-17-2003 21:22

Posted by:
Stephen Lund

Location:
Michigan USA

Click Here to Email Stephen Lund   Find more posts by Stephen Lund

Thanks

Thanks for all the help you gave me. I finally found the problem out, I changed the 128 to 0 and it worked.

Thanks,
Stephen

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.