Need help on my new game.

Hi gamesalad communities!
I've been doing some research during these days, but i get stuck on these functions.
I want to make a runner game, there are several buttons on screen that player can click on it, such as jump and shoot.
How do i make the main character detect that the player is click on the shoot button and spawn the bullet? Afterward, how to make the bullet have limit ammo and recharge itself during time? I really hope someone could help, i've been tried several ways that lead me to fail.

Thanks all. :)

Best Answer

Answers

  • GamesforGoodGamesforGood Member Posts: 73
    Hi there,
    Heres what you are going to want to do: create 3 actors name them: bullet, player, and shoot button
    1) add a attribute( click on the plus sign and then select boolean) and name it bullet
    2) return to the actor screen and go into your shoot button actor(create one with the plus button if needed.)
    3) Now once inside the shoot button actor you will need to click on new rule (add rule)
    4) now make sure the rule says when touch is pressed
    5) now click on behaviors and then drag the change attribute into the rule
    6) in the change attribute, behavior click on the typing section, and then select game and then choose the bullet shoot attribute you just made.
    7) then you will select the other box (the one on the right), in the change attribute behavior in your rule, and type true
    8) you will then see a arrow at the bottom of your rule that says OTHERWISE click on this
    9) now hold alt or option on your keyboard and drag your change attribute rule that you just created into this area and then change the TRUE to FALSE
    10) now your rule should read:
    when touch is pressed:
    change attribute game.shoot to true
    OTHERWISE
    change attribute game.shoot to false
    11) now go back to the actor screen and go into the shoot button you created
    12) in the shoot button create a rule and change it to an attribute ( the first drop down menu at the top left of the rule )
    13)change the attribute in the rule to your shoot attribute
    14) now go to the behaviors and drag the spawn actor behavior into the rule.
    15) from the spawn actor behavior in your rule select the bullet actor you created.
    16) finally go into the bullet actor and drag the move behavior into the actor
    17) enter the direction and speed you want the bullet to travel
    18) drag the player and the shoot button onto the screen
    19) have fun!
    If you need any more help or a template to see how to do this, try it first please, then message me.

    GamesforGood

  • greedydadygreedydady Member Posts: 35
    Hello pro member games for good, Thanks for the reply, didn't expect that details, thanks a lot! Really helpful! Thank you!
Sign In or Register to comment.