Key Control Code

Here's the code to drive the walker character in the Fallout game using the right and left arrow keys. Insert this handler in your main movie script:

-- recognize arrow keys
on keyDown
  global goRight, goLeft
  goRight = false
  goLeft = false
  case (the keyCode) of
    124: goRight = true
    123: goLeft = true
  end case
end keyDown

If you want to download the complete code for the finished Fallout game, here's the zip file. It's about 10 megabytes, so be patient.


University of Baltimore Logo

Copyright © 2003 School of Information Arts and Technologies