GameMaker How To Fire or Shoot Toward the Mouse

Поділитися
Вставка
  • Опубліковано 4 сер 2024
  • GameMaker tutorial / lesson that shows how to make the player fire toward the mouse location. 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!

КОМЕНТАРІ • 25

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

    I really like watching your videos, you get to the point of the video fast enough, unlike freaking everyone else. You also point out what would do the job best for us. You should be paid, but I'm too lazy to watch ads over and over again.

  • @sirpaeur
    @sirpaeur 3 роки тому +5

    abc=instance_create(x,y,o_arrow)
    abc.speed=10
    abc.direction= point_direction(x,y,mouse_x, mouse_y) + irandom_range(-3,3)
    abc.image_angle=abc.direction

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

    This tutorial allowed me to make a frustrating shooter. Thanks!

  • @Greeninja
    @Greeninja 5 років тому +1

    Thank you so much!!! This helped me create my first boss battle!!!

  • @Ryan-ju3fl
    @Ryan-ju3fl 3 роки тому

    damn nice tutorial thanks

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

    hey. I need help with my project, I pretty much don't have a clue on how to code, and I want my mouse to be my aim. so where ever the mouse goes the aim bot goes... any tips? My character doesn't need to move, just my gun and my characters arm, its a sideview sort of game.

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

    Whenever I try shooting my bullets, they do shoot at the position my mouse is at right now but they continue to hover over the position of my cursor unless I move my mouse across to the monster it's supposed to destroy.

  • @aiden-nk2zp
    @aiden-nk2zp 7 років тому

    hello when i try to shoot, the bullet popsout of the gun but stand still, where it comes out of the gun what did i do wrong ??

  • @slayervictor
    @slayervictor 7 років тому +2

    It just makes my bullet and it doesn't move :(

  • @curtissanders5498
    @curtissanders5498 9 років тому +1

    how would you make it charge? i want to make it where i have to hold the mouse button for a few seconds and then when it charges i can release it and it shoots a blast. do you think you could help with this??

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

      and also how do i make my game maker look like that?

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

      and also how do i make my game maker look like that?

    • @gamemakergameprogrammingco4786
      @gamemakergameprogrammingco4786  9 років тому +4

      curtis sanders Student asked me the same question the other day, so I made a how to for you. "GameMaker How To Do Charge Up And Fire" in the How To Playlist. Just one way to do it trying to keep things easy enough for beginners.

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

    Why do you write abc before the instance_create?

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

      instance create returns the id number of the instance created. i want to remember this id number (store it in variable abc) so that i can access the newly created instances fields like speed and direction...

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

      Oooh so it creates a variable for that single instance, that refers to only that instance instead of changing the direction of all objects with the same type?

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

      +Mychael Hunt Yes

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

    Hello, added this code to glob left pressed
    if (attacking=false)
    {
    if (Direction="down")
    {
    sprite_index=spr_attack_down
    image_speed=0.4
    image_index=0
    attacking=true
    }
    else
    if (Direction="up")
    {
    sprite_index=spr_attack_up
    image_speed=0.4
    image_index=0
    attacking=true
    }
    else
    if (Direction="left")
    {
    sprite_index=spr_attack_left
    image_speed=0.4
    image_index=0
    attacking=true
    }
    else
    if (Direction="right")
    {
    sprite_index=spr_attack_right
    image_speed=0.4
    image_index=0
    attacking=true
    }
    }
    and nothing happens the sprite does not change I am not sure why could you help me understand why?

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

      why not print this out the value of attack and Direction variables as the first line to make sure your values are what you expect them to be (or learn to use debugger to watch variables).

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

      True I will try that. I just got frustrated because it should work or I think it should.

  • @justinhong709
    @justinhong709 7 років тому +2

    It continues to move with my mouse

    • @Greeninja
      @Greeninja 5 років тому

      Is it in a step event? That might be the problem

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

    My arrows just spawned at the same position as my player but didn't move