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.

AppGameKit Classic Chat / Making a title screen aka launch screen with play options

Author
Message
Mmarzex
11
Years of Service
User Offline
Joined: 26th Feb 2013
Location:
Posted: 13th Mar 2013 21:58
This may be a stupid question but I'm having issue with where I would be able to start with making a title screen at the beginning of the game. How would I load that image/options and then load the first level when people press play? Is there any good practice for doing it?
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 13th Mar 2013 23:16 Edited at: 13th Mar 2013 23:21
>Main
->Menu
->Game
->Config
->Lobby (Multiplayer)

the calling order have some advantages and disadvantages.

i using the return values for navigate, if the menu returns 1 you can goto play, if return 0 you can exit, or 2 jump in config

menu is a function with a play button/loop/sync.
the function make the dialog, wait for input and then it delete the mask and return.
game is a function that load the level, have a loop for input,movement/update/sync, called by a menu button or direct at developing.
config is a function with textboxes/checkboxes/buttons/loop/sync.

i often split it in extra files because its more clearly.
you can make the menu/level/config ready and put it away but the game is a more a permanent construction site.

i grouping many variables in a user defined types.
Mmarzex
11
Years of Service
User Offline
Joined: 26th Feb 2013
Location:
Posted: 14th Mar 2013 03:00
That makes sense. I think I'm a little confused though as to what you would put in the begin function and the loop function? Is there a practice that is best for that?
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 14th Mar 2013 08:43 Edited at: 14th Mar 2013 10:10
the begin function can be a loop with select case.
it starts with a default value to jump in menu or game.

example without menü


old source from blitzbasic
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 14th Mar 2013 15:32
Mmarzex, I am guessing that you are working Tier 2 because you discuss the begin and loop methods.

The begin method is good for loading up various media and setting the display parameters (ratio if using percentage system or width/height for virtual resolution) and orientations allowed. Nothing actually gets displayed during the begin method, it is the first agk::Sync() call in the loop method that causes the display to appear. But setting up the initial menu is also fine (I would suggest a separate function for that since you will probably redisplay the menu more than once).

All other functionality is done in the loop method. You put your basic state checking and game play calls here, based on the state. Remember to have call agk::Sync() as the last thing in the loop.

Does that help?

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master

Login to post a reply

Server time is: 2024-11-24 09:50:53
Your offset time is: 2024-11-24 09:50:53