Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Flappy Bird pipes not going past 3?
- VinMannie
-
Scratcher
42 posts
Flappy Bird pipes not going past 3?
Now I keep wrecking up my code. This time somehow no pipes spawn after 3. However, if you hit a pipe before 3, because I haven't made the scripts better yet, you can see more pipes than 3 spawn.
When playing on Phosphorus, the same happens after only 2 pipes. It used to work just fine on both.
Try it at https://scratch.mit.edu/projects/251354359/ and tell me if you figure something out!
When playing on Phosphorus, the same happens after only 2 pipes. It used to work just fine on both.
Try it at https://scratch.mit.edu/projects/251354359/ and tell me if you figure something out!
- DerpyHead0
-
Scratcher
1000+ posts
Flappy Bird pipes not going past 3?
to be honest, the bug is script order (the script where clones hide if touching the edge happens before clones go back to the right)
but you have a far more serious problem right now, you need to clean up your scripts.
there are tons of scripts not even needed (why does the main pipe sprite need to go left? don't the clones do that instead?), you use multiple of the same hat block for no reason, and more.
go through your scripts, and think about why it's there, and if another script has the same hat block, try to design it so it's one long script instead of 2 short ones, like this:
instead of
do
(in reality its more complicated, but usually it's just: if its in a forever loop, keep it in a forever loop. if it's not, then don't put it in a forever loop.)
but you have a far more serious problem right now, you need to clean up your scripts.
there are tons of scripts not even needed (why does the main pipe sprite need to go left? don't the clones do that instead?), you use multiple of the same hat block for no reason, and more.
go through your scripts, and think about why it's there, and if another script has the same hat block, try to design it so it's one long script instead of 2 short ones, like this:
instead of
... :: hat
1
... :: hat
2
do
... :: hat
1
2
(in reality its more complicated, but usually it's just: if its in a forever loop, keep it in a forever loop. if it's not, then don't put it in a forever loop.)
Last edited by DerpyHead0 (Oct. 11, 2018 01:18:46)
- VinMannie
-
Scratcher
42 posts
Flappy Bird pipes not going past 3?
The main pipe goes left because it's the first pipe. Also I just recently began learning more about scratch so my code'll be a little messy. Anyway I'll try what you're saying.
- DerpyHead0
-
Scratcher
1000+ posts
Flappy Bird pipes not going past 3?
The main pipe goes left because it's the first pipe.hide the main sprite, and only use clones for the pipes (so you don't repeat code)
- VinMannie
-
Scratcher
42 posts
Flappy Bird pipes not going past 3?
Hiding the main sprite fixed everything! Thank you! 

- Discussion Forums
- » Help with Scripts
-
» Flappy Bird pipes not going past 3?

