Uploaded March 2021 | Updated November 2026, 2 hours ago
Hi! Today we'll go over how to make a gate opening (and closing) animation, using animation curves in Game Maker Studio 2.3. It'll also include how to use the new curves library feature in game maker studio 2.3.2
We'll make the gate accelerate to the top and then bounce a few times before stopping. For today's animation principle we'll talk about staging. We use staging to control how the viewer perceives the scene. In my example, the gate and the lever animate at the same time. This actually breaks staging since the viewer doesn't know where to look with multiple things happening at once.
0:00 Intro
1:00 Open Animation
3:33 GMS 2.3.2
5:04 Open Implementation
9:09 Open Tweaks
10:10 Close Animation
11:08 Close Implementation
12:40 Close Tweaks
13:34 Animation Principle
Starting Code
github.com/ArendPeter/CastleGame/tree/e58430ff0d0f79255208a476627c686c15e21eb0
Ending Code
github.com/ArendPeter/CastleGame/tree/8ef5b5e7ba0e6e7b97a95ae32b1bef59b1ba91f1
Triggers Tutorial
youtube.com/watch?v=Sik3IA0FS4o&list=PLywxFF6tce1_F4gkeyWZu2jqHko5AxBJ-
Animation Curves
youtube.com/watch?v=V-4FeNFFC7M&list=PLywxFF6tce1-Y8teVEtN_W9zXJlhGlkH2
StepTowards Script
gist.github.com/ArendPeter/42f1ba6971d21b973cd50127a4ea16c9
Animation Curves Playlist
youtube.com/watch?v=V-4FeNFFC7M&list=PLywxFF6tce1-Y8teVEtN_W9zXJlhGlkH2
Lever Tutorial (companion tutorial)
youtube.com/watch?v=n5pk9lSpSFU&list=PLywxFF6tce1-Y8teVEtN_W9zXJlhGlkH2
Animation Principles: Staging
youtube.com/watch?v=u-SXLaQGg50&list=PL-bOh8btec4CXd2ya1NmSKpi92U_l6ZJd
Office Hours Submission Form ( for helping debug your projects on livestreams :) )
https://forms.gle/Mp2258ZBNhFShr548
Tutorial Submission Form
https://forms.gle/9N6UpX2YiLmeb1Sw8
Hi! Today we'll go over how to make a gate opening (and closing) animation, using animation curves in Game Maker Studio 2.3. It'll also include how to use the new curves library feature in game maker studio 2.3.2
We'll make the gate accelerate to the top and then bounce a few times before stopping. For today's animation principle we'll talk about staging. We use staging to control how the viewer perceives the scene. In my example, the gate and the lever animate at the same time. This actually breaks staging since the viewer doesn't know where to look with multiple things happening at once.
0:00 Intro
1:00 Open Animation
3:33 GMS 2.3.2
5:04 Open Implementation
9:09 Open Tweaks
10:10 Close Animation
11:08 Close Implementation
12:40 Close Tweaks
13:34 Animation Principle
Starting Code
github.com/ArendPeter/CastleGame/tree/e58430ff0d0f79255208a476627c686c15e21eb0
Ending Code
github.com/ArendPeter/CastleGame/tree/8ef5b5e7ba0e6e7b97a95ae32b1bef59b1ba91f1
Triggers Tutorial
youtube.com/watch?v=Sik3IA0FS4o&list=PLywxFF6tce1_F4gkeyWZu2jqHko5AxBJ-
Animation Curves
youtube.com/watch?v=V-4FeNFFC7M&list=PLywxFF6tce1-Y8teVEtN_W9zXJlhGlkH2
StepTowards Script
gist.github.com/ArendPeter/42f1ba6971d21b973cd50127a4ea16c9
Animation Curves Playlist
youtube.com/watch?v=V-4FeNFFC7M&list=PLywxFF6tce1-Y8teVEtN_W9zXJlhGlkH2
Lever Tutorial (companion tutorial)
youtube.com/watch?v=n5pk9lSpSFU&list=PLywxFF6tce1-Y8teVEtN_W9zXJlhGlkH2
Animation Principles: Staging
youtube.com/watch?v=u-SXLaQGg50&list=PL-bOh8btec4CXd2ya1NmSKpi92U_l6ZJd
Office Hours Submission Form ( for helping debug your projects on livestreams :) )
https://forms.gle/Mp2258ZBNhFShr548
Tutorial Submission Form
https://forms.gle/9N6UpX2YiLmeb1Sw8


![Stackable Inventory Part I Game Maker Tutorial
In this tutorial Ill be showing you how to create a stackable inventory in game maker. This technique is used in a variety of different games such as minecraft, runescape and pokemon.
Music by docjazz4
FAQ
Q: Can you put up a download link?
A:Sure I guess I can do that
http://www.mediafire.com/download/05vb89vhr0ds8zj/sourcecode2.gmk
Q:
ERROR in
action number 1
of Collision Event with object obj_player
for object obj_item:
Error in code at line 16: obj_invcontrol.inv[slot,0]=index ^
at position 25: Negative array index
When my inventory is full and I try to pick up an item the game crashes, how do I fix this?
A: Sorry in the left pressed event of obj_item I have 2 for loops, one to check if there are any matching items in the inventory and another to check for empty slots if there arent any like items in the inventory. The slot variable is set to -1 if it hasnt found a slot yet so if it makes it through both loops it will try to add 1 to the -1 index in the inv array. The problem with that is that you cant have negative indexes in arrays and therefore the game crashes.
In order to fix this replace the last 4 lines in the code to the following if slot! 1{ control.inv[slot,0]=index }
}
if slot! 1{ control.inv[slot,1]+=1 instance_destroy()
}
Q:
ERROR in
action number 1
of Draw Event
for object obj_slot:
Error in code at line 2: draw_sprite(control.sprites[control.inv[index,0]],0,x,y) ^
at position 14: Unknown variable control
How do I fix this?
A: This is a rather tricky error and it took me a long time to figure out what the problem was. Even if you coded everything exactly as I said its still possible for you to get this error. Whats happening is obj_slot is created in the room before the control object. So at the instance obj_slot is created it tries to find a variable in control but it cant because control doesnt exist yet.
What you need to do is ensure that control is created first. So go into your room, remove all the slot objects and ensure that the control object is there. Leave the room then go back and readd the slot objects. This way you added the slot objects to the room after the control object which will create the control object first
Q:
ERROR in
action number 1
of Draw Event
for object obj_slot:
Error in code at line 2: draw_sprite(control.sprites[control.inv[index,0]],0,x,y)
^
at position 38: Unknown variable inv
A: People have been having this problem for a months, but Ive only recently figured out what the issue is, you might not have initialized your variables correctly but usually people forget to add the control object to the room. I guess I went through that a little fast in the video or something. Do NOT add obj_item to the room but be sure to add control Stackable Inventory Part I Game Maker Tutorial](https://i.ytimg.com/vi/Iy_ei_BXfV0/mqdefault.jpg)







