What rules for tapping button to shoot versus holding down?

butterbeanbutterbean Member Posts: 4,315
edited November -1 in Working with GS (Mac)
What rule could you put in to make someone shoot tapping the button versus having to hold it down? But at a steady pace, not too fast?

Thanks, appreciate the advice

Comments

  • firemaplegamesfiremaplegames Member Posts: 3,211
    you could do it like this:

    create a global boolean attribute called OKToFire or something like that, set it initally to true.

    Rule
    When Mouse is DOWN
    When OKToFire = TRUE
    Change Attribute: OKToFire = FALSE
    Fire A Bullet

    Rule
    When Mouse is UP
    Timer
    After 0.1 seconds
    Change Attribute OKToFire = TRUE

    The timer delay would control the ability to fire...
  • butterbeanbutterbean Member Posts: 4,315
    I have all those rules within my Ship, but it's the timer of the bullet I'm confused with

    When firing a bullet, would I do

    Rule: After 0.1 seconds

    Spawn Bullet, how would you tweak the timer so when you tap the button, it just shoots?

    Or Could I just do without a timer?

    I'll experiment with it :)
  • butterbeanbutterbean Member Posts: 4,315
    Just removed the timer, and now works perfect, thanks Firemaple!
Sign In or Register to comment.