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 Discussion / Best way to add levels. To your game.

Author
Message
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 24th Sep 2004 09:15
Hi

I have a current project that could be considered complete to a degree, but its very simple, and only has one level. I want to spread and make the game bigger. The problem is that up untill now I have only been trying to get the engine working, not organize everything into easy to use parts. I want to be able to add more levels, and then be able to go to those levels when the current level is complete. The easiest way would be a subroutine right? But then again, what should be in that subroutine? What do I do with the gameplay sfuff, such as object selection, bullets, and collision? Do I put all that under subroutines to? Im confused.

Guns arnt the problem, people are the problems, shoot all the people and guns arnt a problems anymore.
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 24th Sep 2004 09:26
You could use the subroutine method, just jot down all the information your engine needs to recreate a level you have coded, and include that in the subroutine (be sure to modify your engine to accept external values if you haven't yet).

I like designing a format personally. Know everything your engine needs to know for each part of a level. For example:categorize objects into groups such as: terrain, enemies, doors, etc.
Your engine should have different parts of code that define how to deal with these different types of objects, and make them behave based upon the parameters you feed it. This way you can keep everything in a .dat or .txt or whutevah, and it also leaves the option of writing a level editor.

Crazy Donut Productions, Current Project: Project Starbuks
Sony stole our name!
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 24th Sep 2004 09:30
Well my code is a bit messy, I mean that the level code is all mixed in with the create object commands, collision, camera, bullets, and all the other info, but what I want to know is what I can do for the next level, for instance, what do I put in that subroutine?

Guns arnt the problem, people are the problems, shoot all the people and guns arnt a problems anymore.
BatVink
Moderator
22
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 24th Sep 2004 18:27
I use a function called Play(). This runs every level. Before calling Play, I set up all the level data (maps, objects, health, score etc...). Play() simply does the same thing every time, but with different parameters.

Using this method, you can separate the level design (whether that be maps, lives or other parameters) from the actual gameplay itself.

For example, Play() could allow you to run around with a gun shooting everything until health runs out or there are no baddies.
In the level initialisation, I can vary the health, number of baddies, damage done by gun, and the map to run around on. I can do this for as many levels as I choose, without having to reprogram the gameplay.

BatVink
http://biglaugh.co.uk/catalog AMD 3000+ Barton, 512Mb Ram, 120 Gig Drive space, GeForce 5200 FX 128 Mb, Asus A7N8X Mobo.
Terms & Conditions apply
blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 25th Sep 2004 18:27
I wonder if there's a market for some kinda general game library for use in DarkBasic... (e.g., really, really complicated Play() function, etc.)

[img src=http://blanky.pt-web.net/ddd.gif] >::p
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 27th Sep 2004 02:30
imagine all the n00bs that would pay for that

Crazy Donut Productions, Current Project: Project Starbuks
Sony stole our name!
BatVink
Moderator
22
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 28th Sep 2004 02:32
I think it's in development, and may have a title of "FPSC"

BatVink
http://biglaugh.co.uk/catalog AMD 3000+ Barton, 512Mb Ram, 120 Gig Drive space, GeForce 5200 FX 128 Mb, Asus A7N8X Mobo.
Terms & Conditions apply
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 28th Sep 2004 07:54
"FPSC"
Wouldn't it be great if it was able to expand its horizons though.

Crazy Donut Productions, Current Project: Project Starbuks
Sony stole our name!
EddieB
20
Years of Service
User Offline
Joined: 29th Sep 2004
Location: United Kingdom
Posted: 2nd Oct 2004 16:38
Just because we are new. we all hafe to start somewhere

If its not how you do it its the way you do it.

Login to post a reply

Server time is: 2025-05-24 19:36:33
Your offset time is: 2025-05-24 19:36:33