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!
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.
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
This tutorial allowed me to make a frustrating shooter. Thanks!
Thank you so much!!! This helped me create my first boss battle!!!
damn nice tutorial thanks
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.
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.
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 ??
It just makes my bullet and it doesn't move :(
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??
and also how do i make my game maker look like that?
and also how do i make my game maker look like that?
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.
Why do you write abc before the instance_create?
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...
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?
+Mychael Hunt Yes
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?
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).
True I will try that. I just got frustrated because it should work or I think it should.
It continues to move with my mouse
Is it in a step event? That might be the problem
My arrows just spawned at the same position as my player but didn't move
did you set their speed?
I have this issue too. And the speed is set to 10