How Collisions Work in GameMaker Studio 2

  Рет қаралды 10,125

Let's Learn This Together

Let's Learn This Together

3 жыл бұрын

Basics of Collisions in Game Maker Studio 2
In almost every game, you'll need some sort of collision checking. Today, let's tackle basic collisions using place_meeting, collision masks, and while loops. We'll create a great system for use in prototypes and final games with just a little bit of code!
My Exclusive Courses💻🎮:
- Bundle Course Package & More Here! www.letslearnthistogether.com...
Game Dev In 30 Days 📖 💻😀
- I'm really excited to announce that I am writing a game development book for beginners!
- I am deeply motivated and invested into making this an awesome fun book for beginners interested in learning game development!
- Click the link to our KickStarter for more details! www.kickstarter.com/projects/...
Social:
- Connect with me on Twitter @Aaron_LLTT: / aaron_lltt
- Become a valued Patron and receive more exclusive perks @: / letslearnthistogether
- Wanna hear from other developers in the industry? Head on over to my podcast, DevTalk, to listen to engaging conversations I have with various successful developers: devtalk.buzzsprout.com/
- Now on Instagram 📸! Follow here for more content and sneak peaks! / letslearnthistogether

Пікірлер: 22
@chadcoyle
@chadcoyle 3 жыл бұрын
I understand this kind of basic collision well, but for the more advanced video(s), I'd love to understand how to code things like jump-through slopes and platforms that rotate dynamically while the player is standing on them. Great video covering this as it is!
@LetsLearnThisTogether
@LetsLearnThisTogether 3 жыл бұрын
Great suggestions! I’ll add them to my list.
@thebreadenjoyer6057
@thebreadenjoyer6057 Жыл бұрын
This video is so underrated. This is the only wall collision video that I have found that actually works and makes sense. I'm a complete beginner to all of this and your videos are really helping me.
@Joxlol
@Joxlol 8 ай бұрын
Man, you can't believe how long I struggled to find a solution for my collision (it were like 2 hours today, but I like to move fast forward). Thanks a lot, well explained, much appreciated!!!
@burnoMello
@burnoMello 4 ай бұрын
Saved my life, man. I am a beginner dev trying to figure out collisions and a bunch of other physics problems and this tutorial was clean, easy to follow. Thank you so much.
@papercut5238
@papercut5238 7 ай бұрын
Not sure if you're still active here, but wonderful tutorial! Although, I can't seem to figure out how to get diagonal collision working for the life of me.
@light9808
@light9808 2 жыл бұрын
Great video!
@Vampiric_Kai
@Vampiric_Kai 3 жыл бұрын
I love your gamemaker tutorials
@LetsLearnThisTogether
@LetsLearnThisTogether 3 жыл бұрын
Thanks!
@Starmanstriker
@Starmanstriker 3 жыл бұрын
How would you go about smooth collision? Like sliding against a diagonal from any direction or custom shapes.
@LetsLearnThisTogether
@LetsLearnThisTogether 3 жыл бұрын
If you add a few more while loops to check for both x and y speed increase, that will take care of diagonal. Custom shapes can be done by setting the collision of objSolid sprite to precise per frame, and then add more sub frames of those specific shapes.
@lytningthief
@lytningthief 2 жыл бұрын
Hi! So I use the same collision code you taught here but I'm having some difficulty with what I believe is called "Sub-Pixels." Basically when my character lands on collision blocks there's either a teensy bit of space between him and the block (not a full pixel) or his feet have sunk into the ground by roughly the same amount. It's not enough to get him stuck or anything but it seems to be interfering with sprite changes that require pixel perfect collisions. Any idea how to fix this?
@mopspear
@mopspear 14 күн бұрын
I found this to be really helpful but I want to suggest a change. Instead of using a while loop, I found that using a for loop that runs some arbitrary number of times is a better idea. It won't lock up if the collision suddenly become impossible, or you did something wrong with your code so that the while loop never completes. With a for loop, the worst that can happen is the collision doesn't completely touch what it is supposed to. It's better than being locked. I avoid using while loops whenever I can.
@jhmxk
@jhmxk Жыл бұрын
how would this change if the direction your character is facing is controlled by your mouse?
@SGTIvan921
@SGTIvan921 5 ай бұрын
Timestamp Reference: 10:26 Getting stuck phenomenon (Cause of it: Collision mask changing since the sprites are different when you face a different direction) 11:26 The solution 12:18 Making the character go up to the wall instead of stopping weirdly
@cronical246
@cronical246 3 жыл бұрын
How would this work if I use set direction instead?
@LetsLearnThisTogether
@LetsLearnThisTogether 3 жыл бұрын
Same idea. Just calculate where you’re moving based on speed and direction.
@cactus7022
@cactus7022 Жыл бұрын
I know it's been a long time, but... if I want the character's sprite to be above the table when he's in front of it, but when he's behind the table, then the character's sprite would be behind the table's one. How to do it?
@LetsLearnThisTogether
@LetsLearnThisTogether Жыл бұрын
You’ll need to change the depth of your player as they move. I believe the traditional and easiest approach is depth = -y, and apply that to every object in your game. Then the player will appear in front when they’re below it, and behind when they’re above.
@coxyofnewp
@coxyofnewp 3 жыл бұрын
What happened to video you posted yesterday and now it private? Keep up the great content.
@LetsLearnThisTogether
@LetsLearnThisTogether 3 жыл бұрын
It needed some edits. Pulled it. It will come out Monday. Keen eye!
@MACnTOOL
@MACnTOOL 3 жыл бұрын
"it sounds like i am beat-boxing but i am not"
GameMaker Studio - All of the GameMaker Events Explained
20:16
Let's Learn This Together
Рет қаралды 6 М.
GameMaker Tips & Tricks For Beginners 2023
19:39
Let's Learn This Together
Рет қаралды 4,8 М.
🤔Какой Орган самый длинный ? #shorts
00:42
Fast and Furious: New Zealand 🚗
00:29
How Ridiculous
Рет қаралды 35 МЛН
Playing hide and seek with my dog 🐶
00:25
Zach King
Рет қаралды 34 МЛН
Day in the Life of a Japanese Game Illustrator
17:04
Paolo fromTOKYO
Рет қаралды 4,1 МЛН
How to Make a Good 2D Camera
11:38
Game Maker's Toolkit
Рет қаралды 393 М.
GameMaker Studio 2: Easy Tile Collision System
16:39
GameMaker Rob
Рет қаралды 2,8 М.
I Made the Same Game in 8 Engines
12:34
Emeral
Рет қаралды 4 МЛН
Tierlisting the BEST (and worst) GAME ENGINES
33:51
BiteMe Games
Рет қаралды 210 М.
Common Mistakes Beginners Make In GameMaker
9:58
Let's Learn This Together
Рет қаралды 3,2 М.
[GameMaker Studio 2] - Perfect Top Down, Platformer, RPG Collisions
9:54
Let's Learn This Together
Рет қаралды 12 М.
What Progress Looks Like for a Hobbyist
9:58
JamieDev
Рет қаралды 22 М.
🤔Какой Орган самый длинный ? #shorts
00:42