HELP with counting number of lives (finished)
Mathiashelseth99
Member Posts: 37
Help me please! I am struggling, beacause i have added lives to my game, so when the actor is hitting the wall he is losing 1 life (he has 3) but when i hit the wall and he is hitting it too fast he looses all his tree lives! is it possible to make it so you have to wait 3 seconds before he can lose more lives??????? Thanks in advice
Comments
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
On a side note consider taking your time and learning the basics of GS before diving into a serious project.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
When player overlaps and collide with walls
Change attribute game.lives to game.lives-1
Because it would be a easy fix. You need to add a new behavior and a new condition in the rule+a new self.attribute(boleean) and call it "wait?" And set it to false
The rule you had before should look like this now
When player overlaps and collide with walls... If attribute self.wait? Is false
Change attribute game.lives to game.lives-1
Timer: For 3 seconds(check the run to completion) and add to the timer
Change attribute self.wait? to true
Hope this work because I have not tried it but it should work
//Fajlajp
but the basic idea is:
create a local boolean attribute called 'hitWall' or something
then have a rule that says:
if actor overlaps or collides with actor of type wall AND self.hitWall is false
timer after .1 seconds (run to completion enabled)
change attribute lives to lives-1
change attribute hitWall to true
then another rule that says
when self.hitWall is true
timer after 3 seconds
change attribute self.hitWall to false
that should do what you want. Might be a better way, but this is off the top of my head
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left