Android shoot button

S

sara_sara

Guest
Hi ,
how i can add shooter Button for YoYo Platform game ( i mean is demo's game in game maker studio 2 )
please help me :(:(:(:(:(:(
 

TsukaYuriko

☄️
Forum Staff
Moderator
Please explain your problem in greater detail, include any code relevant to what you've tried to implement this yourself, explain what you expect it to do and what it does instead so that we can proceed to help you accurately. Your question is too unclear and too broad as of writing.
 
S

sara_sara

Guest
sorry i'm weak in English language ... i mean is about this ... open link , then you know what i my means , i will do that in YoYo Platform game ( i mean is demo's game in game maker studio 2 ) :rolleyes::(
 
N

nlolotte

Guest
Keyboard press/ held event or code
Code:
If keyboard_check_pressed(vk_space){
Show_debug_message(“this is a shooter button”)
}
 
S

sara_sara

Guest
no , i want just shoot player to target like that video i posted as link
 
S

sara_sara

Guest
Uh. Just follow the tutorial until Heartbeast tell you how to make it. And, by the way, what is YoYoGame Platform? You mean HTML5?
YoYo platform game is in demo game's of game maker studio 2
I will add shooter to that game i don't know how i should edit ... and add
Please help me how i can add shooter to player in yoyo platform game [ demo game in game maker studio 2]
 
N

nlolotte

Guest
I watched the video (briefly) and I still don't get what you mean but this is for mouse controls
Code:
if mouse_check_button(mb_left) //If you click the left button
{
    with instance_create_depth(x,y,depth-1,obj_bullet) //Create a bullet where you are
    {
        move_towards_point(mouse_x,mouse_y,5); //Make the bullet travel towards the cursor at a speed of 5.
    }
}
There are other techniques you can apply like image_angle and stuff. Also worth mentioning, this will constantly create a bullet so its probably best to use some sort of check like "can_shoot" and an alarm or something.
 
S

sara_sara

Guest
I watched the video (briefly) and I still don't get what you mean but this is for mouse controls
Code:
if mouse_check_button(mb_left) //If you click the left button
{
    with instance_create_depth(x,y,depth-1,obj_bullet) //Create a bullet where you are
    {
        move_towards_point(mouse_x,mouse_y,5); //Make the bullet travel towards the cursor at a speed of 5.
    }
}
There are other techniques you can apply like image_angle and stuff. Also worth mentioning, this will constantly create a bullet so its probably best to use some sort of check like "can_shoot" and an alarm or something.

thanks but i mean is how i can add shooter to this game ... look this video
 
N

nlolotte

Guest
Create the gun object and in it’s step event write
Code:
x = playerobject.x
y = playerobject.y // put + a number here to adjust height
Then using my code above change it to be created at obj_gun.x and obj_gun.y
 
S

sara_sara

Guest
hiya ... i want add button shooter(bullet) to this project please help me ... n how i can resize buttons ( jump or right left n... others in game . this project

Please Help
:(
:(
:(
:bash:
 

TsukaYuriko

☄️
Forum Staff
Moderator
We see your topic. You do not have to bump it. That is not the problem.

We want to help you. You do not have to ask us to help you. That is not the problem.

We can not understand your problem. You have to explain your problem more clearly. This is the problem.

Until you manage to explain your problem more clearly, we can not help you.
 
S

sara_sara

Guest
I want to add a button for that project to shoot and resize the movement button
 
Top