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.

Code Snippets / A function that will delete all open Objects, music, sounds, bitmaps, matrix etc...

Author
Message
Vues3d on Kalimee
20
Years of Service
User Offline
Joined: 12th May 2004
Location: NYON (SWITZERLAND)
Posted: 6th Jul 2004 18:47
Hi there...
While programming my game, I created a function that will delete all objects created or loaded. Useful for transitions that needs to erase ALL open stuffs to create new ones.



Hope it will be useful

Guido
http://www.vues3d.com
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 6th Jul 2004 19:29
Good for clean exiting too - if you run that function and undim your arrays you should be left with a much cleaner system when exiting your game.


Van-B


The nature of Monkey was irrepressible!.
Math89
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: UK
Posted: 6th Jul 2004 21:55
You can replace GOTO by EXIT
Vues3d on Kalimee
20
Years of Service
User Offline
Joined: 12th May 2004
Location: NYON (SWITZERLAND)
Posted: 6th Jul 2004 22:01
In this case not, using the exit function, the function will stop, but need the goto only when the 16 is reached.

Guido
http://www.vues3d.com
Peter H
20
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 7th Jul 2004 04:33 Edited at: 7th Jul 2004 04:34
what if you use id's past 1000? i use up to 6000 in my game (not becuase i have 6000 objects but becuase i want the different types seperate)


Formerly known as "DarkWing Duck"
Vues3d on Kalimee
20
Years of Service
User Offline
Joined: 12th May 2004
Location: NYON (SWITZERLAND)
Posted: 7th Jul 2004 17:09
Sure you can set more than 1000 ...
In my game I know I will not use ID's greather than 1000 if I will do, I guess I will adapt my Function!

Guido
http://www.vues3d.com
Axelman
21
Years of Service
User Offline
Joined: 18th Oct 2003
Location: Parallel Universe
Posted: 7th Jul 2004 19:09
why do you gosub at 16? also, you forgot sprites and bitmaps ID's are 0 to 31, except you can't delete bitmap 0.

CURRENT PROJECT: Enemy At The Gates
Vues3d on Kalimee
20
Years of Service
User Offline
Joined: 12th May 2004
Location: NYON (SWITZERLAND)
Posted: 7th Jul 2004 19:21
As I said, this snippet was created for MY Own game. So, I don't use bitmaps & sprites.. or if I use them, I delete them after their usage.
Naturally the snippet can be modified.
Just take care for the maximum ID's for each elements.
I don't use the 16 because this number is used by loading animation that is in use... & the animation 16 is always present in the whole game even if the animation changes.

Guido
http://www.vues3d.com
Axelman
21
Years of Service
User Offline
Joined: 18th Oct 2003
Location: Parallel Universe
Posted: 7th Jul 2004 20:55
ok.

CURRENT PROJECT: Enemy At The Gates
mm0zct
21
Years of Service
User Offline
Joined: 18th Nov 2003
Location: scotland-uk
Posted: 8th Jul 2004 10:15
what's wrong with the flush video memory command?
good idea though and still usefull code

http://www.larinar.tk
AMD athlon thoroughbred 2200, 512Mb ram, 40Gb HD, ati saphire radeon 9600 atlantis w/128mb ddr ram, good creative-labs soundcard, cd-rw + dvd drives.
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 9th Jul 2004 16:55
I made a more advanced one last year. check this out as well



If no-one gives your an answer to a question you have asked, consider:- Is your question clear.- Did you ask nicely.- Are you showing any effort to solve the problem yourself
Vues3d on Kalimee
20
Years of Service
User Offline
Joined: 12th May 2004
Location: NYON (SWITZERLAND)
Posted: 9th Jul 2004 18:42
Thanx indi!!!
I now hesitate in using also yours...

Guido
http://www.vues3d.com
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 11th Jul 2004 19:53
its free code, modify or use to suit your purposes if you so desire.

If no-one gives your an answer to a question you have asked, consider:- Is your question clear.- Did you ask nicely.- Are you showing any effort to solve the problem yourself

Login to post a reply

Server time is: 2024-11-23 19:36:28
Your offset time is: 2024-11-23 19:36:28