ducking???

Hipster_Owl_StudiosHipster_Owl_Studios Member, PRO Posts: 214
edited November -1 in Working with GS (Mac)
hey can anyone tell me how to make my actor duck? i looked at some examples and i cant get it to work properly once i press the arrow key down he jst ducks and falls rite throught the ground kinda in a flashing motion and i already have a ground actor set already??

so i was wonderinf if theres another way to make an actor duck? and i also wanted add like an animation of him ducking is that possible and how? thanks!

Comments

  • LordTarantorLordTarantor Member, PRO Posts: 890
    Dont worry edward I was in this same situation a couples of days ago.

    First make sure you put in the ground a collide with actor type (the ducking actor)
    Then make a boolean attribute and call it: ducking
    In the ducking actor create an interger attribute and call it: OriginalHeight (and put a value here taking in consideration that this is the real size of that actor)

    Then in the ducking actor make a Rule (Down)
    when all... actor receives... key: down
    add a change attribute: game.ducking to true
    in otherwise add a change attribute: game.ducking to false

    Then add another Rule (Ducking)
    when all... attribute:game.ducking is true
    change attribute: self.Size.Height to self.OriginalHeight / 2
    change attribute: self.position.Y to self.Position.Y-(self.Size.Height /2)
    in otherwise
    change attribute: self.position.Y to self.Position.Y+(self.Size.Height /2)
    change attribute: self.Size.Height to self.OriginalHeight

    and that helped my situation I hope it help yours.
  • firemaplegamesfiremaplegames Member Posts: 3,211
    I started a series of Platformer Tutorials a few months ago:

    http://gamesalad.com/wiki/how_tos:platformer_tutorials

    Ducking is the third tutorial in the series. Each one is built off of the previous one, but that should help you get going.

    Joe
  • Hipster_Owl_StudiosHipster_Owl_Studios Member, PRO Posts: 214
    THANKS! alot he ducks like a champ now :D
Sign In or Register to comment.