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 / Help with free memory

Author
Message
Super Sabueso
16
Years of Service
User Offline
Joined: 10th Apr 2010
Location:
Posted: 11th Apr 2010 07:18
Hello, i try to create a 2D game, i use some animations (.avi or wmv) and sprites, images, music etc


mi code is something like this

any ideas?



Hello
Sixty Squares
20
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 11th Apr 2010 20:16
gx and gy are not global, so the function won't recognize them properly. Aside from that, what are you trying to do?

<-- Spell based team dueling game!
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 11th Apr 2010 20:59
You can either make gx or gy global by inserting the following line at the top of your code:

global gx
global gy


Or you can pass the values through the function by calling the function like this:

level1(gx,gy)

And declaring the function like this

function level1(gx,gy)

And yes, what are you trying to do?

TheComet

Super Sabueso
16
Years of Service
User Offline
Joined: 10th Apr 2010
Location:
Posted: 12th Apr 2010 06:16
a music game in 2D, i use animations on the background of music but every time use memory

Hello
Attila
FPSC Reloaded TGC Backer
21
Years of Service
User Offline
Joined: 17th Aug 2004
Location:
Posted: 14th Apr 2010 04:15
use gosub instead of function variables are available
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 14th Apr 2010 15:44
If I understand you correctly, you are experiencing a memory leak...? You have a section at the end to delete the music, animation, sprite and image, but I see nowhere in the game that can get you to that location to delete those items. Is you code snipppet complete?

The fastest code is the code never written.
Super Sabueso
16
Years of Service
User Offline
Joined: 10th Apr 2010
Location:
Posted: 15th Apr 2010 09:52
i solved this trouble, thanks guys

Hello

Login to post a reply

Server time is: 2026-07-26 12:32:41
Your offset time is: 2026-07-26 12:32:41