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.

Newcomers DBPro Corner / Showing Game is Loading

Author
Message
Help Me Please168
10
Years of Service
User Offline
Joined: 23rd Apr 2013
Location:
Posted: 9th Jul 2013 03:57
In regular games, it shows that the game is loading. In DBPro, how do you show that your game is loading when using a function? Please use an example code snippet please.
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 9th Jul 2013 06:37
It is worth noting that until the entire code itself is loaded, nothing will happen. I do not use 'Loading' indicators typically because unless your code is like 10,000 lines long, or has 150 models / textures / songs / etc., it will load in only a few seconds anyway.

Still, to help you out, I've written a short snippet of code to demonstrate one way you could do it. It is not the most elegant, but will do the job. The idea is to call a function to display a loading bar after you make initial function calls or gosub subroutines when the game is first loading/setting up. In this code, I use a variable, LoadPCT, to contain a value of what percentage of the game has been loaded. I then use this variable in a function to display a yellow bar indicating how much of the game has loaded.

I put some dummy functions in place to show you the idea:



It is a short example, but it should give you a way to do this.

So many games to code.....so little time.
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 9th Jul 2013 14:20
Also note that showing loading bars slows down the loading process, because you have to update the screen every time. I'm not saying don't use it, just don't use it too often.

TheComet

Login to post a reply

Server time is: 2024-04-20 04:00:28
Your offset time is: 2024-04-20 04:00:28