Clearing Memory When Quitting
Author |
Message |
Suigi
|
Posted: Tue May 17, 2005 12:21 pm Post subject: Clearing Memory When Quitting |
|
|
Hey all!
I'm trying to make a game similar to the special stage in Sonic 2 for my final project in Grade 12 CompEng, and I'm kinda stuck with something.
After each run of the program, it gets slower and slower.
I'm thinking it's because of the sprites still being stored in memory.
If it isn't, post why.
If it is, then could someone please tell me how to, just before the program closes, clear all the sprites?
I'm using BSprite, and Turning 4.0.5.
Thanks!
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
jamonathin
|
Posted: Tue May 17, 2005 1:35 pm Post subject: (No subject) |
|
|
Send your code next time. If you're using Pic.FileNew then dont worry about it slowing down your porgam. If you're using Pic.ScreenLoad, then start using the other one because you're going to want to save your pic to a variable.
Also check your View.Updates (if you have them). There should only be one (for the most part, depending on your program complexity) and it should be after your delay.
Thats all I can think of right now, send your code, pictures aren't really necessary, but if you're gonna send them, put them in a zip file please and thank you.
|
|
|
|
|
|
Delos
|
Posted: Tue May 17, 2005 2:09 pm Post subject: (No subject) |
|
|
If your programme stops executing, I believe memory is automatically purged...but who knows.
Either way, with your pics make sure you have Pic.Free() used in copious volumes...or at least in succinct locations.
|
|
|
|
|
|
Cervantes
|
Posted: Tue May 17, 2005 6:20 pm Post subject: (No subject) |
|
|
I'm assuming you've edited your post, since neither Jamonathin nor Delos mentioned anything about BSprite. Nonetheless, what they say still holds true -- you just need to translate it into BSprite. Normally, you'd use Pic.Free. With BSprite, use BSprite.Free (spriteID : int). Are you using that?
|
|
|
|
|
|
lain
|
Posted: Wed May 18, 2005 8:42 am Post subject: (No subject) |
|
|
I have hured of a Sprite before but what is a BSprite and how is it difrent from a Sprite? Also i thougth sprites where removed from truing?
|
|
|
|
|
|
Suigi
|
Posted: Wed May 18, 2005 11:46 am Post subject: (No subject) |
|
|
Hmmm...well, if memory is automatically purged every time the program closes, how come after repeates runnings it gets slower?
And since I don't want to have to load the sprite every single time my loop completes, it's not such a wise idea to include a BSprite.Free statement inside it.
What I'm wondering is, how can I say "exit the loop when the program is closing?"
Attached is my game so far, along with all associated files.
Description: |
Game so far: Run CollDect.t |
|
Download |
Filename: |
Turing Game.rar |
Filesize: |
173.93 KB |
Downloaded: |
103 Time(s) |
|
|
|
|
|
|
Delos
|
Posted: Wed May 18, 2005 12:44 pm Post subject: (No subject) |
|
|
I suggest you direct your question to Bacchus, the creator of BSprites. Just PM him.
|
|
|
|
|
|
Bacchus
|
Posted: Wed May 18, 2005 8:51 pm Post subject: (No subject) |
|
|
great specified questions lol, ne who, i checked out your program pretty nice, im glad my stuffs being put to good use. i tried it a bunch of times and it wasnt getting slower... are you sure its not just the computer your running it on?
@lain : since the Sprite commands were taken out of turing in the 4.x series (i think) BSprite emualates at what the original commands would do. of course i couldnt do it the exact same way but it works well enouph. Sprite are used to have a picture that sits on top of the background and when you remove it or move it the background will be in tact. that way you dont have to keep drawing everything over and over again which would make everything go slower and that might be the reason for Suigi, i didnt check how he drew everything...
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
|
|