GameMaker How To Make Object Move Randomly

Поділитися
Вставка
  • Опубліковано 7 гру 2014
  • GameMaker tutorial / lesson that shows how to make objects move randomly throughout the room by turning every once and a while. Check out hundreds of other GameMaker tutorials and lessons at GameProgrammingCourse.com
    All these gamemaker tutorials will work with Gamemaker Studio GMS or Gamemaker Studio 2 GMS.
    Go to the Resource Page of www.gameprogrammingcourse.com to download the Project Files for these tutorials!

КОМЕНТАРІ • 41

  • @AdamBarkerThe
    @AdamBarkerThe 9 днів тому

    Wow this is way easier than I thought it would be lol, thank you!

  • @EnDDarKDoMaiNGAMES
    @EnDDarKDoMaiNGAMES 8 місяців тому

    Still worling in 2023. Thanks.

  • @ignaciosb8779
    @ignaciosb8779 5 років тому +3

    Well. Thanks for this video. It's the first time I see anything about this "alarm function", I'm already developing a game and had no plans to add that but now you made wanna add some elements with that alarm :D

  • @octopussy1771
    @octopussy1771 6 років тому

    thanks man you helped me with this problem i had all day. i did this by myself with the alarm system and this video showed me to make sure i reset the alarm system to play another 2 seconds so the action repeats after it has taken place! thanks babY!

  • @sahlikh1829
    @sahlikh1829 6 років тому +3

    1st of all : the quality of the video is awsome
    2end of all : the video is so usefull

  • @toxicredox758
    @toxicredox758 7 років тому

    THX SO MUCH THIS VIDEO AND THE RANDOMLY MOVE TOWARDS THAT PLAYER VIDEO HELPED OUT SO MUCH!!!!! :D

  • @jvgames_br3938
    @jvgames_br3938 3 роки тому

    thank you so MUCH

  • @Gaming_Dive
    @Gaming_Dive 2 роки тому

    yes this is what I wanted!

  • @hornybastard1839
    @hornybastard1839 6 років тому

    Thank you. This was more simple than using paths in my game. There's just a pause in the first seconds of launching the game before it actually does move randomly, any way to fix that?

    • @gamemakergameprogrammingco4786
      @gamemakergameprogrammingco4786  6 років тому

      You could place similar code in the CREATE event of the object to get it moving randomly right from the start.

  • @crescentblue2184
    @crescentblue2184 6 років тому

    hey...can i get some little info? i am making pacman in c++ using Winbgim... how can i create the ghost so that it will chase the player? can you help me out with the functions or ai i need?

    • @gamemakergameprogrammingco4786
      @gamemakergameprogrammingco4786  6 років тому

      i know this is old now, but for others: check google for a review of pac man ghost logic, you'll see how they code the different ghosts. Also, a bit more difficult (not beginner but intermediate level) you can learn about grids and shortest path solving. Then you can decide whether a ghost should take the shortest or not shortest path to the player or a path that leads to the left, right, up, down side of player. Great algorithms to learn about for gaming.

  • @SBtech_55
    @SBtech_55 8 років тому

    dude thanks i made a game thanks to you!! :)

    • @gamemakergameprogrammingco4786
      @gamemakergameprogrammingco4786  8 років тому

      +Omar And Leo Animations Good to hear. If you haven't, go through the entire course and start another one!

    • @SBtech_55
      @SBtech_55 8 років тому

      dude can you make a tutorial of how to make a 3d game please??

    • @SBtech_55
      @SBtech_55 8 років тому

      i know that you can make a 3d game right?

    • @gamemakergameprogrammingco4786
      @gamemakergameprogrammingco4786  8 років тому

      +Omar And Leo Animations You can make one, but Gamemaker isn't really that great for 3d. There are lots of tutorials on it so go hunt one down that has lots of thumbs up. It's not part of my class so I won't be making any 3d tutorials. Good luck!

    • @SBtech_55
      @SBtech_55 8 років тому

      but can you please make a tutorial of how to make a game even if its bad please

  • @OrangaTangaBanga
    @OrangaTangaBanga 8 років тому

    How do you make it decide how to pick one of two ways?

    • @DJRASTIQ
      @DJRASTIQ 6 років тому +1

      choose(direction one degree, direction two degree); instead of irandom();

    • @lefourre-toutawill1108
      @lefourre-toutawill1108 5 років тому +1

      and if you are making a top down shooter, you can put this in your step event :
      image_angle = direction;
      that works perfectly :)

  • @sheng8806
    @sheng8806 6 років тому +1

    Please answer as soon as possible, how do I make it so that what ever direction its moving in, it changes its sprite

    • @gamemakergameprogrammingco4786
      @gamemakergameprogrammingco4786  6 років тому +1

      either change the sprite every time you change directions ( sprite_index = sForward )
      or in the step method ask a bunch of if statements that change the sprite depending on the direction
      or if it is just the image angle you need changed then in the step method use image_angle=direction

    • @sheng8806
      @sheng8806 6 років тому

      Im confused, like really confused.

    • @sheng8806
      @sheng8806 6 років тому

      I cant really do that, when ever i try to do it it ends up like this
      if (direction = 0)
      {
      sprite_index = spr_bull_right
      speed = 2;
      }
      if (direction = 90)
      {
      sprite_index = spr_bull_right
      speed = 2;
      }
      if (direction = 180)
      {
      sprite_index = spr_bull_right
      speed = 2;
      }
      if (direction = 270)
      {
      sprite_index = spr_bull_right
      speed = 2;
      }
      and this never works so please help me thanks

    • @gamemakergameprogrammingco4786
      @gamemakergameprogrammingco4786  6 років тому

      if this is in the step then it should work. Do you have other code in the step or keypresses that would be overriding this behavior?

    • @sheng8806
      @sheng8806 6 років тому

      no, I have nothing in the object bull except for the code in this video, so what can I do?

  • @megasmilee1893
    @megasmilee1893 9 років тому +3

    I've made my first game ever ^^

    • @AbdulLegendary
      @AbdulLegendary 8 місяців тому

      Congrats! I wish you luck upon your future projects😄

  • @ThunderHail
    @ThunderHail 7 років тому

    wow this was so easy it makes me feel dumb

  • @dymmo99
    @dymmo99 Рік тому

    That is easy ngl

  • @odix7664
    @odix7664 4 роки тому

    HOW DO YOU MAKE IT BOUNCE BACK AND NOT GO THROUGH A WALL

    • @gamemakergameprogrammingco4786
      @gamemakergameprogrammingco4786  4 роки тому

      Make wall solid. Then in the collision event with wall use move_bounce_all(true)

    • @odix7664
      @odix7664 4 роки тому

      @@gamemakergameprogrammingco4786 where do I write that ""move_bounce_all(true)"" ??

    • @gamemakergameprogrammingco4786
      @gamemakergameprogrammingco4786  4 роки тому

      Whatever moving object, say oBall, in its collision with wall event

  • @Wall0rio
    @Wall0rio Рік тому +1

    You deserve a kiss in your mouth!