Android shoot button

Discussion in 'Programming' started by sara_sara, Apr 14, 2019.

  1. sara_sara

    sara_sara Member

    Joined:
    Feb 17, 2018
    Posts:
    22
    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 :(:(:(:(:(:(
    [​IMG]
     
  2. TsukaYuriko

    TsukaYuriko Q&A Spawn Camper Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    1,139
    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.
     
    sara_sara and Binsk like this.
  3. Edwin

    Edwin Member

    Joined:
    Jul 15, 2018
    Posts:
    337
    What is Shooter button?
     
    sara_sara likes this.
  4. sara_sara

    sara_sara Member

    Joined:
    Feb 17, 2018
    Posts:
    22
    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::(
     
  5. Edwin

    Edwin Member

    Joined:
    Jul 15, 2018
    Posts:
    337
    You mean hyperlink to open the website in the browser after pressing it?
     
    sara_sara likes this.
  6. nlolotte

    nlolotte Member

    Joined:
    Aug 3, 2016
    Posts:
    455
    Keyboard press/ held event or code
    Code:
    If keyboard_check_pressed(vk_space){
    Show_debug_message(“this is a shooter button”)
    }
     
    sara_sara likes this.
  7. sara_sara

    sara_sara Member

    Joined:
    Feb 17, 2018
    Posts:
    22
    no , i want just shoot player to target like that video i posted as link
     
  8. Edwin

    Edwin Member

    Joined:
    Jul 15, 2018
    Posts:
    337
    Uh. Just follow the tutorial until Heartbeast tell you how to make it. And, by the way, what is YoYoGame Platform? You mean HTML5?
     
    sara_sara likes this.
  9. Edwin

    Edwin Member

    Joined:
    Jul 15, 2018
    Posts:
    337
  10. sara_sara

    sara_sara Member

    Joined:
    Feb 17, 2018
    Posts:
    22
    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]
     
  11. nlolotte

    nlolotte Member

    Joined:
    Aug 3, 2016
    Posts:
    455
    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.
     
    sara_sara likes this.
  12. sara_sara

    sara_sara Member

    Joined:
    Feb 17, 2018
    Posts:
    22

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

    sara_sara Member

    Joined:
    Feb 17, 2018
    Posts:
    22
  14. nlolotte

    nlolotte Member

    Joined:
    Aug 3, 2016
    Posts:
    455
    I’m on my mobile, do you mean a gun?
     
  15. sara_sara

    sara_sara Member

    Joined:
    Feb 17, 2018
    Posts:
    22
    yeah gun and shoot i will add to that game project
     
  16. nlolotte

    nlolotte Member

    Joined:
    Aug 3, 2016
    Posts:
    455
    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
     
  17. sara_sara

    sara_sara Member

    Joined:
    Feb 17, 2018
    Posts:
    22
    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:
    [​IMG]
     
  18. Edwin

    Edwin Member

    Joined:
    Jul 15, 2018
    Posts:
    337
    I don't understand your English.
     
    nlolotte likes this.
  19. TsukaYuriko

    TsukaYuriko Q&A Spawn Camper Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    1,139
    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.
     
  20. sara_sara

    sara_sara Member

    Joined:
    Feb 17, 2018
    Posts:
    22
    I want to add a button for that project to shoot and resize the movement button
     
  21. Edwin

    Edwin Member

    Joined:
    Jul 15, 2018
    Posts:
    337
    Button?! WUT
     
    sara_sara likes this.
  22. nlolotte

    nlolotte Member

    Joined:
    Aug 3, 2016
    Posts:
    455
    Do you mean touch controls?
     
    TsukaYuriko and sara_sara like this.
  23. sara_sara

    sara_sara Member

    Joined:
    Feb 17, 2018
    Posts:
    22
    Yeahhh ❤
     
  24. sara_sara

    sara_sara Member

    Joined:
    Feb 17, 2018
    Posts:
    22

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice