toggle menu
Categories
Discussions
Dashboard
Sign In
·
Register
Sign In
·
Register
Categories
Discussions
Dashboard
Sign In
·
Register
×
Home
›
GameSalad 101
›
Working with GS (Mac)
Lose life if actor is standing still!
Mathiashelseth99
Member
Posts:
37
August 2013
in
Working with GS (Mac)
How do you make your actor loose a life if it is like not moving for like 5-7 seconds?
Comments
OskarDeveloper
Member
Posts:
533
August 2013
If self.motionline.x is = 0
timer
after random 5, 7 seconds
change game.hp to game.hp -1
Mathiashelseth99
Member
Posts:
37
August 2013
Thanks
is all the attributes already in the creator?
-Timo-
Member
Posts:
2,313
August 2013
except for the lives (game.hp)
if you're also moving on the y then do
if self.motion.linear velocity.X = 0 and self.motion.linear velocity.Y = 0
do
after random(5,7) seconds
change game.hp to game.hp-1
Mathiashelseth99
Member
Posts:
37
August 2013
i cant seem to find the self.motionline.x and y!
Mathiashelseth99
Member
Posts:
37
August 2013
ok, Thanks
-Timo-
Member
Posts:
2,313
August 2013
found it?
it's not self.motionline.x it's self.motion.linear velocity.x (and y)
good luck
-Timo-
Sign In
or
Register
to comment.
Comments
timer
after random 5, 7 seconds
change game.hp to game.hp -1
is all the attributes already in the creator?
if you're also moving on the y then do
if self.motion.linear velocity.X = 0 and self.motion.linear velocity.Y = 0
do
after random(5,7) seconds
change game.hp to game.hp-1
it's not self.motionline.x it's self.motion.linear velocity.x (and y)
good luck
-Timo-