forums

TNT Basic Forums > Programming Q&A
How to see if a sprite is still on screen
< Last Thread     Next Thread >
Author
Thread        Post A Reply

07-30-2003 18:53

Posted by:
mark_667

Location:
England

Click Here to Email mark_667   Find more posts by mark_667

Hi,
Is there anyway of checking to see if a sprite is not being displayed? This could come in useful if you want to draw more enemies on the screen after some others have been killed. However, code such as:

if sprite off 1
'Do something here
end if

generates an error. I thought of trying to check the pixel co-ordinates of it to see if it was off the viewable area of the screen, but it could still be on another part of the map. Also, if it had x and y co-ords assigned, it would have to be on-screen anyway. So is there any way of telling if a sprite is on a map, or a map section?

thanks,
Mark_667

PS. Like the new forums changes. :-)

07-31-2003 14:17

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

if sprite image(id)<0
' the sprite isn't displayed ( it has no image )
end if

07-31-2003 17:56

Posted by:
eekaydee

Location:
CA, USA

Click Here to Email eekaydee   Find more posts by eekaydee

Whoa, does that work? I had to make a lot of workarounds because I didn't know if a sprite was on and if I could turn it off.

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.