forums

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

05-03-2004 22:57

Posted by:
puffin

Click Here to Email puffin   Find more posts by puffin

so, if i'm in hardware mode can i toss around more sprites without that unpleasant slow downs since it draws the whole screen all the time?

05-05-2004 16:57

Posted by:
charlie

Location:
norfolk, england

Click Here to Email charlie   Find more posts by charlie

well, yes.
sort of.

you can have lots of sprites doing stuff, so long as theyre all controlled by the same loop.

heres some code.

for r=0 to 359
if tex1[r]=true



trot1[r]=calculate angle(tx1[r],ty1[r] to 320,240)
trad1[r]=trad1[r]+20
tx1[r]=trad1[r]*cos(tang1[r])+320
ty1[r]=trad1[r]*sin(tang1[r])+240
tx12[r]=trad1[r]*cos(tang12[r])+320
ty12[r]=trad1[r]*sin(tang12[r])+240
tx13[r]=trad1[r]*cos(tang13[r])+320
ty13[r]=trad1[r]*sin(tang13[r])+240
tx14[r]=trad1[r]*cos(tang14[r])+320
ty14[r]=trad1[r]*sin(tang14[r])+240

tsize1[r]=tsize1[r]+0.1

set sprite rotation r+150,trot1[r]+90
set sprite x scale r+150,tsize1[r]
set sprite y scale r+150,tsize1[r]
set sprite rotation r+500,trot1[r]+90
set sprite x scale r+500,tsize1[r]
set sprite y scale r+500,tsize1[r]
set sprite rotation r+1000,trot1[r]
set sprite x scale r+1000,tsize1[r]
set sprite y scale r+1000,tsize1[r]
set sprite rotation r+1500,trot1[r]
set sprite x scale r+1500,tsize1[r]
set sprite y scale r+1500,tsize1[r]


sprite r+150,tx1[r],ty1[r],14
sprite r+500,tx12[r],ty12[r],14
sprite r+1500,tx13[r],ty13[r],14
sprite r+1000,tx14[r],ty14[r],14



if tx1[r]>690 or tx1[r]<-50 or ty1[r]>510 or ty1[r]<-50 or tx12[r]>690 or tx12[r]<-50 or ty12[r]>510 or ty12[r]<-50 or tx13[r]>690 or tx13[r]<-50 or ty13[r]>510 or ty13[r]<-50 or tx14[r]>690 or tx14[r]<-50 or ty14[r]>510 or ty14[r]<-50
sprite off r+150
sprite off r+500
sprite off r+1000
sprite off r+1500
trad1[r]=0
tex1[r]=false
tsize1[r]=0.1
end if

end if
next

by adding the extra 3 SPRITE commands, thereby trippling the ammount of sprites on screen, i lost only 1fps.

try it and find out, this maynot work for what you have in mind though....

good luck


cheers
charlie



07-18-2004 22:59

Posted by:
Mark Tully

Location:
TNT HQ, England

Click Here to Email Mark Tully   Find more posts by Mark Tully

Hardware mode is slower a lot of the time, it really shouldn't be but it is. However, whereas software mode tends to slow down as you draw more sprites, hardware mode generally just keeps going at the same speed.

Mark

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.