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 AppGameKit Corner / Making a Menu Screen

Author
Message
Khadin
9
Years of Service
User Offline
Joined: 13th Feb 2015
Location: Nottingham
Posted: 22nd Mar 2015 19:25 Edited at: 22nd Mar 2015 20:55
Hey again.

Now, i want to be presented with lets say three options; Start Game, Menu, and Credits. I've done this via create text, like so:



Now i believe i've got the interaction down via the code:


My problem is; i get the notification that i've physically clicked the 'Menu' text, but what would i do next to change screen? What i've been doing is something like:



obviously 'something' is a placeholder. I've put in for example; screenW*2,screenH) which jumps to a blank screen, but i'm pretty sure i shouldn't be doing it like that lol.

Thanks again.

EDIT - I've changed the code, so that when i click; "Start Game", it deletes the text, and i suppose i could create other sprites in their place. This don't seem right though. Code in full so far:



As you can see. I click 'Game Start' and i'm presented with a new backdrop, with all text now deleted. Is this the way it's suppose to be done? Rather than just jump to another point in the world.

Thanks again guys

Khadin
Funnell7
13
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 23rd Mar 2015 10:09 Edited at: 23rd Mar 2015 10:14
As you have already figured out, there are many ways to skin a cat lol... The way I manage this is by loading everything in its place (Credits, Options, Titlescreen etc) so that if you were to zoom out, you would see everything... I then just move the viewoffset based on the users input... This enables you to have nice transitions as opposed to just jumping from one screen to the next.

Here is my promo video which shows how it transitions (the jump from 'Achievements' to 'World Select' is the editing in the video, the screen actually 'slides' to each screen):



Using AppGameKit V2 Tier 1
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 23rd Mar 2015 13:00
I think that it's usually best to have the game and menu as separate loops - like the game could be a separate subroutine with it's own loop.

I'd have a menu button to start a game, then jump to a game subroutine and ensure all the required variables and media are in place before looping the game until it's exited, then back to the menu.

I've used the view offset to scroll through each menu screen, and that's quite effective - so when the menu loads up, going to the options scrolls the screen right to show the option controls, starting the game scrolls the screen right to the character selection screen, then again to the game start screen. Even in-game the view offset is useful, as it doesn't affect the 3D view, so the 2D view offset can be used to show in-game menus quite easily, even have them scroll into view if you like.

The main thing I think though, is you need to have your game as a separate routine with it's own media clear out, loading and setup.

I am the one who knocks...
Khadin
9
Years of Service
User Offline
Joined: 13th Feb 2015
Location: Nottingham
Posted: 23rd Mar 2015 16:59
Thanks guys. Still new, so subroutines (Which i sort of understand) and viewoffset (Again, sort of understand) are still a little unknown to me. But atleast i now know that i was sort of on the right track

Great game Funnell7 Looks cool.

Rather than make a new thread, here's a question that's none related. I play a game called Hearthstone, i'm sure you've heard of it (This could be any game in general). People make apps that recored stats from your playtime; Wins, losses, etc. Can you use AppGameKit to make programs like that?

Khadin
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 23rd Mar 2015 18:10
I think that would require some sort of battle net query, it's difficult to say what AppGameKit could access from that. I don't even have an account but maybe it's worth a shot - I'm sure there'll be documentation or an SDK to go on somewhere. I've never delved into online stuff like that, but there's no harm in experimenting with the HTTP request stuff.

Really I think AppGameKit is better suited to making a Hearthstone type game than trying to decipher data from it

I am the one who knocks...
Khadin
9
Years of Service
User Offline
Joined: 13th Feb 2015
Location: Nottingham
Posted: 23rd Mar 2015 19:22
Ah ok, thanks for that Van B

Khadin
isaackoz
9
Years of Service
User Offline
Joined: 6th Feb 2015
Location: Spacecyber
Posted: 27th Mar 2015 07:00
Hey,
Not sure if you still need help with this or this is what you need, but I find making a select statement to go from scene to scene. For example:


So basically you have a value (in the code it would be day, but it can be anything) and whatever the value is set to, it chooses the case the value is at. You would have your basic game logic inside you do loop and then your scene logic in each of the cases. Also, you may for some reason get a value that does not match up to a case, so you would add a case default at the end, so it would look like:

You can read more about the select statement at
http://www.appgamekit.com/documentation/language/25_case.htm
and [href]null[/href]http://www.appgamekit.com/documentation/language/24_select.htm
Good luck!

Also, if you're completely new, I recommend looking at this PDF book from digital-skills.co.uk, PDF link: http://www.digital-skills.co.uk/samples/agksample.pdf

~isaac
Khadin
9
Years of Service
User Offline
Joined: 13th Feb 2015
Location: Nottingham
Posted: 27th Mar 2015 17:27
Thanks isaackoz. Yep, i've read the samples, still waiting on the book to get released I'm still not 100% sure on the command setviewoffset() though. Not had much time to do the above, but have the rest of the day to get my head round it.

Khadin
Khadin
9
Years of Service
User Offline
Joined: 13th Feb 2015
Location: Nottingham
Posted: 27th Mar 2015 18:58
Well i reckon i've got Setviewoffset down. Command:

SetViewOffset(screenW,0)

is the screen adjacent to it. Don't see me being about to do that scrolling affect you've got going on though Funnell7

Thanks again all.

PS : If anyone knows how to get that Placement Editor working, let me know, cause it looks like it could make my life a whole lot easier when putting together a platform type game.

Khadin

Login to post a reply

Server time is: 2024-11-21 16:08:23
Your offset time is: 2024-11-21 16:08:23