Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Error with my code
- LamScript
-
8 posts
Error with my code
Hello, I am having trouble with a game I'm working on, I have had errors when changing backdrop, It spams changing backdrop. I believe that the error is in the red car, but it may not be.
(Check the code, and tell me the error, not remix it and claim it as your own)
(You can screenshot the correct code aswell)
Link:
http://scratch.mit.edu/projects/53145778/
(Check the code, and tell me the error, not remix it and claim it as your own)
(You can screenshot the correct code aswell)
Link:
http://scratch.mit.edu/projects/53145778/
- Melrose123
-
100+ posts
Error with my code
Oh you didn't tell the start button to switch backdrop?? Not sure.
- imacat
-
37 posts
Error with my code
Well I saw three problems. The first was that one of the If statements in the Control method was checking if map.current was equal to “Flat2,” Which wasn't one of the backdrops, so I changed it to Turn2.
The second was that the “If map.current = turn1” statement had inside, “if -180 < y position” but the y position would always be greater than -180 so I changed the < to a >.
The third was that you forgot to reset the “random.backdrop.number” so it was always activating something.
Summary:
1. Change “Flat2” to “Turn2,”
2. Change “-180 < y position” to “-180 > y position”
3. Add a “set random.backdrop.number to 0” at the end of the repeat until loop.
The second was that the “If map.current = turn1” statement had inside, “if -180 < y position” but the y position would always be greater than -180 so I changed the < to a >.
The third was that you forgot to reset the “random.backdrop.number” so it was always activating something.
Summary:
1. Change “Flat2” to “Turn2,”
2. Change “-180 < y position” to “-180 > y position”
3. Add a “set random.backdrop.number to 0” at the end of the repeat until loop.
- LamScript
-
8 posts
Error with my code
Well I saw three problems. The first was that one of the If statements in the Control method was checking if map.current was equal to “Flat2,” Which wasn't one of the backdrops, so I changed it to Turn2.
The second was that the “If map.current = turn1” statement had inside, “if -180 < y position” but the y position would always be greater than -180 so I changed the < to a >.
The third was that you forgot to reset the “random.backdrop.number” so it was always activating something.
Summary:
1. Change “Flat2” to “Turn2,”
2. Change “-180 < y position” to “-180 > y position”
3. Add a “set random.backdrop.number to 0” at the end of the repeat until loop.
THANKS ALLOT!
I will credit you and ask you one thing:
Would you be happy to join my studio?
- imacat
-
37 posts
Error with my code
Well I'm not much of a gamemaker to be honest, but thanks for the invitation!
- LamScript
-
8 posts
Error with my code
Okay, you don't have to develop games, you could help us fix bugs, as you are good at it, I'm okay if you say no, but are you sure you don't want to join, Well I'm not much of a gamemaker to be honest, but thanks for the invitation!we have cookies.
- imacat
-
37 posts
Error with my code
Well in that case sign me up! You can message me if you have a problem and I'll see what I can do.Okay, you don't have to develop games, you could help us fix bugs Well I'm not much of a gamemaker to be honest, but thanks for the invitation!
- LamScript
-
8 posts
Error with my code
Thanks mate!Well in that case sign me up! You can message me if you have a problem and I'll see what I can do.Okay, you don't have to develop games, you could help us fix bugs Well I'm not much of a gamemaker to be honest, but thanks for the invitation!
- Discussion Forums
- » Help with Scripts
-
» Error with my code