ducking???
Hipster_Owl_Studios
Member, PRO Posts: 214
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!
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
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.
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