I seem to have a bug in my app that I can't fix
So, I just made a small platform game, and for the scene "initial scene copy 2" I want my character to try and do something, and if he does it, then the scene changes to "you win". But, if he does it wrong, then I want it to change to scene "you died".
The attribute I made for changing the scene to "you win" was called "finishing one" .
So, when the spikeys2 (these are my player's bullets that spawn from him when I press space bar) , collides with barrier ( the barrier keeps you from finishing the level), than "finishing one" +1
Than I went to barrier actor and made a rule that
when the attribute "finishing one" = 50 (so you have to shoot the barrier 50 times), than destroy this actor
Then behind the barrier was another actor that when the main character collided with it, than change scene to "you win"
Ok, so this is how you get the "you died" scene.
First off, before the player can shoot the barrier I wanted the player to collide with the barrier several times, (because its the end of the level and its like, what the crap do i do now theres a barrier in front of me) and than after he collides five times with the barrier, the barrier would display a text "shoot with space bar(don't kill yourself)"
then, after that you are allowed to shoot the spikeys2 actor into the barrier
well, i also made another attribute "set back" that says if spikeys2 collides or overlaps with player, than "set back" +1
(by the way, the spikeys 2 could not actually collide with the player, it just overlapped with the player when it bounced off the barrier, but would continue moving 0 degrees towards the barrier because of spikeys2 acceleration behavior, if spikeys2 could collide with player, then they wouldnt look like bullets they would like bouncing balls)
Than, i went to the spikeys2 actor and said, when attribute "set back" = 10, than change scene to "you died"
(so, if the bullets bounce back at you 10 times while your trying to destroy the barrier, you have to go to the "you died" scene)
I succesfully got it so that I can get to both scenes, but, after I get to the "you died scene," it seems there is a bug.
The "you died" scene has only one actor. This actor has the behavior of , display text, and the other behavior is a time rule. After 3 seconds, change scene to "initial scene copy 2"
so basically after you die I want you to repeat the level again
But, when it changes back to "initial scene copy 2," whenever you press the space bar, it sends me back to the "you died" scene again, and then that scene sends me back to "initial scene copy 2" in three seconds, and then when you press space bar it again sends you to "you died" and so on and so on and so on...
This is like a bug because when you press space bar at the beginning of the level in "initial scene copy 2", you can't even shoot yet,
The player has to bounce off the barrier 5 times first, then you can shoot
I felt like whenever you change scenes, the attributes maybe didn't fully reset or something, so i tried something else too
I made it so that whenever "set back" = 10, than reset scene. (this is instead of changing scene to "you died," and then the "you died" scene would change it back to "initial scene copy 2".
I figured if you reset the scene then it would reset all attributes and basically everything about that scene, but i guess it didn't,
because if you press space bar at the beginning of "initial scene copy 2" after its reset, it just resets the scene,
whenever you press space bar it keeps resetting the scene.
so, I told you basically everything I possibly could, I don't know how to fix it. Thankyou if you read this far
Cheers.
The attribute I made for changing the scene to "you win" was called "finishing one" .
So, when the spikeys2 (these are my player's bullets that spawn from him when I press space bar) , collides with barrier ( the barrier keeps you from finishing the level), than "finishing one" +1
Than I went to barrier actor and made a rule that
when the attribute "finishing one" = 50 (so you have to shoot the barrier 50 times), than destroy this actor
Then behind the barrier was another actor that when the main character collided with it, than change scene to "you win"
Ok, so this is how you get the "you died" scene.
First off, before the player can shoot the barrier I wanted the player to collide with the barrier several times, (because its the end of the level and its like, what the crap do i do now theres a barrier in front of me) and than after he collides five times with the barrier, the barrier would display a text "shoot with space bar(don't kill yourself)"
then, after that you are allowed to shoot the spikeys2 actor into the barrier
well, i also made another attribute "set back" that says if spikeys2 collides or overlaps with player, than "set back" +1
(by the way, the spikeys 2 could not actually collide with the player, it just overlapped with the player when it bounced off the barrier, but would continue moving 0 degrees towards the barrier because of spikeys2 acceleration behavior, if spikeys2 could collide with player, then they wouldnt look like bullets they would like bouncing balls)
Than, i went to the spikeys2 actor and said, when attribute "set back" = 10, than change scene to "you died"
(so, if the bullets bounce back at you 10 times while your trying to destroy the barrier, you have to go to the "you died" scene)
I succesfully got it so that I can get to both scenes, but, after I get to the "you died scene," it seems there is a bug.
The "you died" scene has only one actor. This actor has the behavior of , display text, and the other behavior is a time rule. After 3 seconds, change scene to "initial scene copy 2"
so basically after you die I want you to repeat the level again
But, when it changes back to "initial scene copy 2," whenever you press the space bar, it sends me back to the "you died" scene again, and then that scene sends me back to "initial scene copy 2" in three seconds, and then when you press space bar it again sends you to "you died" and so on and so on and so on...
This is like a bug because when you press space bar at the beginning of the level in "initial scene copy 2", you can't even shoot yet,
The player has to bounce off the barrier 5 times first, then you can shoot
I felt like whenever you change scenes, the attributes maybe didn't fully reset or something, so i tried something else too
I made it so that whenever "set back" = 10, than reset scene. (this is instead of changing scene to "you died," and then the "you died" scene would change it back to "initial scene copy 2".
I figured if you reset the scene then it would reset all attributes and basically everything about that scene, but i guess it didn't,
because if you press space bar at the beginning of "initial scene copy 2" after its reset, it just resets the scene,
whenever you press space bar it keeps resetting the scene.
so, I told you basically everything I possibly could, I don't know how to fix it. Thankyou if you read this far

Cheers.
Best Answers
-
jonmulcahy Posts: 10,408
Try putting another rule on your you died actor that says set back = 0
That way while it's displaying the you died screen, it resets your set back value, and then 3 seconds later takes you back to the game.
I'd manually reset all your values here just to be safe -
BSideGames Posts: 392
You need to have all your attribute set back to their defaults. So in the "you died" scene before you change scene back to gameplay set the "collides five times" back to zero, the "finishing one" back to zero, and the "set back" back to zero.
BTW only the reset game reset all attributes and that never really helps
Answers
i put change attribute for all three attributes inside the timer rule thingy,
I did change "set back" to "set back"=0
but it didn't seem to work
it did work when I did
"Set back" to "set back"-10
but for the other attributes I couldn't this wouldn't work as well because the values could be random. (the numbers of the times i shot the barrier before i died would be different)