This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-01-27 14:28:02

littlebird2472
Scratcher
Registered: 2010-03-05
Posts: 42

BYOB Trick! Shorten the game and keep the size low!

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.


http://dragcave.net/image/MoLDl.gif Please click and help my dragon survive!

Offline

 

Board footer