Just found a way to use byob to shorten the length of your scrolling game!
Make a block in movement named Scrolling game-moving (player)
this is how to make it-
(hat block with block)
<forever>
<if> <key[ left arrow ]pressed?>
<change{ scrollX }by( 5 )
<end>
<if> <key[ right arrow ]pressed?>
<change{ scrollX }by( -5 )
<end>
<end>
Then make a block named scrolling game-jumping (player) with this script:
Hat block with new block
<forever>
<if> << <not> <touching color[ ground >>
<change y by( -5)
<else>
<if> <key[ up or space ]pressed?>
<repeat( 15
<change y by( 5
<end>
<end>
<end>
<end>
Last few blocks for the background. Make a block called Scrolling game-scroll(t0).
Add this script.
Hat block
<forever>
<set x to( (( <{ ScrollX }> <+> (( 480 <*> 0 )) ))
<end>
Repeat for every number of terrains, starting with 0 for terrain0, 1 for 1 ect.
Now the scripts.
Player:
<when green flag clicked>
<forever>
Moving block
<end>
<when green flag clicked>
<forever>
Jumping block
<end>
Terrains:
<when green flag clicked>
<forever>
terrain0 block (for terrain0, 1 for 1, ect.)
<end>
Now test! Any glitches, comment.
Offline