main | multimedia syllabus

SKILLS CHECK • If then statements

Instructor: Tiffany Holmes • tholmes@artic.edu • 312.345.3760

LINGO EVENT HANDLERS: on mouseDown, on mouseUp, on mouseEnter, on mouseLeave, on exitframe

LINGO COMMANDS: go to the frame, go to "name of marker", go to frame 1, beep, quit

LINGO FUNCTIONS: random()

LINGO PROPERTIES: memberNum, locH, locV, blend, width, height, rotation, forecolor

LINGO CONDITIONALS:
on exitframe me
if sprite(1).locH>400 then
sprite(1).locH=-20
end if
end


Basic logic structure:

if (--something is true) then
(--DO SOMETHING)
end if (--need to toggle off conditional)

 

DIRECTIONS: You can solve these problems using simple paint cast members, just to practice the lingo code. If you get stumped, move on to next one. ALL MOVIES SHOULD BE ONLY ONE FRAME LONG.

  1. Make a movie in which a single sprite moves diagonally from the upper left to the lower right of the stage. When the sprite disappears in the lower right corner, write an if-then statement to make it reappear in the upper left corner of the stage.
  2. Make a sprite (paint cast member) that will change its width and color when clicked. Write an if-then statement to make the sprite disappear in some way when it gets to be 300 pixels wide. (This is a balloon popping animation of sorts.)
  3. Create two sprites that are moving on stage from left to right at different speeds. Write two separate if-then statements to make each sprite reappear on the left when they trail off the stage on the right.
  4. MORE DIFFICULT: Write a script that will make a sprite "bounce" around the "frame" of the stage. In other words, when it hits the edge of the stage, the sprite will change direction to remain in view.