Object States | Game Maker Studio 2

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ต.ค. 2024

ความคิดเห็น • 268

  • @4thepulsex
    @4thepulsex หลายเดือนก่อน +2

    6 years later and still assisting people in game maker. Thanks!

  • @uheartbeast
    @uheartbeast 7 ปีที่แล้ว +297

    Perfect!

    • @brycea5452
      @brycea5452 6 ปีที่แล้ว +27

      What the fuck? He's perfectly entitled to charge for his course. He worked hard on it, how he earns his living. Also, which of his courses is $100? I can't stand people like you.

    • @datawesomegamer4382
      @datawesomegamer4382 6 ปีที่แล้ว +17

      Umm, people make games for money? I don't get why you complain, he teaches us really amazing stuff and puts prices on some courses so he can stay at it giving us free courses...

    • @Ninololcss
      @Ninololcss 6 ปีที่แล้ว +4

      Bro, its a 9.99 dollar course, go to google, write "udemy 90% off cupon" and you get it at that price, if you didnt know, thats a selling strategy Udemy uses to sell high numbers in low prices, not like other courses that are 25$. Also, HeartBeast Course has high quality content made by him at a 100% with his own way of coding following the GML rules and sprites that he also made and didnt take from free resources banks. Another extra big things about the course, are: Certificate of Udemy (really helpful for our portfolio), Help from Ben Tristem and his dedicated admins that respond any question of any kind, a high quality and very accesable Forum, a Marking system to study better, High quality Servers to load the videos REALLY fast (amazingly fast even with a poor own internet connection), Download capability for Smartphones and at last, a powerful community that has a powerful system to answer new devs questions with pictures and examples and even code.
      Now, you dont have that in youtube, so those 9.99 are acutally worth for a complete course with that quality and friendly interface to study. Also, Udemy is respected by many tech companies, completing courses there gives you and advantage against others and if you just want to be an Indie Dev, it also serves as a "I am no bullshit, i did this on my own and i can proof it" statement on yourself so you can get teammates that know you are not useless.

    • @isaacgm_7527
      @isaacgm_7527 6 ปีที่แล้ว

      His channel has tons of great tutorial videos for free. His paid courses are optional and cover the same things he covers on YT. They're just for people who appreciate his work and want to support him. Maybe look a little closer next time before you hate on someone.

    • @fluury
      @fluury 4 ปีที่แล้ว +16

      looking at this comment chain after 1 year and having the other dude delete his shit makes this look very strange ngl

  • @spaghettimeatballs8856
    @spaghettimeatballs8856 6 ปีที่แล้ว +106

    I've watched many GM tutorial videos and these are definitely my favorite. The way that you visualize the code you're explaining and break it down into comprehensive steps is so incredibly helpful and I think a lot of people who do these videos could learn a lot from your process. I don't feel as though I'm just copying code over and over until I gradually come to understand it, I feel as though I can use what I've learned in your videos and apply it elsewhere. I love Heartbeast and Shaun Spalding and I've learned a lot from both of them, but your videos go above and beyond. Thank you so much for providing these for free.

  • @keithjones7754
    @keithjones7754 หลายเดือนก่อน

    Just found this video after struggling for weeks to understand states.
    This is the best explanation out there.
    Thank you so much!!

  • @FriendlyCosmonaut
    @FriendlyCosmonaut  7 ปีที่แล้ว +63

    To skip the section where I explain the behaviour code for the states (starts at 9:48) if you're mostly just interested in the concepts, head over to 17:27.
    Also, there's been some interesting discussion about switch statements vs if/else if statements. To be clear, switch statements will be much faster than a chain of if/else ifs. So all else being equal, if you're comfortable with switch statements, opt for those. That said, if you're more comfortable with if/else ifs, then stick with those until you have more experience. They're a very intuitive concept which is why I opted to continue using them in the video, over switch statements that can be a tad more abstract. But once you understand switch statements, you'll see it's super easy to convert if/else if chains like ours to a switch.

    • @x8squish8x16
      @x8squish8x16 6 ปีที่แล้ว +3

      PS. I would definitely support you on patron but I'm to young.

    • @onionike4198
      @onionike4198 6 ปีที่แล้ว +1

      You could also use a variable called state which stores the index of a script and change the script as needed. Do you know of any downsides to using the method I mentioned? It works great in c++ and seems to work petty well in gml too, but maybe I'm not aware of some quirk in gml?

    • @d.h.k.c8113
      @d.h.k.c8113 5 ปีที่แล้ว +3

      why would anyone skip the construction of a multi-state enemy with a system that could easily be worked into a stealth system? that's worth the price of admission alone.

  • @kwylde
    @kwylde 3 ปีที่แล้ว +1

    Your explanations are so clear and easy to understand! Easily one of the top GM tutorial makers on TH-cam. Thank you so much! I learned a lot from this vid.

  • @darkmatter7241
    @darkmatter7241 7 ปีที่แล้ว +3

    I'm going to have to watch this 50 times, there's so much great here. This is the kind of stuff that takes a project from demo to game.

  • @realistindenial
    @realistindenial 4 ปีที่แล้ว +2

    I've been working with GMS for about seven years and have employed a variety of ways to maintain states, but for my newest project I'm using the method described in this video. I love the standardize and organizational structure of using enumerators, arrays and scripts. This makes so much sense because once you have finalized a piece of code, you don't ever have to look at it again. I love looking in my STEP event and seeing only one line of code!

  • @mallen1846
    @mallen1846 6 ปีที่แล้ว +2

    Very clearly explained and I love the clean, manageable code separation. Keep up the great work, your GMS2 tutorials are some of the finest quality tutorials out there.

  • @distantforest2481
    @distantforest2481 4 ปีที่แล้ว +1

    Usually I dont like a video, but multiple times through this video I felt like I needed to like a few times because of the indepth and well thought out concepts discussed.

  • @audiomuse
    @audiomuse 6 ปีที่แล้ว +9

    Both the solution and the presentation of the video are very elegantly designed. I especially like how you switch between the visuals to the code just at the right time to help the viewer understand the relationship of what’s happening on the screen and how to write the code. I just started with the Game Maker trial and am feeling pretty confident now, thanks!

  • @JETwardCentrella
    @JETwardCentrella 7 ปีที่แล้ว

    There are ten million and one Game Maker tutorials on the internet, and 99.9% of them are just OK or worse. You are the single best tutorial teacher I've found so far! You make sure to explain each step in the right amount of detail and it's incredibly helpful. Thanks for helping me learn Game Maker!

  • @jashum8554
    @jashum8554 6 ปีที่แล้ว +3

    This is an absolutely great tutorial! That what really shows how good this video is, is that I didn't want to do anything like an enemy logic. The thing I was looking for was how to make my player character simply switch from walking to idle animation and I was keepable of doing that thanx to information about states from this tutorial!
    Thanx a lot!

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  6 ปีที่แล้ว +1

      That's great to hear! I'm glad you found the tutorial helpful and adapted it to your needs :)

  • @Niemelan1106
    @Niemelan1106 2 ปีที่แล้ว +1

    Definitely the most underrated channel I've come accross while coding with GM. You've helped me so much with beginning to code in GM, and have helped me progress. I've been watching the entire farming simulator tutorial for all my interactions and movements and I must say, the amount of detail and compassion you have in the work you do is beyond amazing. keep up the great work!

  • @LeigerGaming
    @LeigerGaming 4 ปีที่แล้ว +3

    I'm fairly confident with most of this and was just sitting here enjoying the video & the excellent presentation.
    Then you went and did this: script_execute(states_array[state]);
    Mind blown. So simple! :D

  • @sneezingpanda4841
    @sneezingpanda4841 6 ปีที่แล้ว +17

    you're very good at explaining things in a logical and sensible way, really great job

  • @WittAllen
    @WittAllen 3 หลายเดือนก่อน

    Fantastic video! Everything else I watched on state machines were too high-level to be helpful or dove right into the code without connecting it back to the rest of Game Maker. Your video hit the nail on the head; I feel totally equipped to start implementing this now.

  • @TheRealZen00
    @TheRealZen00 7 ปีที่แล้ว +1

    I have to say, the end portion where you compress all the step code into one line is a very effective visual of the power of states.

  • @Baleur
    @Baleur 4 ปีที่แล้ว +4

    Your code is so clean and simple i love this

  • @Shrooblord
    @Shrooblord 3 ปีที่แล้ว

    That's a sub if ever I saw one. Clear, concise, well elaborated where necessary. Visualisations are key to promote clear understanding. Good structure from high level overview into the details. Wish all tutors followed this procedure. ;)

  • @HakanBacon
    @HakanBacon หลายเดือนก่อน

    I'm currently working on a bigger project in GoDot and this really helped me organize some things in my code.
    Thank you for making this video!

  • @keryx1401
    @keryx1401 5 ปีที่แล้ว +1

    the best explanation of the finite state machine

  • @gamermasta525
    @gamermasta525 2 ปีที่แล้ว

    Thank you! Thank you! Thank you!. Not only is your tutorial better than Sean Spalding's tutorial it taught me more than what I came here for. Out of 6 different tutorials your's was the best!

  • @FeniksGaming
    @FeniksGaming 7 ปีที่แล้ว +19

    As always great work, I love the ranges and use of visual aids. I knew concept of states already but I think this video was one that makes it much clearer.

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  7 ปีที่แล้ว +1

      Lovely - thanks for the feedback Feniks :)

  • @samsibbens8164
    @samsibbens8164 6 ปีที่แล้ว +2

    This is one of the highest quality video tutorial I've ever seen.

  • @ryanfuller1512
    @ryanfuller1512 3 ปีที่แล้ว

    Your tutorials are awesome. You explain things so well and clearly. Some of the best I’ve found for sure. And your accent is so pleasant and lovely to hear.

  • @IshiGray
    @IshiGray 7 ปีที่แล้ว +2

    Great video! Learned a few things I wasnt sure was useful to me yet. I morely love the fact you added #region. That helped with keeping things clean looking.

  • @pkattk
    @pkattk 6 ปีที่แล้ว +1

    This is an awesome video. The way you go over concepts in the abstract is something a lot of other tutorial makers don't do. Nice job!

  • @GuiveChafai
    @GuiveChafai 6 ปีที่แล้ว +1

    One of the best gamemaker tutorials around !

  • @robinsommer
    @robinsommer 7 ปีที่แล้ว

    This was exactly the answer to what I was searching for the last couple of days! Now I can continue with my new game project :D Very clear and helpful. I love how you quickly showed some snippets of the alternative ways how you can build upon this foundation. Thanks as always!

  • @prespickle9260
    @prespickle9260 7 ปีที่แล้ว +1

    Great video and great style! Can't wait to see what great heights your channel will reach!

  • @FilmonGEMZ
    @FilmonGEMZ 7 ปีที่แล้ว +11

    Wow!!! This is my first time watching one of your videos and I have to say the quality of the content and the way you take the listener through the knowledge material is extra ordinary.
    I was looking for a patreon link to support because the content was soooo good!
    You have to keep this up!
    Let us know how we can support!

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  7 ปีที่แล้ว +7

      Hey - thanks so much!! I'm really flattered. I definitely plan on continuing to make videos; I'm really enjoying it!
      I do have a patreon set up at www.patreon.com/friendlycosmonaut. But don't feel obligated; kind comments like yours give me lots of support too :)!

  • @MadpolygonDEV
    @MadpolygonDEV 6 ปีที่แล้ว +1

    one of the best game maker learning resource channel.

  • @squali1930
    @squali1930 4 ปีที่แล้ว

    Wow this video was great, I loved how the way you edited it made what you were explaining clearer to understand as well. Thank you.

  • @SpiritVector
    @SpiritVector หลายเดือนก่อน

    I only watched this because I was bored, you're basically just doing it the right way which is great.

  • @MattNicassio
    @MattNicassio 8 หลายเดือนก่อน

    It looks like you haven't made content in a couple of years. Just wanted to say you have an excellent delivery, it is easy to watch, just the right amount of entertaining and educational, well thought out, and flows very well. This video was great. It takes concepts from my "Game Programming Patterns" book and gives clear examples in an easy to watch format. I appreciate all of your hard work. I'll be looking through other videos that you've made. Hopefully you come back to it one day! And it makes you a ton of money :)

  • @ThomasJongens
    @ThomasJongens 6 ปีที่แล้ว +1

    This has been awesome! I tuned in to found out more about animations between states, but i picked up so much more, great stuff

  • @CG573
    @CG573 5 ปีที่แล้ว +1

    So... yes...
    I knew about states but this was one of the best ways that I have seen to accomplish it! Thank you!

  • @amorak223
    @amorak223 ปีที่แล้ว

    These videos are awesome, honestly the best game dev videos I have found, thanks so much for making them.

  • @ouijinn
    @ouijinn 3 ปีที่แล้ว

    The most incredible explanation I've found thus far. Thank you for this video and your wonderful teaching skills.

  • @johnnewton7401
    @johnnewton7401 5 ปีที่แล้ว +1

    Awesome video! I used it to create my first boss fight with different states today :)

  • @akacaleb
    @akacaleb 4 ปีที่แล้ว

    Your explanation of these concepts is top tier. Thank you!

  • @nyume815
    @nyume815 5 ปีที่แล้ว +1

    I loved the video. The other videos i have seen talking about state machines in game maker are just uhmm..... do this and that, but they don't explain how and why, so i thank you!

  • @DazzlingAction
    @DazzlingAction 3 ปีที่แล้ว +1

    finally something with states that doesn't get overly complex for my pea brain.

  • @ronbriscoe888
    @ronbriscoe888 7 ปีที่แล้ว +20

    Just watched this video and have 1 question or comment. In some of those scripts you put "image_xscale = sign(moveX)". If the selection of direction was exactly 90 or 270 then "sign(moveX)" will return 0 and setting the image_xscale to be 0 doesnt that make the sprite disappear?

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  7 ปีที่แล้ว +35

      Oh dang, you're right! Can't believe I missed that. You probably already know how to fix this -- but for others reading, if our direction is exactly 90 or 270, that means we are going exactly up or down. That means there's NO horizontal component to our movement, so moveX will be 0. This means we're going to end up assigning image_xscale = 0 (in the wander and alert state), which will make the sprite disappear. So what we can do is just *only* change the image_xscale if moveX != 0, like this:
      if(moveX != 0) image_xscale = sign(moveX);
      Great catch Ron.

  • @darkmatter7241
    @darkmatter7241 7 ปีที่แล้ว +2

    Fantastic tutorial on some really awesome stuff. I'm not even close to being able to use this yet, but I will definitely be using this in a bunch of ways.

  • @diverseprogrammer18
    @diverseprogrammer18 5 ปีที่แล้ว +1

    I didn't know enum can be accessed from any objects. That would be very helpful so thanks, FriendlyCosmonaut.

  • @kelteel
    @kelteel 7 ปีที่แล้ว +1

    Thanks for the tutorial and explanation. As a gamemaker noob, i really like these youtube tutorials. And thanks to HeartBeast because his video's made me buy GMStudio 2.

  • @santiagosossa1345
    @santiagosossa1345 7 ปีที่แล้ว +1

    Awesome tutorial, watching this from Colombia, keep it going!!!

  • @AiguretDuren
    @AiguretDuren 3 ปีที่แล้ว

    I love the enum as array index for state technique!

  • @stoozey
    @stoozey 5 ปีที่แล้ว +2

    This has saved me typing so many if statements :) -- Thank you, your video's are always so in-depth and to the point.

  • @81Fredrick
    @81Fredrick หลายเดือนก่อน

    Incredible stuff, really. Thank you for sharing.

  • @ShaneChaffin
    @ShaneChaffin 6 ปีที่แล้ว

    Your tutorials are amazing, and your code is as clean as a magic eraser.

  • @ItzCramer
    @ItzCramer 9 หลายเดือนก่อน

    following the tutorial finally made me understand states, thank you

  • @Eddygeek18
    @Eddygeek18 6 ปีที่แล้ว +5

    Wow i'm amazed how high quality your videos are. Subscribed! I'm moving from Game Maker Studio 1.x to GMS 2 and this #region thing is gonna help out SOO MUCH
    EDIT: Just a heads up sign can also be 0 i'm sure you knew that just forgot. sign(0) will return 0

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  6 ปีที่แล้ว +1

      Yeah I think this came up in another comment, that was an oversight by me! And thanks so much :)

  • @daisukicliff9119
    @daisukicliff9119 5 ปีที่แล้ว +1

    You have the best tutorials! Thank you so much

  • @Arylice
    @Arylice 5 ปีที่แล้ว +1

    Very clear tutorial, I like it a lot!

  • @lucthelazysquid20
    @lucthelazysquid20 6 ปีที่แล้ว +1

    Thank you so much for this video, it's helping me immensely with a game I'm trying to make (where the player object is quite complex). Please keep up the great work you're doing :)

  • @justiceforsethrichwwg1wga160
    @justiceforsethrichwwg1wga160 5 ปีที่แล้ว +1

    You are my new favorite GM teacher! Thank you for what you do! 🙏🏻

  • @Nicoladen1
    @Nicoladen1 4 ปีที่แล้ว

    Programming is so much more fun in theory than it is in practice, but that's just because I'm lazy I suppose. I love thinking about systems and how they would be put together aswell as how to best optimize them for efficiency however when it comes to actually coding any of it I sit infront of my computer as if it was an unfamiliar machine with millions of buttons. Someone help me realize my ideas please lol. It's all so easy in theory but takes so much time in practice that it's quite demotivating for me
    But I'm here to thank you for all the great content! I've been subscribed since day one and can't thank you enough for all the effort you put into educating all of us!

  • @tomitsolov3386
    @tomitsolov3386 2 หลายเดือนก่อน

    best tutorial on GM I have ever seen 👍

  • @sethjackson2010
    @sethjackson2010 4 หลายเดือนก่อน

    I am mindblown. You are an amazing person for this video.

  • @NeverduskX
    @NeverduskX 7 ปีที่แล้ว +2

    I wish I had this tutorial when I was just beginning! I've been using GMS for a while, and I still learned a lot from watching this.

  • @doctorzoidberg3000
    @doctorzoidberg3000 6 ปีที่แล้ว +1

    Best object states tutorial ever. Thank you so much^^

  • @GiZ1987
    @GiZ1987 7 ปีที่แล้ว +2

    One of the best tutorials for GML!

  • @ItsAkile
    @ItsAkile 2 หลายเดือนก่อน

    Very good video, very well at teaching too. hope all is well

  • @Oppurtunafish
    @Oppurtunafish 5 ปีที่แล้ว +1

    Seeing how you set up a control object would have been very helpful

  • @DiasFranciscoA
    @DiasFranciscoA 7 ปีที่แล้ว +1

    Omg !! I already knew this tricks but this is just “Tutorial Done Perfectly” kinda stuff!! ;) keep it up!! And please make a Zelda still game tutorial like this one!! ☺️ ranged attack... bombs... pushing blocks, picking bombs and pots... I also love the artwork you choose 😊 those exclamation points on the enemies do add a lot of feeling to the game!!

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  7 ปีที่แล้ว +1

      Thanks so much! Although I'm working mostly on the Farming RPG I'll be doing a non-farming one every month at least, where I will very likely be going over concepts for games like this. I actually built this as a demo project so I'd have something to use in future videos.
      Yeah the artwork is lovely! Most of it is by the artist Buch (there's a link in the description to their work). Haha the exclamation point is actually one of the only things I drew personally so I'm super glad you singled it out :)

  • @boinky92
    @boinky92 7 ปีที่แล้ว

    you're the best gamemnaker tutorial-ist on youtube in my opinion..

  • @toonbotime
    @toonbotime 5 ปีที่แล้ว +1

    This is an amazing explanation for a novice programmer like myself!!! Please make more

  • @Aesprii
    @Aesprii 7 ปีที่แล้ว +6

    Excellent. Thank you for producing top notch content! 11/10

  • @joshuadavenport9681
    @joshuadavenport9681 6 ปีที่แล้ว

    Wow, great videos! I love the organization and accompanying visuals. Keep up the great work!

  • @gelatinousgames3810
    @gelatinousgames3810 5 ปีที่แล้ว +1

    this is great, and work really well. however im haveing issues with the enemy moveing through walls, both while wandering and while chaseing in the alert. how would i code in collision to these scripts so the enemy doesnt go through other objects. also is the a path finding option so it can calculate how to move through a maze to chase players.

  • @funkyb6598
    @funkyb6598 6 ปีที่แล้ว +1

    Great tutorial, thumbs up and subbed.
    Edit: question answered.
    By the way, I love how organized you are. I'm taking notes : )

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  6 ปีที่แล้ว +3

      Yes! This has actually come up in a previous comment. I hope you don't mind me pasting the exchange:
      R) Just watched this video and have 1 question or comment. In some of those scripts you put "image_xscale = sign(moveX)". If the selection of direction was exactly 90 or 270 then "sign(moveX)" will return 0 and setting the image_xscale to be 0 doesnt that make the sprite disappear?
      Me) Oh dang, you're right! Can't believe I missed that. You probably already know how to fix this -- but for others reading, if our direction is exactly 90 or 270, that means we are going exactly up or down. That means there's NO horizontal component to our movement, so moveX will be 0. This means we're going to end up assigning image_xscale = 0 (in the wander and alert state), which will make the sprite disappear. So what we can do is just only change the image_xscale if moveX != 0, like this:
      if(moveX != 0) image_xscale = sign(moveX);
      Great catch Ron.

  • @digitalswordplay
    @digitalswordplay 4 ปีที่แล้ว

    Hey FC,
    Just a quick question. I’m using you NPC code and some of the strategies outline in this video to switch between states. When I enter into the attack state I thought I could just change my sprite_index to the attacking sprite but it didn’t work. After thinking about it, I think it’s because I override the drawing of the sprite with the draw event. Would it make sense to use a true false switch in my draw event to switch between sprites?

  • @hermangamesandfun3881
    @hermangamesandfun3881 5 ปีที่แล้ว +4

    does someone knows what to put in the obj_slash? because idk what to put and im getting that the my_slash.creator = id is only referenced once pls help

    • @YoSoyEvanz
      @YoSoyEvanz 4 ปีที่แล้ว +1

      I just figured out that my_slash variable on the player was not reseting to NOONE by itself, so in the attack_script i just put an alarm[0] = 30 reference to the slash variable that reseted it to NOONE with just my_attack = noone;
      So u only need to create that alarm on your player, and then setting this alarm in the attack script yayyyy

  • @spiralcraft8957
    @spiralcraft8957 6 ปีที่แล้ว +1

    really glad youtube recommended you to me

  • @juanpabon4254
    @juanpabon4254 4 ปีที่แล้ว

    I don't speak English, but I love and translate your videos. Continue with Game Maker, the market gained momentum again.

  • @Plaguebaboon
    @Plaguebaboon 5 ปีที่แล้ว +1

    Do you host these projects anywhere? It'd be super helpful to be able to look at them and follow along with the videos

  • @dragooner025-gamemakertuto5
    @dragooner025-gamemakertuto5 7 ปีที่แล้ว +2

    This was a really well explained Video! Great Job! Thank you! :) Keep up the good work!

  • @AymenZero
    @AymenZero 2 ปีที่แล้ว

    there are multiple ways to code in states. either making a different object for each state and make the object change. or make a variable that defines the states in a big switch statement.

  • @ulone5656
    @ulone5656 6 ปีที่แล้ว +1

    Your videos help me a ton, thank you 🙏🙏

  • @winhtetlu4069
    @winhtetlu4069 6 ปีที่แล้ว +1

    That helps me understand a lot.

  • @lukepena366
    @lukepena366 5 ปีที่แล้ว

    Holy shit, I've been using Game Maker for so long and there were so many little things I didn't know that make a HUGE difference that I found in this video. Obvious stuff like #region or sign(). I've been using work arounds for those for a looooong time. Oh my god.

  • @chadcoyle
    @chadcoyle 7 ปีที่แล้ว +1

    What a perfect tutorial. Thank you!

  • @un-genius9753
    @un-genius9753 5 ปีที่แล้ว +1

    is it possible to download the project?
    I'm just having trouble with the detection radius and movement. The enemy can detect me from across the map but won't move or attack.

  • @Eddygeek18
    @Eddygeek18 6 ปีที่แล้ว

    Different way to make sure you don't have more than 1 instance of slash. I usually go with if !instance_exists(slash){} just to save dealing with more variables in my programming. Is there any advantage by doing it with your method?

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  6 ปีที่แล้ว

      I think in that project I was using the same object for all my instances that created slashes - so if multiple enemies wanted to create slashes but one already existed, they wouldn't be able to (if they were just checking if !instance_exists(slash)). Having their own "slash" object variable to check just means they can all have their own objects :)

  • @123liveo
    @123liveo 5 ปีที่แล้ว

    Excellent tutorial. Many nice little ideas in there. Thanks v much!!!

  • @migi188
    @migi188 4 ปีที่แล้ว

    I am so thankful for this video

  • @MasEL_Gaming
    @MasEL_Gaming 6 ปีที่แล้ว +1

    Hi Cosmo, I wonder... where did you put the Enum statement (19:35), did I miss something... ?

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  6 ปีที่แล้ว +1

      Hmm, I think at 8:26 I show that I have put the enum in.

  • @TheJacksonblair
    @TheJacksonblair 6 ปีที่แล้ว

    Thanks this video introduced some really helpful concepts!

  • @hermiatian5336
    @hermiatian5336 4 ปีที่แล้ว +1

    So how to draw that Exclamation mark? I tried many times but the enemy always disappear.

  • @ceric5837
    @ceric5837 7 ปีที่แล้ว

    Great video (and channel). Quick question about using Step vs. Collision events. You generally put your collision code into objects' Step events rather than use a separate Collision event. Any reason for that? I'm honestly not sure whether putting Collision code in a Collision event would provide better performance than putting it in a Step event. I haven't tested both use cases but was curious whether you had done so. Anyway, again, awesome channel, very clear (and clean) code, and great explanations for everything. Keep up the great work!

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  6 ปีที่แล้ว

      Sorry I was just scrolling through some of my videos and saw this didn't have a reply (though I swear I remember seeing and responding to your question). My apologies if I haven't all this time!! But I'm using the step event as there are actually a number of different collision functions you can use - place_meeting, instance_place, as well as collision_rectangle etc. These allow you to do different things - place_meeting only checks if there is a collision at a certain point, and returns true or false, while instance_place returns the actual id of the object you collide with (but it's a bit slower than place_meeting). You might need different collision functions for different mechanics.
      The collision event is actually just the equivalent of the place_meeting function. So by putting it in the step event, we have more control over the functions we're using. Also, it can be helpful to consolidate your code into one code block (though on the other hand, separating it can be handy too!).

  • @antpol2001
    @antpol2001 4 หลายเดือนก่อน

    Amazing tutorial! Thank you!

  • @UltraHealthyVideoGameNerd
    @UltraHealthyVideoGameNerd 3 ปีที่แล้ว

    Good god this is easy to understand!

  • @ameteuraspirant
    @ameteuraspirant 6 ปีที่แล้ว

    wow I wasn't even confused once. that's a sub for me.

  • @aidenmartinez8149
    @aidenmartinez8149 5 ปีที่แล้ว +1

    Wow you make everything so understandable :D

  • @talentacquisition1746
    @talentacquisition1746 4 ปีที่แล้ว

    Where does the enum {} go? at 19:40 we flash back to the create event and there are no enums like there were, is this another script?

  • @PeXi81
    @PeXi81 2 ปีที่แล้ว

    Very nice tutorial and works! But when my enemy slashes me...obj_slash stays in room and did not delete itself. So what should I put in obj_slashes event? And where to put that my_slash.creator = id? Otherwise great tutorial.

  • @TheRealZen00
    @TheRealZen00 7 ปีที่แล้ว +1

    Forgetting the break is the bane of my switch statements. :p