Scope and encapsulation [Game Maker | Most know Basics] @1upIndie
Scope and encapsulation [Game Maker | Most know Basics]  @1upIndie
Uploaded December 2023 | Updated September 2026, 26 minutes ago
This basics video tutorial shows you what scope and encapsulation mean in GameMaker.

These to interlocking concepts are a must know in GameMaker and generally in programming because all programming languages have them in one way or another. In GameMaker scope is being refered to what instances (and their scripts/functions) can read and override from each other.

The first scope is the default one that all instances have access to each other (instance variables colored in blue or green). These self created variables or pre-set variables shipped with the instance can be accessed and rewritten. The second scope is for local variables (localvariables colored in yellow) that have a limited life time (event, script, function) and are bound to the instance calling it. The third scope is global (global variables colored in purple). These variables are once set static ones and saved in memory, so they don't rely on the instance existence to be access and changed. A sub category of global variables is enums or macro which are one time set and then locked. So you can access them but never change their values.


Tldr:
scope - accessabilty of code/things, which can be normal, local and global

encapsulation - bundling things into a unit, java classes for even hiding /Gamemaker objects, functions
idea is to bundle, hide, seperate interal and external code


Game shown: Nuclear Throne

๐Ÿ‘‘ Support me and get fresh game art and game maker projects every month:
patreon.com/1upindie

Follow me on:
๐Ÿ“ธ Instangram: instagram.com/1upindie
๐Ÿฆ Twitter: twitter.com/1upIndie
๐Ÿ’ฌ Discord: discord.gg/gvr98nb
๐Ÿ“œ Udemy: udemy.com/course/become-a-video-game-developer-with-gms-23 (See youtube about page for discount)

CHAPTERS
-------------------------------------------------------------------------------------------------------
0:00 Tldr of scope and encapsulation
1:43 Subscribe
1:53 Introduction
2:30 Things that are encapsulated (here objects)
2:55 Normal cope, instance variables (self made and pre-set)
3:41 Local scope
5:30 Global scope (global, enum, macro)
7:45 Encapsulation for local scope
9:48 Recap
Scope and encapsulation [Game Maker | Most know Basics]Orbiting bubble shield Megaman style [Game Maker Studio 2 | Basics]๐Ÿ”ดVignette - The very easy way [GameMaker | Vfx]First impression mattes [Super Demon Survivors devlog #2]How to make a world map [Game Maker Studio 2 | Basics]How to move diagonal correctly [Game Maker Studio 2 | Basics]Random ground generation [#2 Vampire Survivors Remake in GameMaker ]Text/dialog box - Quick and dirty with Scribble [GameMaker]Update V2022.9  [GameMaker Studio 2]Blinking player heart [#4 Remake Undertale in GameMaker ]Converting gml vs gml visual (dnd) [Game Maker | Basics]Inventory system to park your gear [GameMaker]
1up Indie |

Scope and encapsulation [Game Maker | Most know Basics]

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER