MGGA – Introduction to Variables

Full Video –

Variable Definition –

SwiftPlaygrounds –

Variables are snippets of code which store a value of any random thing in your program or game. It’s used by game developers to dictate what object in a game does what to where and when, all things that are defined by Variables.

Looking at previous episodes, the Guards are their complete own variable, and Shopkeeps would be their own variable, the player character is their own variable, townspeople are their own variables, a door is a variable, and just about anything is a variable which is defined the developer. That way you can code further things to say Door193 will only unlock with Key039 and not any other key in your pack.


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s