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 / State Machine Example [CODE - TIER 1]

Author
Message
GunnerJnr
AGK Developer
8
Years of Service
User Offline
Joined: 30th Nov 2015
Location: Bridgwater, UK
Posted: 19th Jul 2017 13:56
Hi since I saw a few people on the facebook AppGameKit page asking about this I thought I just as well share my example here for others to use also. I am sure there are probably better and more efficient ways to achieve the same result and I am definitely not saying I am an expert by any stretch of the imagination.

Here is the code there will also be a zip/RAR file containing the working project. Its basically a simple state machine that demonstrates how to change states in your game/apps. Also it could easily be converted to Tier 2.

[Setup.agc]



[Constants.agc]



[Window Setup.agc]



[Main.agc]




NB - Obviously this can be changed to suit anybody's needs also the functions could be moved into separate classes/files to save filling main up with too much code. But either way hopefully it will help some people.

Cheers and Enjoy!
GunnerJnr

Attachments

Login to view attachments
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 20th Jul 2017 17:25
Good post

It can also be very helpful to have sub-states, this is especially useful when setting up AI systems and game intros, animated or tweened menus and such.

GunnerJnr
AGK Developer
8
Years of Service
User Offline
Joined: 30th Nov 2015
Location: Bridgwater, UK
Posted: 20th Jul 2017 18:49
Thanks @PartTimeCoder - I hadn't considered that before now, very handy tip. Much appreciated!

Login to post a reply

Server time is: 2024-11-24 11:28:26
Your offset time is: 2024-11-24 11:28:26