Creating a Breakout Game: Technical Exercises
REVIEW OF RELEVANT LINGO TERMINOLOGY:
.(some condition is true) then
This statement checks whether two sprites intersect and, if they do, changes the contents of the field cast member Notice to "You won."
if sprite i intersects j then
put "You won." into field "Notice"
Commands: repeat with, repeat while
This frame behavior script continually changes the opacity of sprites 1-30.
repeat with channel = 1 to 30
- 1) Create a single frame movie 640 x 480 pixel stage size. Place at least 20 "bricks" (vector cast membes) on stage in channels 1 through 20. Now use a repeat loop to change the colors of the bricks on stage continually.
- 2) Create a single frame movie 640 x 480 pixel stage size. Place at least 20 "bricks" (vector cast membes) on stage in channels 1 through 20. Create a circular sprite and place in channel 25. Make the circular sprite follow your mouses position on stage. Now have the bricks disappear when your circular sprite touches, or intersects them.
- 3) Import 5 short (less than 2 seconds) sounds into your movie that you made for Exercise #2. Whenever the circular sprite intersects a brick, write a script (use a list) to puppet one of these five sounds randomly.
- 4) Create a paddle and a breakout ball. Place at the bottom of the stage and script the paddle so that its locH corresponds to the balls lochH. You are now going to create a four frame movie that will move the ball around the frame of the movie as if it were bouncing off the edges. To start you off, create four markers: put "upleft" at frame 10, "upright" at frame 20, "downleft" at frame 30 and "downright" at frame 40. The marker names correspond to what you are going to need to make the ball do (in lingo) in that frame. For example, in the marker titled "upleft" the ball will need to move up and to the left, heading for the left bumper. You will need to incorporate if-then statements to send the playback head to a different frame if the balls locH is less than zero, or if it travels beyond the left edge of the movie bounds.