Having trouble with game.health attribute
butterbean
Member Posts: 4,315
So I have soo many attributes for my main character, and the last one I want to add, game.health is interfering with other rules and attributes, so I will do my best to explain
The 3 links are to a rule just for her. Thanks to Codemonkey I got her stomping ability working perfectly!
http://img36.imageshack.us/img36/3403/picture1ww.png
http://img515.imageshack.us/img515/5453/picture2ff.png
http://img180.imageshack.us/img180/1056/picture3r.png
Basically, I've added a global game attribute game.health. And it is integer with a 3 next to it.
In the 3rd link, I've tried adding instead of "destroy this actor"
Game.health = game.health-1
Then I also added another rule, if game.health=0 destroy this actor
It hasn't worked so far with the attempts I've made, and then when she collides with the enemy, her Y velocity kicks in and she moves up like she's jumping.
Not sure how to get rid of this when she collides with such enemy.
Let me know if I need to clarify anything, but this is the last attribute needed for her to get this game rolling
The 3 links are to a rule just for her. Thanks to Codemonkey I got her stomping ability working perfectly!
http://img36.imageshack.us/img36/3403/picture1ww.png
http://img515.imageshack.us/img515/5453/picture2ff.png
http://img180.imageshack.us/img180/1056/picture3r.png
Basically, I've added a global game attribute game.health. And it is integer with a 3 next to it.
In the 3rd link, I've tried adding instead of "destroy this actor"
Game.health = game.health-1
Then I also added another rule, if game.health=0 destroy this actor
It hasn't worked so far with the attempts I've made, and then when she collides with the enemy, her Y velocity kicks in and she moves up like she's jumping.
Not sure how to get rid of this when she collides with such enemy.
Let me know if I need to clarify anything, but this is the last attribute needed for her to get this game rolling
Comments
game.health < 0 destroy this actor
Not sure if this will help, may need to see more of your code.
--------------------------------
StarFire
http://gamesalad.com/game/play/8901
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
So above is what rules I changed in the main player...
Originally, under these new rules, it just said Otherwise: Destroy this actor
In the "otherwise" section where she was destroyed, I changed it to checking 2 rules:
Game.health to game.health-1
Also, I put in change attribute: Self.linearvelocityY to 0 (when she pounces on enemies, her linear velocity Y goes up, and she moves upwards)
So far, this hasn't worked, I'll have to look at the rules again
When she collides with such enemy, she collides with that enemy, and they take either 1 or 2 healthbars away, and her linear velocity Y kicks in, and she starts floating upwards...
I'll have to create an invincibility attribute as well, but how do get her to stop climbing up when she collides with the enemy...
Oh dear.... Professor Layton... .might I inquire...?
I'm having trouble with her collision with the enemy, even when the invincibility kicks in, sometimes the enemy takes 2 healthbars away from her with one hit.
http://farm3.static.flickr.com/2643/3897033852_fb137839ff_b.jpg
--------------------------------
StarFire
http://gamesalad.com/game/play/8901
What I want to do, and not sure if this is possible is once she collides with such enemy, that the enemy won't strike her again until her invincibility wears off, but she's still on screen
What happens is that the enemy hits her twice if not 3 times and she's destroyed even when "invincible"...
Would I just have to follow what you did and respawn her? If so, how do I respawn her at the coordinate she left off at when the scene is 3000 width?
Do you have a pic of your invincibility rule too? I followed the Wiki, and she blinks for me, but stays invisible...
She also still stays invisible, so how with invincibility do I make her go back to herself? I followed the Wiki carefully and looked it over, if you have rules for the invincibility tracking, let me know Xacto, thanks so much
After 3.5 seconds
change attribute: game.Invincible to 0
change attribute: self.color.alpha to 1
So it looks like I could not make the player visibility "on" and "off" consistent. (sometimes it worked, other times it did not) So I just placed a timer to make sure my player was visible at the right moment.
http://farm3.static.flickr.com/2446/3896553103_a75dbc4f5e_o.png
Did you put that as a separate rule, or under the same rule as invincibility?
Now the only thing left to fix is when she pounces on an enemy, her linear velocity Y kicks in, and she moves upward after pouncing on him...
Unfortunately, when she collides with him, she does the same... I'm trying to figure out how to turn that off when she collides with enemy head on, but she keeps floating upwards....
Maybe create a rule around the physics of the "player.movable" or the "player.density" attributes?
http://img169.imageshack.us/img169/2918/picture2ya.png
There's a screenshot of the rules
So 1st time she hits enemy, she blinks with invincibility then goes back to normal after 5 seconds
Upon second collision with enemy, she'll blink again, but stay invisible....
There are too many attributes and this is so confusing..... I'm giving up for today this is drivin' me crazy!
Now moving onto the fun part, building levels!!