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.

Dark GDK / Help With Levels

Author
Message
Ninjateck
16
Years of Service
User Offline
Joined: 27th Feb 2008
Location:
Posted: 27th Feb 2008 22:06
Ive been making a game with dark GDk for a while and i have a problem... I created one starting level but i cant figure out how to create another level. do i clear the screen and then re-build the level from there ?
monotonic
18
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 28th Feb 2008 11:13
You have to delete all the resources(objects) used in your level using functions like dbDeleteObject, dbDeleteImage etc....
Also, before loading the next level try calling dbFlushVideoMemory.

Fornit some Fornus!
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 28th Feb 2008 16:33
This is dead on correct - however you should note that REPEATEDLY deleting and creating objects - over the LIFE of your application will eventually rear the head of what some of refer to as the "Delete Plague" common in all the TGC programming languages (and this DarkGDK lib). Also having a ton of objects - even Excluded ones - eventually causes a speed loss that once you hit this "unknown" ceiling has a exponential trend to only get worse as your application adds more objects.

Solution? I don't have one but for my game - the PLAN is to make it so there is a MENU "Program" that Handles what level your on etc...(The Launcher) and that Launcher Would invoke the game - One level at a time.

Launcher Creates a File that the Game will read to know what level to load, stats, etc. Then Launch Game

Game Will Load this file - and then act accordingly to get all set for the player to play.... Upon successful Completion - the game will create a file for the launcher to read - like "Level Complete" and stats - any other important info.. Then Game Will Launch the Launcher.

The goal being to thwart the problems that arise when there is TOO MUCH creation deleting going on - as well be sure this system I just described only has ONE EXE running at a time... They would Alternate... Each Starting the other before Terminating.

Login to post a reply

Server time is: 2024-11-20 03:32:59
Your offset time is: 2024-11-20 03:32:59