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.

Author
Message
mihaid
14
Years of Service
User Offline
Joined: 24th Feb 2012
Location:
Posted: 22nd Sep 2014 18:54
I want to ask a question about how to start new levels in a game, but the real question is which is the best strategy to start a new level, especially if the game is not so well structured. I work with dark basic professional since 2012, but i feel i dont have a good and efficient structure of my scripts. And to be more specific, i known from others the fact when i go to the next level, i must delete all object, and reload again in next level, what if i have a routine for every level, with different do-loop cycle inside of the routine???, In the main do loop i have a lot of activity with some objects and if i delete the objects, I'll have errors like don't find object...so on....I tried several possibilities..and I really don't known which is the best solution. I hope i made myself a little understood....the general idea is ...what advices you can have for me as strategy and which is the best way to organize a multilevel script to function without to decrease the game speed....i known this subject can be develop, extended....and can be interested for many non experienced programmers like me. I wait your suggestions, opinions, advices, all are welcome

Mihai
wattywatts
17
Years of Service
User Offline
Joined: 25th May 2009
Location: Michigan
Posted: 22nd Sep 2014 19:05
I think everybody does it differently. Some people have multiple loops. I usually create a sub before loading my level objects, then some if conditions that load different things per level.

It works better if you plan on it from the beginning though. Here's a basic example.
mihaid
14
Years of Service
User Offline
Joined: 24th Feb 2012
Location:
Posted: 22nd Sep 2014 19:57
Thank you very much Wattywatts, you understood exactly my question, and i think it's good to organize the script from the beginning, also to be..some how modular, to have the possibility to add new levels if you want, or to change some conditions somewhere..so on..
Thanks again !!

Mihai
VisualProg
17
Years of Service
User Offline
Joined: 31st Mar 2009
Location: RussianFederation, Smolensk
Posted: 24th Sep 2014 14:47
if level load from file-script:

1. put in file 3D Box for "Script Zone"
2. put parameters for script zone (level name, file name e.t.c.)
3. cleanup all
4. load next level from you file script



it allows me to relate the infinite number of levels in an infinitely intricate passages.

MZh[NUL] <---

My musics
mihaid
14
Years of Service
User Offline
Joined: 24th Feb 2012
Location:
Posted: 24th Sep 2014 17:57
Thank you very much for your help VisualProg, but I must confess i understood only partially your text, It seems every level it's a different file probably, and with 3dBox for "script zone" you put me in a big fog...lol.. maybe you can give me few more details? Anyway, the idea with a function to load levels it seems for me interessing, faster and like you said, its good to load a lot of levels...

Mihai
VisualProg
17
Years of Service
User Offline
Joined: 31st Mar 2009
Location: RussianFederation, Smolensk
Posted: 24th Sep 2014 22:39 Edited at: 29th Sep 2014 16:47
ok, details:

1. Create header:


sorry, in my city now night on the street, i sleep in walking, and i'm bad writing the code))

2. You need use load scene from file. It may be:



for demonstration, i create mini scenes from functions:



and:



3. You need create simple "zone checker"



4. Create clean all:



ok. next, add program for testing:



that's all.

If you start this programm, loading level1, next, go to the "red box", and level reset, and programm read next level. I created loop levels.

Sorry for my English, tried to explain as best I could.
I attached source file, for compilation.

MZh[NUL] <---

My musics
VisualProg
17
Years of Service
User Offline
Joined: 31st Mar 2009
Location: RussianFederation, Smolensk
Posted: 24th Sep 2014 22:43
I think it's much better than describe the 1000 levels within the program ...

MZh[NUL] <---

My musics
mihaid
14
Years of Service
User Offline
Joined: 24th Feb 2012
Location:
Posted: 24th Sep 2014 22:47
Wowww...i really thank you a lot for your full support, i understand i have many things to learn in the future. I will apply surely what i learned today from you. Thanx a lot !!!

Mihai

Login to post a reply

Server time is: 2026-07-17 23:34:15
Your offset time is: 2026-07-17 23:34:15