forums

TNT Basic Forums > Programming Q&A
sprite col vs draw frame
< Last Thread     Next Thread >
Author
Thread        Post A Reply

01-02-2004 00:23

Posted by:
madscientist

Location:
n.ireland

Click Here to Email madscientist   Find more posts by madscientist

just a quick question about sprite col

if sprite col (A,B)<>-1 then move A 5 pixels left
if sprite col (A,B)<>-1
move A 5 pixels to the right
move A 5 pixels up
end if

moving a over to the left and then checking if there is still a collision, will it need to draw frame before sprite col can detect that it is not collided?

hope this makes even the slightest amount of sense...

01-02-2004 10:49

Posted by:
Martin

Click Here to Email Martin   Find more posts by Martin

You can test for a collision without "Draw Frame". I assume you if you can test one, you can test a second. But check it out.

Martin

01-03-2004 02:04

Posted by:
-wyvern

Location:
Bedroom

Find more posts by -wyvern

It may be worth noting that to collide sprites must exist for more than one whole frame, so if you use sprite off to completely clear out all sprites so you can renew them draw to draw and the collisions won't work, that's why.

Sorry, I don't know why I said that.

01-07-2004 21:32

Posted by:
puffin

Click Here to Email puffin   Find more posts by puffin

" It may be worth noting that to collide sprites must exist for more than one whole frame, so if you use sprite off to completely clear out all sprites so you can renew them draw to draw and the collisions won't work, that's why.

Sorry, I don't know why I said that."

what the hell are you talking about? i want to know.

anyway, things can collide without being drawn at all, if that even adresses your question. i'm still realing from -wyverns hyperconfusing post.

01-07-2004 22:26

Posted by:
Mark Tully

Location:
TNT HQ, England

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

I'll try and clarify what -wyvern was getting at.

For two sprites to collide they must both exist. That means you must have used a 'sprite' command to give them an x , y and image. It doesn't matter if draw frame has been drawn, that just draws all existing sprites and has nothing to do with collisions.

If you call 'sprite off', you delete the sprites. They no longer exist, and won't exist until you issue another 'sprite' command. So if you do a 'sprite off' and then do your 'sprite cols' you won't be able to collide with the sprite you turned off.

Hope that clarifies things a bit.

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.