;Alan's Star Wars game ;Put this script in a spot which covers most of the room. ;Set the spot to 'do not move here' ;Set the first spot picture to 'none' ;Place a 'target' picture in the door 13 times after 'none'. ;Leave the room, re-enter it and type 'settargets' while a owner/operator to position the targets. ON ENTER { targetspot GLOBAL ME targetspot = target GLOBAL [ [ 75 75 ] [ 160 115 ] [ 265 80 ] [ 360 115 ] [ 430 70 ] [ 370 170 ] [ 420 210 ] [ 375 260 ] [ 425 310 ] [ 265 300 ] [ 170 250 ] [ 75 310 ] [ 105 190 ] ] target = 0 ME SETSPOTSTATELOCAL } ON OUTCHAT { ;position the targets target GLOBAL { 0 i = { i 1 + ME SETSPOTSTATE "Setting target " i 1 + ITOA & LOGMSG target i GET temparray = temparray 0 GET 256 - temparray 1 GET 192 - ME SETPICLOC i ++ } { i target LENGTH < } WHILE 0 ME SETSPOTSTATE "" CHATSTR = } CHATSTR "settargets" == ISWIZARD AND IF } ON SELECT { play GLOBAL x GLOBAL y GLOBAL hits GLOBAL missed GLOBAL ;***Set the target diameter in pixels*** 20 diameter = ;higher number for easier game, lower number for harder game ;**end of target diameter*** diameter 2 / radius = { 200 0 0 PENCOLOR 5 PENSIZE POSX POSY MOUSEPOS LINE { hits ++ 0 missed = ")boom" SAY } { 1 missed = } MOUSEPOS DUP y radius - >= SWAP y radius + <= AND SWAP DUP x radius - >= SWAP x radius + <= AND AND ME GETSPOTSTATE AND IFELSE { PAINTCLEAR } 10 ALARMEXEC } play IF } ON ALARM { play GLOBAL x GLOBAL y GLOBAL target GLOBAL targets GLOBAL missed GLOBAL ; { 0 200 0 PENCOLOR x y POSX POSY LINE ")boom" SAY { PAINTCLEAR } 10 ALARMEXEC 0 missed = } missed IF targets ++ target LENGTH RANDOM state = target state GET DUP 0 GET x = 1 GET y = state 1 + ME SETSPOTSTATELOCAL { 60 ME SETALARM } { 0 ME SETSPOTSTATELOCAL } play IFELSE } ;Place the following script in a spot named "Start" ON ENTER { play GLOBAL 0 play = } ON SELECT { hits GLOBAL play GLOBAL targets GLOBAL targetspot GLOBAL { 1 play = 0 targets = 0 hits = 256 192 SETPOS "Click on a target as soon as you see it." LOCALMSG "Watch out ... if you miss the target it will shoot back!" LOCALMSG "May the Force be with you!" LOCALMSG 900 targetspot SETALARM "" CHATSTR = } play NOT IF } ;Place the following script in a spot named "Stop" ON SELECT { hits GLOBAL play GLOBAL targets GLOBAL targetspot GLOBAL { 0 play = 0 targetspot SETSPOTSTATELOCAL "Game Over. You were given " targets ITOA & " targets and hit " & hits ITOA & " of them." & LOCALMSG "" CHATSTR = } play IF }