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 / a simple animated loading screen?

Author
Message
1beginner1
15
Years of Service
User Offline
Joined: 28th Jun 2009
Location: Belgium
Posted: 3rd Aug 2009 15:02
Hello

Is there a possibility in Dark GDK to make a loading screen wih a loading bar or something that looks like a loading bar? Or play an animated picture while loading?
Drowneath
15
Years of Service
User Offline
Joined: 22nd Jun 2009
Location: In your eyes
Posted: 3rd Aug 2009 15:25
Sure. Why not?

Split your program into different game states.
Maybe two, the Loading Screen, and Main Screen.

Then draw an animated sprite (the loading animation) in the loading screen state.

if(asleep) sheep++;
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 3rd Aug 2009 15:32
I think you need to look into multi-threading, something I know almost nothing about sorry.
1beginner1
15
Years of Service
User Offline
Joined: 28th Jun 2009
Location: Belgium
Posted: 3rd Aug 2009 23:07
Drowneath

I am vere new in game development. And i don't find how i can create what you mean can you explain it more specific? So i can try it in my game.
soul_C
17
Years of Service
User Offline
Joined: 26th Jan 2007
Location:
Posted: 4th Aug 2009 03:04 Edited at: 4th Aug 2009 08:16
Im not to sure about how to make a loading bar. but a opening credit/loading page would look somthing like this.
I cant quite remember what the command is to make an animated sprite



Hope this helps

Edit: change it to dbCreateAnimatedSprite. i haven't tested it like this but it should put you in the right direction.
wickedly kick it
18
Years of Service
User Offline
Joined: 13th Jul 2006
Location: Fort-worth Texas
Posted: 4th Aug 2009 06:06
Sorry to say soul_C but animations cant be loaded via images. Use the create animated sprite command and youll so how to do it . Just look in the documentation.

soul_C
17
Years of Service
User Offline
Joined: 26th Jan 2007
Location:
Posted: 4th Aug 2009 08:12
I know, but at the time i didn't have any documentation in from of me to help me remember the command, this was just an example to help 1begginer1 to get started. Now that I am home I will correct the error.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 4th Aug 2009 14:49
I think the op is trying to get a loading screen with a bar that indicates how much progress has been made, as far as I know as soon as you use the dbLoadObject, sprite, image etc... your program will stop at that line until it is loaded, therefore leaving you without the ability to update the sprite(object) or do anything animated, I could be wrong.

This is why multi-threading MAY be the way to go, you can have one thread loading your object while the other thread could be updating the screen after calling the dbPlay command.

I feel the real answer to the question maybe yes you can do it, but it might not be worth all the time and effort unless you are fluent in multi-threading, or it is really, really important for your game.
1beginner1
15
Years of Service
User Offline
Joined: 28th Jun 2009
Location: Belgium
Posted: 4th Aug 2009 17:34
Ok I think I don't gonne made a loading screen because i know nothing about multi-threading. And it isn't really important but just wanted something that fills up the black screen when the game is loading

Thanks for all the posts
randal
15
Years of Service
User Offline
Joined: 18th Nov 2008
Location:
Posted: 5th Aug 2009 11:52 Edited at: 5th Aug 2009 11:54
//oops
randal
15
Years of Service
User Offline
Joined: 18th Nov 2008
Location:
Posted: 5th Aug 2009 11:54
for(int i=0; i<numObjectsToLoad; i++)
{
loadobject(i);
updateProgressBar();
dbSync();
}

while(1)
{
//gameloop
dbSync();
}
1beginner1
15
Years of Service
User Offline
Joined: 28th Jun 2009
Location: Belgium
Posted: 5th Aug 2009 14:41
When I debug he gives the error identifier not found for updateProgressBar and loadObject. Do I need to include something in beginnig of code or did I something else wrong. Or do I need to declare them.
heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 5th Aug 2009 19:37 Edited at: 5th Aug 2009 19:38
Try dbLoadObject(i); but I can't find anything for a progress bar command...

Use Google first... it's not rocket surgery!
prasoc
15
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 5th Aug 2009 20:18
randal posted pseudo code why did you try to compile it?? of course it won't work. you're supposed to put your functions into it


Your signature has been erased by a mod
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 6th Aug 2009 02:35
making a loading bar is simple, ok so just take a standard ummm green bar (you can make it in dgdk or just load on up) it would only need to be 1 pixel wide, then just use sprite and when you need to make the progress bar go up then you just "Stretch" the sprite. i think the command is dbStretchSprite().

New Site! Check it out \/
randal
15
Years of Service
User Offline
Joined: 18th Nov 2008
Location:
Posted: 6th Aug 2009 13:59
yes my code is pseudo. You are meant to write your own functions for loadobject() and updateProgressBar()

just trying to show that your loading screen and game loop are apart and both loops does dbSync().

In the loading screen loop you would add sprites/shapes to increment your loading bar on the screen every time you load something. So if you load 10 objects you would update the bar 10 times.

When the loading is complete you would start the main game loop.

Login to post a reply

Server time is: 2024-10-01 10:17:47
Your offset time is: 2024-10-01 10:17:47