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.

DarkBASIC Professional Discussion / Delete sprite, not deleting everything?

Author
Message
Mychal B
15
Years of Service
User Offline
Joined: 21st Jul 2010
Location: Coos bay, rainville
Posted: 27th Dec 2011 11:39
So I'm trying to play my game, quit, then go right back to playing the same level. I delete all sprites, audio, animations, objects, everything! Only problem is that when I go to play a second time the animations don't play. If I disable the function to load the sprites at the beginning of the game it works fine. The interesting thing is if I use "set display mode" in the delete process it works correctly. I can only assume that something Isn't being deleted, but I know my loop is going through all the items.

This is what I do when I load:

The reason why I use show sprite and change the alpha when deleting it is to restore it to its original values, in hopes of making it work, but still no luck

The fastfood zombie killer
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 27th Dec 2011 12:39
1) Nothing in the posted code suggests any animation (you should probably include that part as well).

2) You're not deleting image 1.


"Why do programmers get Halloween and Christmas mixed up?"
Mychal B
15
Years of Service
User Offline
Joined: 21st Jul 2010
Location: Coos bay, rainville
Posted: 27th Dec 2011 15:44 Edited at: 27th Dec 2011 15:45
I was just trying to make everything abstract as they are in different files.

and when I delete everything I loop through all the file types "images,animations,audio" to a number way higher than I'd use

The fastfood zombie killer
basjak
16
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 27th Dec 2011 19:34
nothing is strange. reseting the display mode will clear the memory from all images and animations.
Mychal B
15
Years of Service
User Offline
Joined: 21st Jul 2010
Location: Coos bay, rainville
Posted: 28th Dec 2011 01:58
hmmmmmm what's the difference... Are you sure that the sprite couldn't be trying to refer to the deleted image or something?

The fastfood zombie killer
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 28th Dec 2011 10:53
Quote: "when I delete everything I loop through all the file types "images,animations,audio" to a number way higher than I'd use"

Try setting them to 0?

My signature is NOT a moderator plaything! Stop changing it!
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 29th Dec 2011 00:17
I believe that if you were to minimize and restore this will flush everything... then you can reload everything... but just a memory based hint I can not remember all the details...

Mychal B
15
Years of Service
User Offline
Joined: 21st Jul 2010
Location: Coos bay, rainville
Posted: 29th Dec 2011 05:43
Unfortunately I don't think it's acceptable to minimize the game really, I feel like it destroys the players experience. It does work though!

The fastfood zombie killer
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 29th Dec 2011 05:46
Maybe a display resize?... Like say the actual display res is 1024x768... Take it down to 640x480 and then return to the higher again... should have the same effect while on a blank screen... let me know the results please I am curious to know if this shows the desktop while switching or not...

Mychal B
15
Years of Service
User Offline
Joined: 21st Jul 2010
Location: Coos bay, rainville
Posted: 29th Dec 2011 06:37
Ill try it out right now!

The fastfood zombie killer

Login to post a reply

Server time is: 2026-07-10 20:58:15
Your offset time is: 2026-07-10 20:58:15