Freezing the actor
CaptainX
Member Posts: 14
Hello,
I would like to freeze my actor movement when he get hit for 1 sec.
Ex; I got hit and I can't move the character for 1 sec. How can I do this?
thank you
I would like to freeze my actor movement when he get hit for 1 sec.
Ex; I got hit and I can't move the character for 1 sec. How can I do this?
thank you
Comments
Create new actor integer attribute (in your main actor), called 'frozen'
if actor collides with object, have timer for 1 second that makes frozen active.
Add rules to your actors movement rules (e.g. move to touch, move right when right key pressed).
Make it so the movement rules need the 'frozen' attribute to be not active....
See if you can work with that...if not I'll quickly check and right a proper how to...
thank you
I'll make it so the main actor moves left and right with the left and right keys.
If it hits a wall, stop those buttons working for 1 second.
cool?
In the mean time....here's a link to a zip file with the project file...
http://stormystudio.com/freeze.zip
Hope you can work it out from that.
(I added the integer attribute 'freeze' to the main actor. There is a timer which says if collide with object, change freeze to 1 for 1 second, and another timer after 1 second make freeze = 0.
Put the constrain actors position inside a rule, so it only works if 'frozen' = 0
Let me know how it goes...
(You said your actor only moves up and down, so you can ignore the constrain actors X position to touch x position and just use the Y).
thanks