The software is great and all, but a lot of times I feel that transferring my ideas from my brain to the C2 project, is like having your wishes granted by an evil genie. Always a horrible twist in them. Maybe this'll be until I get 100% used to how the program works.
Anyway, my problem today is this, and I hope there's someone kind enough to help me. It's absolutely essential for pretty much any game with a life bar!:
I have a top-down view perspective in my game.
And I have this character who moves in 8 directions.
Now... I want to have a particular terrain type in which if the character STEPS on it, he'll take damage.
Here's what I've done:
1.- Added global variety: P1HP (Player 1 Health Points) = 3 (character starts with three "hearts")
2.- Added a sprite-terrain called DAMAGE, where the character is supposed to walk on and take damage.
3.- Added Variable: "takingdamage"
4.- Added Event:
If P1HP = 0 ||| Then Player 1 = DESTROY
5.- Added Event:
IF PLAYER OVERLAPS DAMAGE|
+"takingdamage" = 0||| Set "takingdamage" = 1
6.- Added Event:
IF "takingdamage" = 1 ||| Substract 1 from P1HP
Player 1 Opacity Set: 20
Wait 0.2
Player 1 Opacity Set: 80
Wait 0.2
Player 1 Opacity Set: 20
Wait 0.2
Player 1 Opacity Set 100
"takingdamage" Set 0
----
And playing around with this, I've gotten two totally different results:
A: The player is destroyed the second it touches the DAMAGE field.
B: The player blinks (opacity), but never gets destroyed.
I have NO idea why the game acts like it does. And more importantly, why are there specific moments when the program ignores the "WAIT" commands.
I would REALLY appreciate the help.