Help with 2 problems! "Run," and "Run and Attack conflicts"

ClockClock Member Posts: 308
edited January 2012 in Working with GS (Mac)
What kind of attribute do you use for run for platform? Change Velocity doesn't seem to work when you move and jump at the same time. Same with Move attribute. Accelerate causes actor slide, so i dont want to use it. Linear Velocity X creates problem when u set 200 the actor only run to the width of 200 then slow down and stop. anymore option?

Next problem is how to do when you press Attack and Run at the same time, but when you release Attack the actor keeps moving(holding the Run button)? Basically, when i press Run button the actor runs, and i can also press attack but i want to actor stop moving when i press Attack. When i release attack button the actor move again(holding the Run button all the time).

Comments

  • MotherHooseMotherHoose Member Posts: 2,456
    think you need a boolean attribute named something like Attack
    in attackButton: 
    Rule when mouse/touch is down/pressed
    -- changeAttribute: game.Attack to true

    in Actor:
    Rule: when game.Attack is false
    --Rule: when arrowKey is down
    ---- do the run animation
    Otherwise:
    changeAttribute: self.Image To: attack image (or animation)
    (timer or Rule: when self.image is lastImageInAttackAnimation
    changeAttribute: game.AttackTo: false)
    I didn't have time to √ this … ;)

    MH
  • ClockClock Member Posts: 308
    my biggest problem is the Run part. what do you use for Run and jump?
  • ClockClock Member Posts: 308
    I found out that if i set Accelerate as gravity it will make Linear Velocity X slow down then stop. What else do you guys use for Run and Jump?
Sign In or Register to comment.