Scroller-Walker Game Prototype

Here's a step-by-step guide to the project:

1. Download the starter file SceneScroller.dir from the appropriate directory on the class server. Open this file. Its score has single-frame sprites in channels 1 and 2. Extend these sprites to two frames each. You'll also see a Behavior Script in frame 1 of the behavior channel. MOVE this sprite to frame 2--don't extend it. Test the movie. The scroll effect should work. SAVE.

2. Download the source file lingoWalker1014.dir from the appropriate directory on the class server. Open this file. Select the twelve sprites in channels 1 through 6. Right-click on the selected sprites and choose Copy Sprites.

3. Re-open SceneScroller.dir. Right-click in frame 1 of channel 3. (This frame is presently blank.) Choose Paste Sprites. The twelve sprites you copied from the walker file should appear in channels 3 through 8. SAVE.

4. Double-click in the behavior channel at frame 1 to open a new Behavior Script. Write the following:

on enterFrame
  sprite(3).visible = true
  sprite(4).visible = false
  sprite(5).visible = false
  sprite(6).visible = false
end

Test your movie. The landscape should scroll past a standing figure facing right. You should not see multiple figures. SAVE.

5. Open the behavior script in frame 2 (NOT the script in frame 1 that you wrote in the previous step). Find the enterFrame handler (NOT the exitFrame handler, which we'll leave alone). Leave the handler in place but remove its contents, so that you have only the lines on enterFrame and end enterFrame.

6. Type the code that appears on the next page into the empty enterFrame handler. There's a lot to do, but it should look pretty familiar. Take your time and be careful.

global goRight, goLeft, step
  
  step = step + 1
  
  if goRight = true then
    
    sprite(5).visible = false
    sprite(6).visible = false
    
        if step = 1 then
      sprite(3).visible = true
      sprite(4).visible = false
    else
      sprite(3).visible = false
      sprite(4).visible = true 
    end if
    
    sprite(1).locH = sprite(1).locH - 20

    if sprite(1).locH < -300 then
      sprite(1).locH = 960
      pick = random(15)
      sprite(1).member = member pick  
    end if
    
    sprite(2).locH = sprite(2).locH - 20

    if sprite(2).locH < -300 then
      sprite(2).locH = 960   
      pick = random(15)
      sprite(2).member = member pick   
    end if
    
  end if

  -- goLeft code here

if step = 2 then step = 0

6. Study the code above carefully and figure out how to alter the "goRight" block to handle leftward movement. As with the lingoWalker, you'll need to hide and show the second set of walker sprites. This time, though, you'll also need to consider movement of the background sprites.


University of Baltimore Logo

Copyright © 2003 School of Information Arts and Technologies