Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / Problem with SPRITE EXIST()

Author
Message
Dmitri
20
Years of Service
User Offline
Joined: 27th Nov 2003
Location:
Posted: 30th Nov 2003 17:18
I have a slight problem with the SPRITE EXIST command, here's the code that I've got:

FOR i = 1 TO 10
IF SPRITE EXIST(i) = 1 THEN DELETE SPRITE i
NEXT i

It keeps coming back with a "Bob does not exist" error from the DELETE SPRITE, but really it shouldn't be looking at that command unless the sprite DOES exist, right?

If anyone could help, I would be most appreciative. Thank you.

It's a long story and there's no punchline...
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 30th Nov 2003 18:07
I remember this problem with DBC myself.

You will need to keep track of which sprites exist yourself in an array.
Dmitri
20
Years of Service
User Offline
Joined: 27th Nov 2003
Location:
Posted: 1st Dec 2003 01:21
Alright, no problem, thanks.

It's a long story and there's no punchline...

Login to post a reply

Server time is: 2024-05-08 14:43:28
Your offset time is: 2024-05-08 14:43:28