main | survey | calendar | course overview | skills check 1 | skills check 2.1 | skills check 2.2 | if-then skills check | intersects and repeat loops | sound | shockwave | quicktime | video tracking | custom handlers | pc scripting 1 | pc scripting 2 | qtvr | ezio | final project | student links

breakout tutorial quicklinks | game1 | game2 | game3 | game4 | game5 | game6 | game7


TIFFANY HOLMES>INTRODUCTION TO LINGO>SPRING04>HANDOUT 2


EVENTS>Examples on event handlers


on exitframe on mousewithin on mouseleave
on mouseup on mouseenter on mousedown


SPRITE PROPERTIES>Examples>loc, loch, locv, width, height, rotation, member, membernum, color, blend, etc.


Examples: Setting sprite properties using dot syntax


sprite(2).loc=point(0,0) –(sprite in channel 2 located at top left of stage)
sprite(2).blend=30 --(sprite in channel 2 at 30% opacity)


COMMANDS


go next --go to the next marker AND go previous --go to the previous marker
go to the frame –loop playback head in same frame


CONDITIONALS>Basic structure


if –something is true—then


DO SOMETHING—execute lingo command


end if


Example: Sprite moving down and goes off edge, reappears at top, this script is a frame behavior script and belongs in score script channel (I.E. This script is NOT ATTACHED TO A SPRITE.)


on exitframe


sprite(2).locv=sprite(2).locv+5


if sprite(2).loch > 240 then


sprite(2).locv=0


end if


go the frame


end


FUNCTIONS: A word or phrase that returns a specific number. SAMPLES: random(), the mouseH, the mouseV, the clickOn.

Samples to be typed in Message window:


Put the mouseH --puts the horizontal coordinate of the mouse’s location
Put random(10) --randomly returns a whole number between 1 and 10
Put the mouseV --puts the vertical coordinate of the mouse’s location
Put the clickOn --puts the channel number of the sprite last clicked


Advanced topics to be covered later: LISTS/ARRAY and REPEAT LOOPS