Students will create an interface where the user may control a simple object using arrow keys.
- completed project where all arrow keys move an object
- understand what a keyboard event is
- Create three if statements from an example
- Convert the code to pseudocode
- Understand what the “+=” and “==” operators do
- Open Flash. Choose ActionScript 3.0
- Draw a circle on the stage. Go Modify, Convert to Symbol. In Properties name the object my_mc.
- Press F9 to activate the coding panel.
- Add the following code:
- Add three more if statements to make the LEFT, UP, and DOWN buttons work. (Hint: there is a pattern)
- Add the game you have created to the game page of your website along with the answers to the following questions.
- How could you alter the code so that the ball moves faster? Slower?
- What does the x and y stand for?
- What does += do?
- What does the symbol == mean?
Try the same tutorial but change the object you are moving to a more complex shape or to a small .jpg, gif, or .png image.