ROOM ID 247 NAME "Bump A Skittle" PICT "buaskbg.gif" PICTURE ID 1 NAME "arrowll.gif" TRANSCOLOR 0 ENDPICTURE PICTURE ID 2 NAME "arrowrr.gif" TRANSCOLOR 0 ENDPICTURE SPOT ID 5 NAME "no movement" DONTMOVEHERE OUTLINE 2,1 512,1 512,382 2,381 LOC 258,192 ENDSPOT SPOT ID 1 NAME "play" DONTMOVEHERE OUTLINE 39,344 72,344 72,366 39,366 LOC 167,272 SCRIPT ;~MediaList~;silence.wav,boing.wav,bonk.wav ON ENTER { NAKED "silence.wav" SOUND "boing.wav" SOUND "bonk.wav" SOUND ; NOTE: to use this room, flooding has to be set very high, or else turned off altogether! direct GLOBAL ptime GLOBAL playing GLOBAL ; direct = direction of movement 0 direct = ; playing = flag, 1 = user active, 0 = user NOT active 0 playing = ; ptime = number of minutes user can stay in the play area. ; change the 1 below to the number of minutes you wish to allow 1 ptime = ptime 60 * ptime = ; put person on non-playing side 82 RANDOM 22 + 251 RANDOM 22 + SETPOS } ; Sound List ; "silence.wav-*" ; "boing.wav-*" ; "bonk.wav-*" ON SELECT { playing GLOBAL stime GLOBAL { NAKED 16 RANDOM SETCOLOR 1 playing = ; is playing now DATETIME stime = ; set up start time 319 187 SETPOS ; position user 10 ME SETALARM ; trigger alarm handler } playing NOT IF ; only allow user to select this button if they aren't currently playing } ON OUTCHAT { direct GLOBAL playing GLOBAL { { "$1" GREPSUB ATOI direct = "" CHATSTR = ; reset direction } CHATSTR "^([0-9])$" GREPSTR IF { "" CHATSTR = 0 playing = 0 direct = 82 RANDOM 22 + 251 RANDOM 22 + SETPOS "@" POSX ITOA + "," + POSY ITOA + "!" + USERNAME + " quit!" + ROOMMSG } CHATSTR "stop" == CHATSTR "quit" == OR IF } playing IF ; only check what is said if the user is actually playing } ON ALARM { direct GLOBAL playing GLOBAL stime GLOBAL ptime GLOBAL 5 speed = ; speed is how often the alarm is triggered 149 xmin = 490 xmax = 23 ymin = 360 ymax = NAKED POSX x = POSY y = { ; movement { [ [ -3 3 ] [ 0 3 ] [ 3 3 ] [ -3 0 ] [ 0 0 ] [ 3 0 ] [ -3 -3 ] [ 0 -3 ] [ 3 -3 ] ] d = d direct 1 - GET 0 GET d direct 1 - GET 1 GET MOVE } 0 direct < IF ; calculate user's "corners" x 22 - bx1 = x 22 + bx2 = y 22 - by1 = y 22 + by2 = ; hit the edge { direct od = 0 direct = "boing.wav" sound [ [ 1 -1 ] [ 0 -1 ] [ -1 -1 ] [ 1 0 ] [ 0 0 ] [ -1 0 ] [ 1 1 ] [ 0 1 ] [ -1 1 ] ] d = { d od 1 - GET 0 GET d od 1 - GET 1 GET MOVE } { 4 INSPOT NOT } WHILE [ 9 8 7 6 0 4 3 2 1 ] od 1 - GET direct = } 4 INSPOT NOT IF ; collide with another user ; set up all the variables for checking 0 i = POSX x = POSY y = x 22 - bx1 = x 22 + bx2 = y 22 - by1 = y 22 + by2 = ; check EVERY person in the room, EXECPT the user running the script { { i ROOMUSER WHOPOS ay = ax = ay 22 - ay1 = ay 22 + ay2 = ax 22 - ax1 = ax 22 + ax2 = ; if there is a collision, move in the opposite direction AWAY from the user ; crashed into. { direct od = 0 direct = "bonk.wav" sound [ [ 3 -3 ] [ 0 -3 ] [ -3 -3 ] [ 3 0 ] [ 0 0 ] [ -3 0 ] [ 3 3 ] [ 0 3 ] [ -3 3 ] ] d = d od 1 - GET 0 GET d od 1 - GET 1 GET MOVE [ 9 8 7 6 0 4 3 2 1 ] od 1 - GET direct = } bx1 ax1 >= bx1 ax2 <= AND by1 ay1 >= by1 ay2 <= AND AND bx2 ax1 >= bx2 ax2 <= AND by1 ay1 >= by1 ay2 <= AND AND OR bx2 ax1 >= bx2 ax2 <= AND by2 ay1 >= by2 ay2 <= AND AND OR bx1 ax1 >= bx1 ax2 <= AND by2 ay1 >= by2 ay2 <= AND AND OR IF } i ROOMUSER WHOME != IF i ++ } { NBRROOMUSERS i > } WHILE ; reset the alarm handler IF the time has not expired { speed ME SETALARM } ; if it HAS expired, move user to non-playing side and tell everyone { 0 playing = 82 RANDOM 22 + 251 RANDOM 22 + SETPOS "@" POSX ITOA + "," + POSY ITOA + "!" + USERNAME + "'s time is up!" + LOCALMSG } DATETIME stime - ptime < IFELSE } playing IF ; only do the alarm if the user is actually playing } ENDSCRIPT ENDSPOT SPOT ID 2 NAME "help" DONTMOVEHERE OUTLINE 38,299 74,299 74,323 38,323 LOC 260,189 SCRIPT ON SELECT { ptime GLOBAL "\x0d---- Skittle-head Bumper Cars - Playing Instructions ----\x0d" LOGMSG "This is a Palace version of bumper cars." LOGMSG "You are allowed to play for " ptime 60 / ITOA + " minute(s), after which you will" + LOGMSG "be returned to the non-playing side of the screen." LOGMSG "When you click on the PLAY button, your time begins and" LOGMSG "you are moved to the center of the playing area.\x0d" LOGMSG "Make sure your chatbox is active!" LOGMSG "Make sure you can type numbers on your number keypad!" LOGMSG "Pressing these numbers, followed by ENTER on your keypad will result in these actions:" LOGMSG "1 = down left, 2 = down, 3 = down right, 4 = left, 5 = stop," LOGMSG "6 = right, 7 = up left, 8 = up, 9 = up right." LOGMSG "You may stop playing by saying \x22quit\x22 or \x22stop\x22.\x0d" LOGMSG "@" POSX ITOA + "," + POSY ITOA + "Help is in your log!" + LOCALMSG } ENDSCRIPT ENDSPOT SPOT ID 4 NAME "play area" DONTMOVEHERE OUTLINE 150,25 488,25 488,361 150,361 LOC 272,110 ENDSPOT DOOR ID 6 DONTMOVEHERE DEST 1300 OUTLINE 5,6 63,6 63,31 5,31 LOC 33,18 PICTS 1,0,0 ENDPICTS ENDDOOR DOOR ID 7 DONTMOVEHERE DEST 759 OUTLINE 69,7 123,7 123,30 69,30 LOC 97,19 PICTS 2,0,0 ENDPICTS SCRIPT ON INCHAT { nDoIt GLOBAL nDoIt EXEC } ON ENTER { { CLEARLOOSEPROPS PAINTCLEAR } NBRROOMUSERS 2 < IF } ENDSCRIPT ENDDOOR ENDROOM