GameMaker How To Make Player Move Toward Mouse

Поділитися
Вставка
  • Опубліковано 7 гру 2014
  • GameMaker tutorial / lesson that shows how to make the player or an object move toward the mouse location, and stop when they get there. 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!

КОМЕНТАРІ • 22

  • @iswhatheis
    @iswhatheis 7 місяців тому

    Still relevant to the latest version of Game Maker, and a much simpler way than what's on the forums!

  • @eyelessartist5963
    @eyelessartist5963 7 років тому +1

    omg, I couldn't figure out how to make my character stop spazing. thank you for making this you beautiful human omg this helped me so much

  • @behemoth4791
    @behemoth4791 9 років тому

    This is what I was looking for:))) Thnx for your tutorials!)

  • @arte_di_Tiziano
    @arte_di_Tiziano 9 років тому

    Molto utile GRAZIE !!ottimo tutorial :-))

  • @The242511
    @The242511 8 років тому +7

    what about collisions with the wall? I really need you on this please help me!! How to stop the player when it touch the wall?

    • @gamemakergameprogrammingco4786
      @gamemakergameprogrammingco4786  7 місяців тому

      I know its 7 years late but maybe to help others -
      Search my videos on Path Finding. Gamemake has some built in path finding functions that can solve paths to avoid specified objects.

    • @The242511
      @The242511 7 місяців тому

      ​@@gamemakergameprogrammingco4786 You know what's funny? I've been thinking about GameMaker lately and now I see your comment :D
      Hope you're doing all right.

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

    Can you make one for dnd too

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

    Hey there! Do you have any idea how to left click on a moving object
    (say an enemy) and then have your player move towards it? like diablo
    does for its attacking system. im not to concerned about the attacking
    bit i just need to be able to move to another moving object. ive been
    trying for five days now and i cant figure it out :(
    So far ive managed to get it so if you hold the mouse button down over an object the
    player will move to it, but i want to be able to just click once...here is the code i have so far
    ///Attaking Engine
    if position_meeting(mouse_x, mouse_y, obj_enemy) and
    (mouse_check_button(mb_left)) {
    if point_distance(x, y, obj_enemy.x, obj_enemy.y) > 20
    action_potential_step(obj_enemy.x, obj_enemy.y, 3, 0)}
    else speed = 0;
    if you would like to see the project you can download it off the game maker forums...gamemakersforums.com/threads/moving-an-object-to-another-moving-object.1233/
    Please any help would be great and i would be extreamly grateful. Thanks

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

    I don't know if you still monitor this, but how can I change an object's angle when it goes above and below the x-axis, but then stay at it's normal angle if at 0 on the x-axis?

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

      I'm not sure if you mean y axis (up down above below) . Either way same code.
      if x>0
      image_angle = 10
      else if x

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

      Gamemaker Game Programming Course Thanks, bro! Much appreciated!

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

    i only want my caracther to face left and ight i just need to know where is it 0

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

    hmm, if anyone checks this anymore, what if I want the player to be the mouse when I click on him until I click again?

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

      Basically you are dragging the player around. A few ways to do it. Here's one of my sections on mouse control. You'll see there is a drag and drop lesson in there.
      www.gameprogrammingcourse.com/?p=565