How to check the duration in seconds of my actor colliding with a ground actor?
Hi all
When an actor jumps on a ground actor,
if the actor is on that ground actor for 3 seconds, i want to change the image of that background actor.
currently what i have is, when actor collides with ground,
timer- after 3 seconds
change attribute self.image to mychangedimage.png
but what happens is, if i touch the ground, it carries on after 3 seconds and changes the image..
How would i achieve this?
also why doesnt the following work
change attribute self.visible to false
but this doesnt work?
thanks
When an actor jumps on a ground actor,
if the actor is on that ground actor for 3 seconds, i want to change the image of that background actor.
currently what i have is, when actor collides with ground,
timer- after 3 seconds
change attribute self.image to mychangedimage.png
but what happens is, if i touch the ground, it carries on after 3 seconds and changes the image..
How would i achieve this?
also why doesnt the following work
change attribute self.visible to false
but this doesnt work?
thanks
Comments
As for changing self.visible, you can't; this is one of those attributes that you choose its state before gameplay (like Moveable) which can't be changed with an attribute. Use change attribute self.Color.Alpha to 0 as a suggestion.
----------------------------------------------
http://davidgriffinapps.co.uk/
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
thanks
When YourActor overlaps or collides with YourGroundActor
Timer After 3 seconds
Change Image
...but I get the idea you've tried that and it's not working?
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Link: http://www.mediafire.com/?3jaqzc8nmey4xyx
(use the up and down arrows to move the actor up and down - when he stays on the floor for 3 or more seconds he turns red)
If you have run to completion checked, even if your not touching the ground for the full 3 seconds, 3 seconds after the first touch it will change, so make sure its not checked
Whoops! Yep, that's a much better way of doing it (and much less stupid than my way \m/ ) ignore my post !!
Leave your timer as an 'after' timer and make sure run to completion is unchecked.