forums

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

02-26-2006 21:20

Posted by:
Jacob

Location:
San Francisco, CA

Click Here to Email Jacob   Find more posts by Jacob

As Danny said in another thread the sprite will not be created untill you call draw frame, this is not good.

02-26-2006 23:23

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

Not quite what I said...

I said that your sprite 'co-ordinates were not updated' until you call draw frame.

I've not looked at this part of the source for a while, but as I recall the sprite object is created when you define the sprite, it's not linked to the display context however until you attempt to render it (which is why your previous code failed), and it's the display context that checks for the hits (though I will probably be corrected on this!).

This kind of makes sense, as you can't collide with a sprite that's not been drawn yet. If you want to check collisions with 'invisible' sprites then it's far quicker to simply check co-ordinate pairings.

Danny (nods)

02-27-2006 01:36

Posted by:
Jacob

Location:
San Francisco, CA

Click Here to Email Jacob   Find more posts by Jacob

You might already know this...

I can move sprites after they are created (and at least 1 draw frame was called) and the collisions work fine.

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.