Death pit + save spot - [Game Maker Studio 2 | Basics]
Вставка
- Опубліковано 16 вер 2024
- This basic video tutorial shows you how to setup an instant death pit/area and a save spot the easy way in GameMaker Studio.
The concept is actually quite easy. You simply need 2 objects. One for the death pit which is a simple rectangle that checks for a collision with you player. The other one a save spot that is being placed on strategic places as a teleport destination. Upon collision of the player with the death pit the player is being teleport to the nearest instance of the save spot. Thats it.
There are of course more difficult and elaborate ways to do that with for example an array structure where you save you last positions and get teleported back to one of those.
▶ Gamemaker Studio: www.yoyogames....
▶ Trial limitations: help.yoyogames...
🎮 My free game Clunky souls:
1up-indie2.itc...
💓 My assets:
Get some assets at itch.io 1up-indie2.itc...
📜 Udemy: www.udemy.com/...
👑 Support me and get fresh game art and game maker projects every month:
/ 1upindie
Follow me on:
📸 Instangram: / 1upindie
🐦 Twitter: / 1upindie
💬 Discord: / discord
📜 Udemy: incoming
Best Game Maker Studio tutorial channel
that I have ever seen. Thank you very much for sharing, on your channel I found everything I needed to be able to implement and try it in my future games. Now I can fulfill my dream of becoming an indie developer. Thank you very much indeed
That is a humbling statement, so thank you for your trust! Please consider making games a side hobby/hustle. Being an indie developer is a very risky endeavor with unknown outcomes. The failure rate is very high in this field, but if you want to push through anyways, good riddance and success on your journey.
Yo I've been searching for a save system for game Jam that is due in 2 days. All of them have been super complicated and not worth my time. But this one, you have made this super simple for me.
Glad that is of value to you. Good luck on the Game Jam!
Very excited to hear your Udemy course is ready!!! Congratulations.
best tutorial !! and so fast i love it haha thanxx man
Thanks mate!
Cool stuff, I like your videos! Though as haarpmon mentioned, there's the problem with the nearest savepoint. I did something similar, except:
- I put the player x,y coordinates in a variable at every step, but only when it is grounded (and only on non destroyable objects like falling floors, yes I run into that problem :D), and move those coordinates back a bit on x axis depending on image_xscale, and a bit up in y.
- when the character dies, it creates a spawn point at the mentioned coordinates, and creates the player object at those coordinates (or moves the player object there if it is not destroyed)
this way, whenever the player falls or jumps to death, it's back on the last safe point
I still had to include an object which I scale at whatever size I need, and it stops updating the coordinates if the player is inside that object. So death in that object means the safe point is outside, where the player entered in it. Also, a little bit of not getting any inputs, so the player not fall again when put back to last safe point can help... don't remember what exactly I did with it, I just remember it worked nicely when I tested. :)
Ah so you did something flexible like save those coordinates in an array? Like saving/resetting those at an interval constanly and the resetting it. Neat way, the nearest is to be honest not bullet proof but an "okay" quick and dirty apporach.
No need for array, as the last safe point is always one x,y coordinate, and it's dynamic (refreshed in player's step event), "moves" around as the player does. I absolutely understand this kinda approach, it is still very good, but you know how it is: if you need something more foolproof, then you just have to type in those extra lines. :D And this system took me a couple of days to come up with, write and test as I am not a programmer.
thanks for the video man, you help me so much
Ya welcome mate!
The problem is if you die and are closest to a checkpoint you haven't reached yet you will be teleported to that checkpoint as you can see in 4:35. You probably need to add a way to activate a checkpoint first.
Sure you can customize that to your liking, so that they have an "active" state or you save the id of the activated save spot in the player and then teleport to that one. Or when you really want to punish the player you do those save spots very sparingly.
@@1upIndie hello, i have the same Problem and i dont know how to activate a checkpoint, maybe becouse i dont know a lot of commands.
@@painfactory548 Well, if you want to have activation then proximity, then you can give all savesports a variable, dunno call it "active", set it on start as false and once you clip into one reset all savepoints active variable to false and set the one that you collided/clipped in as true. So when you fall into the lava or whatever harzard you have to check with a "with" statement if this one is "active == true", if yes, teleport there. Hope that helps.
If not, try my discord "help" section, there you may find some friendly helping hands.
thats good, but how do i make save spots only work if the player has already reached them?
You could do the same system as here but have an "instance_activate" script running so that you enable these spots on the run and deactivate them all once at start.
Is it possible to add some death transition when the player touched the area?
Sure, you can add anthing you like in there. This video is just a basic way how to do it, so how you advance this is totally up to your inspiration.
when my player touches the death pit it just gets stuck and cant move im not sure what the reason for this is
Not sure how I can help you out here. I guess the "teleport to" x,y values are not correct.
It worked the first time but it suddenly stopped and didnt work even after I make it again
Hm, no idea how I can help you out to be honest... If you got issues with GameMaker or code try out help sections in my or the offical GameMaker discord channel. Cheers
@1upIndie dw I remade my game then it worked it must be a problem in my own code thx anyways!
U earned a sub
Woah those platforms are awesome! Have you made a moving platforms video?!
Eh, not really. What you saw is the platformer engine by Tupek. That is the guy who made Cave Blazers, so that is his engine but at an very slim prototype stage.
I could make an video about that, but then I would need to make an complete sidescroller tutorial series how to get there. So here, not sure if anybody wants to watch those lengthy vids. But maybe I can make a quickfix here too.
Ha! Dude I would totally watch it lol. I’ve had some trouble with managing the momentum change on moving platformers
Been seeing a lot of discussion on this engine. Wonder if anyone has tried it. yaru.itch.io/mariaengine
simples e funcional, parabéns
Obrigado por assistir o vídeo!
You are back!!!
Hey mate, I haven't forgotten about you! By the way nice short videos showing your mini game and the current big project.
@@1upIndie thanks. I open a Patreon
Nice, do you want to have a shoutout (my "time to shill" videos), so people can check out your stuff plus your patreon??
If yes, can you send a some graphics or something that I can use in the youtube video thumbnail?
@@1upIndie
Oh that would be great mate. What do you need? png, gifs or video?
@@valeriathepaganpriestess7050 It doesnt really matter, nothing fancy. So a png would be nice to the youtube thumbnail. The rest I will show in my video. So your youtube channel, the cool stuff you do there your game and well your patreon page. Please send me that stuff on discord plus the link to your patreon page.
I did this exact thing word for word and it didnt work.
Hm, hard to help you out there. I have a help section on my discord, so that may do some good.