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 / Dark GDK questions

Author
Message
Scope 51791
16
Years of Service
User Offline
Joined: 25th Jul 2008
Location:
Posted: 25th Jul 2008 19:05
I am kind of new to gdk. I was able to make a sprite move right and left and also shoot(I used the contra sprites). I have a few questions about Dark GDK that I am wondering about.

1. Is there a way to make a menu such as New Game, Load Game, Options, and etc...

2. Is there a way put a video format into it such as .avi or etc...

Those are the main questions that I'd like to know.

Thank you.
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 25th Jul 2008 20:25
Regarding #1, yes. The simple answer is, the screen displays what you tell it to. Programatically you'll need to break your program down into separate functions for each of them and use a control loop to determine which function gets called when other functions exit. Although it's nested slightly, my control code looks something like this:



The currentStage enumeration sets what functionality needs to be called. Each function sets currentStage based on their exit conditions. For example, going into the game currentStage would be set to intro which would cause the Intro() function to be called. Most logically Intro() would set currentStage to menu and when the loop cycled again it would determine that the Menu() function needs to be run. Inside Menu() the setting for currentStage would be set to something like play or end then would exit, allowing the loop to cycle and determine which of those functions to run.

As for embedding a .avi, the answer is "probably," but not with anything simple. Though I don't have the urge to try it, I would imagine that you could set up a thread to do the processing then have it do the reading, decoding and writing to an image. But none of that is built into DGDK.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 25th Jul 2008 20:30
Switch statements are the best method, in my opinion. Kudos.

Windows Vista Home Premium Intel Pentium Dual-Core 1.6 Ghz 1GB DDR2 RAM GeForce 8600GT Twin Turbo
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 26th Jul 2008 20:10
Here - Scope this out (another Jason code plug) it has a cool 3d Tank Tread Menu: http://code.google.com/p/darkgdkoop/

Login to post a reply

Server time is: 2024-09-30 03:30:00
Your offset time is: 2024-09-30 03:30:00