SELECT CASE sammy(a).direction CASE 1: sammy(a).row = sammy(a).row - 1 CASE 2: sammy(a).row = sammy(a).row + 1 CASE 3: sammy(a).col = sammy(a).col - 1 CASE 4: sammy(a).col = sammy(a).col + 1 END SELECT
''''If snake hits number, respond accordingly IF numberRow = INT((sammy(a).row + 1) / 2) AND NumberCol = sammy(a).col THEN PLAY "MBO0L16>CCCE" IF sammy(a).length < (MAXSNAKELENGTH - 30) THEN sammy(a).length = sammy(a).length + number * 4 END IF sammy(a).score = sammy(a).score + number PrintScore NumPlayers, sammy(1).score, sammy(2).score, sammy(1).lives, sammy(2).lives number = number + 1 IF number = 10 THEN EraseSnake sammy(), sammyBody(), 1 EraseSnake sammy(), sammyBody(), 2 LOCATE numberRow, NumberCol: PRINT " " Level NEXTLEVEL, sammy() PrintScore NumPlayers, sammy(1).score, sammy(2).score, sammy(1).lives, sammy(2).lives SpacePause " Level" + STR$(curLevel) + ", Push Space" IF NumPlayers = 1 THEN sammy(2).row = 0 number = 1 IF diff$ = "P" THEN speed = speed - 10: curSpeed = speed END IF nonum = TRUE IF curSpeed < 1 THEN curSpeed = 1 END IF NEXT a
FOR a = 1 TO NumPlayers ''''If player runs into any point, or the head of the other snake, it dies. IF PointIsThere(sammy(a).row, sammy(a).col, colorTable(4)) OR (sammy(1).row = sammy(2).row AND sammy(1).col = sammy(2).col) THEN PLAY "MBO0L32EFGEFDC" COLOR , colorTable(4) LOCATE numberRow, NumberCol PRINT " " playerDied = TRUE sammy(a).alive = FALSE sammy(a).lives = sammy(a).lives - 1
''''Otherwise, move the snake, and erase the tail ELSE sammy(a).head = (sammy(a).head + 1) MOD MAXSNAKELENGTH sammyBody(sammy(a).head, a).row = sammy(a).row sammyBody(sammy(a).head, a).col = sammy(a).col tail = (sammy(a).head + MAXSNAKELENGTH - sammy(a).length) MOD MAXSNAKELENGTH Set sammyBody(tail, a).row, sammyBody(tail, a).col, colorTable(4) sammyBody(tail, a).row = 0 Set sammy(a).row, sammy(a).col, sammy(a).scolor END IF NEXT a
LOOP UNTIL playerDied
curSpeed = speed '''' reset speed to initial value FOR a = 1 TO NumPlayers EraseSnake sammy(), sammyBody(), a
''''If dead, then erase snake in really cool way IF sammy(a).alive = FALSE THEN ''''Update score sammy(a).score = sammy(a).score - 10 PrintScore NumPlayers, sammy(1).score, sammy(2).score, sammy(1).lives, sammy(2).lives IF a = 1 THEN SpacePause " Sammy Dies! Push Space! --->" ELSE SpacePause " <---- Jake Dies! Push Space " END IF END IF NEXT a
Level SAMELEVEL, sammy() PrintScore NumPlayers, sammy(1).score, sam 上一页 [1] [2] [3] [4] [5] [6] 下一页 |