yeah it sucks...
I KILLED IT... *SNIFF*
But here is the remedy.. I hope
`************** DiNGo DaNGo
`***************** By Jimmy
SYNC ON : SYNC RATE 40 : HIDE MOUSE
DIM Moves(8) as String
Moves(0) = ""
Moves(1) = "Forward 1"
Moves(2) = "Forward 2"
Moves(3) = "Forward 3"
Moves(4) = "Rotate Left"
Moves(5) = "Rotate Right"
Moves(6) = "Rotate 180"
Moves(7) = "Backward 1"
scrW = SCREEN WIDTH()
Make_Robot(100)
SCALE OBJECT 100, 50, 50, 50
INK RGB(255, 255, 255), RGB(0, 0, 0)
MAKE OBJECT CUBE 1, 5
COLOR OBJECT 1, RGB(100, 100, 100)
MAKE OBJECT CUBE 2, 5
COLOR OBJECT 2, RGB(0, 0, 200)
MAKE OBJECT CUBE 3, 5
COLOR OBJECT 3, RGB(0, 200, 0)
MAKE OBJECT CUBE 4, 5
COLOR OBJECT 4, RGB(0, 0, 0)
MAKE OBJECT CUBE 5, 5
COLOR OBJECT 5, RGB(255, 0, 0)
MAKE OBJECT CUBE 6, 3
COLOR OBJECT 6, RGB(255, 255, 0)
MAKE OBJECT CUBE 7, 5
COLOR OBJECT 7, RGB(255, 0, 255)
FOR i=1 TO 7
HIDE OBJECT i
NEXT i
`MAKE OBJECT SPHERE 100, 4
`COLOR OBJECT 100, RGB(255, 255, 0)
MAKE OBJECT CONE 101, 2
COLOR OBJECT 101, RGB(255, 155, 0)
HIDE OBJECT 101
CurLevel = 0
NEWLEVEL:
GOSUB LoadNextLevel
RESTART:
PPosX# = blueJ*5.4
PPosZ# = blueI*5.4
PAng# = 0
OAng# = 0
CamHeight# = 15.0
curMove = 0
POSITION CAMERA 0, CamHeight#, 0
POINT CAMERA (levW*5.4)/2, 0, (levH*5.4)/2
DO
`CONTROL CAMERA USING ARROWKEYS 0, 1, 1
POSITION OBJECT 100, PPosX#, 2, PPosZ#
POSITION OBJECT 101, PPosX#, 2, PPosZ#
YROTATE OBJECT 100, PAng#
ROTATE OBJECT 101, 0, 0, 0
YROTATE OBJECT 101, PAng#
MOVE OBJECT 101, 2.5
XROTATE OBJECT 101, 90
TEXT 5, 5, "Available Moves"
FOR i = 1 TO numMoves
TEXT 5, i*10+10, CHR$(96+i)+": "+Moves(levelMoves(i))
NEXT i
TEXT scrW-140, 5, "Queued UP Moves"
FOR i = 1 TO numQMoves
IF i = (CurMove-1) THEN INK RGB(255, 255, 0), RGB(0, 0, 0)
TEXT scrW-140, i*10+10, CHR$(64+i)+": "+Moves(qMoves(i))
INK RGB(255, 255, 255), RGB(0, 0, 0)
NEXT i
OAng# = WRAPVALUE(OAng#+2.0)
FOR i = 1 TO levH
FOR j = 1 TO levW
obj = level(i, j)
IF obj = 5 THEN YROTATE OBJECT levelObj(i, j), OAng#
IF obj = 11 THEN YROTATE OBJECT levelObj(i, j), OAng#*-1
IF obj = 7 THEN XROTATE OBJECT levelObj(i, j), OAng#
IF obj = 8 THEN XROTATE OBJECT levelObj(i, j), OAng#*-1
IF obj = 9 THEN ZROTATE OBJECT levelObj(i, j), OAng#
IF obj = 10 THEN ZROTATE OBJECT levelObj(i, j), OAng#*-1
NEXT j
NEXT i
GOSUB GetCurSquare
`GOSUB GetNextSquare
`GOSUB GetPrevSquare
IF Running = 1
IF Stopped = 1
ConvAng# = PAng#
pI = PPosZ# / 5.4
pJ = PPosX# / 5.4
GOSUB GetCurSquare
GOSUB GetNextSquare
GOSUB GetPrevSquare
tSquare = curSquare
IF Action = 0
IF OnConvey = 1 THEN Action = 0 : curSquare = 0 : OnConvey = 0
IF curSquare > 6 AND curSquare < 11 AND OnConvey = 0
IF curSquare = 7 THEN ConvAng# = 0
IF curSquare = 8 THEN ConvAng# = 180
IF curSquare = 9 THEN ConvAng# = 270
IF curSquare = 10 THEN ConvAng# = 90
GOSUB GetNextSquare
GOSUB GetPrevSquare
Action = 1
OnConvey = 1
ENDIF
IF OnRotator = 1 THEN Action = 0 : curSquare = 0 : OnRotator = 0
IF curSquare = 5 THEN OnRotator = 1 : Action = 5
IF curSquare = 11 THEN OnRotator = 1 : Action = 4
ENDIF
IF Action = 0 AND curMove > numQMoves
IF tSquare = 3
GOSUB UnloadLevel
GOSUB NEWLEVEL
ELSE
GOSUB GameOver
ENDIF
ENDIF
IF Action = 0 THEN Action = qMoves(curMove) : INC curMove
Stopped = 0
Movement# = 0
ELSE
IF Action > 0 AND Action < 4 OR Action = 7
Tread# = 0.0
IF Action <> 7 AND nextSquare <> 6 THEN YROTATE OBJECT 100, ConvAng# : MOVE OBJECT 100, 0.1 : YROTATE OBJECT 100, PAng# : Tread# = -0.01
IF Action <> 7 AND nextSquare = 6 AND OnConvey = 0 THEN Action = 1 : Movement# = 5.4
IF Action = 7 AND prevSquare <> 6 THEN YROTATE OBJECT 100, ConvAng# : MOVE OBJECT 100, -0.1 : YROTATE OBJECT 100, PAng# : Tread# = 0.01
IF Action = 7 AND prevSquare = 6 AND OnConvey = 0 THEN Movement# = 5.4
INC Movement#, 0.1
IF OnConvey = 0
SCROLL LIMB TEXTURE 100, 4, Tread#, 0
SCROLL LIMB TEXTURE 100, 5, Tread#, 0
ENDIF
IF Movement# >= 5.3
Stopped = 1
DEC Action
ConvAng# = 0
IF Action = 6 THEN Action = 0
IF curSquare = 0 OR curSquare = 4
GOSUB GameOver
ENDIF
ENDIF
ENDIF
IF Action = 4 OR Action = 5
IF Action = 4
PAng# = OBJECT ANGLE Y(100)-2
IF OnRotator = 0
SCROLL LIMB TEXTURE 100, 4, -0.01, 0
SCROLL LIMB TEXTURE 100, 5, 0.01, 0
ENDIF
ENDIF
IF Action = 5
PAng# = OBJECT ANGLE Y(100)+2
IF OnRotator = 0
SCROLL LIMB TEXTURE 100, 4, 0.01, 0
SCROLL LIMB TEXTURE 100, 5, -0.01, 0
ENDIF
ENDIF
YROTATE OBJECT 100, PAng#
INC Movement#, 2.0
IF Movement# >= 90.0
Stopped = 1
Action = 0
ENDIF
ENDIF
IF Action = 6
PAng# = OBJECT ANGLE Y(100)+2
YROTATE OBJECT 100, PAng#
SCROLL LIMB TEXTURE 100, 4, 0.01, 0
SCROLL LIMB TEXTURE 100, 5, -0.01, 0
INC Movement#, 2.0
IF Movement# >= 180.0
Stopped = 1
Action = 0
ENDIF
ENDIF
PPosX# = OBJECT POSITION X(100)
PPosZ# = OBJECT POSITION Z(100)
pI = PPosZ# / 5.4
pJ = PPosX# / 5.4
ENDIF
ELSE
POSITION CAMERA 0, CamHeight#, 0
POINT CAMERA (levW*5.4)/2, 0, (levH*5.4)/2
IF KEYSTATE(203) = 1 AND leftDown = 0
PAng# = WRAPVALUE(PAng#-90)
leftDown = 1
ENDIF
IF KEYSTATE(203) = 0 AND leftDown = 1 THEN leftDown = 0
IF KEYSTATE(205) = 1 AND rightDown = 0
PAng# = WRAPVALUE(PAng#+90)
rightDown = 1
ENDIF
IF KEYSTATE(205) = 0 AND rightDown = 1 THEN rightDown = 0
IF KEYSTATE(200) = 1 AND CamHeight# > 5 THEN DEC CamHeight#, 0.5
IF KEYSTATE(208) = 1 AND CamHeight# < 75 THEN INC CamHeight#, 0.5
CENTER TEXT scrW/2, 10, "DiNGo DaNGo!!"
CENTER TEXT scrW/2, 21, "LEVEL: "+STR$(CurLevel)
CENTER TEXT scrW/2, 40, "HOLD TAB TO VIEW INSTRUCTIONS"
IF KEYSTATE(15) = 1
INK RGB(0, 0, 0), RGB(0, 0, 0)
BOX 97, 103, 545, 320
INK RGB(255, 255, 255), RGB(0, 0, 0)
CENTER TEXT scrW/2, 110, "GRAY SQUARES ARE PLATFORMS - OK FOR DINGO"
INK RGB(255, 0, 0), RGB(0, 0, 0)
CENTER TEXT scrW/2, 121, "RED SQUARES TURN YOU 90 DEG. IN THE DIR. THEY SPIN"
INK RGB(255, 0, 255), RGB(0, 0, 0)
CENTER TEXT scrW/2, 132, "PURPLE SQUARES PUSH YOU 1 SPACE IN THE DIR. THEY SPIN"
INK RGB(255, 255, 0), RGB(0, 0, 0)
CENTER TEXT scrW/2, 143, "YELLOW SQUARES SCARE DINGO, HE WILL NOT MOVE ONTO THEM"
INK RGB(115, 115, 115), RGB(0, 0, 0)
CENTER TEXT scrW/2, 154, "BLACK SQUARES ARE PITS OF DEATH. GAME OVER."
INK RGB(255, 255, 255), RGB(0, 0, 0)
CENTER TEXT scrW/2, 170, "OBJECT: GO FROM BLUE SQUARE TO GREEN SQUARE WITH THE"
CENTER TEXT scrW/2, 181, "GIVEN MOVES. YOU MAY NEED ALL, YOU MAY NOT"
CENTER TEXT scrW/2, 210, "USE LEFT-RIGHT ARROW KEYS TO CHOOSE STARTING DIRECTION"
CENTER TEXT scrW/2, 221, "UP-DOWN ARROW KEYS MOVE THE CAMERA IN AND OUT"
CENTER TEXT scrW/2, 240, "QUEUE UP YOUR DESIRED MOVES WITH THE CORRESPONDING"
CENTER TEXT scrW/2, 251, "LETTER ON THE KEYBOARD."
CENTER TEXT scrW/2, 270, "TO DELETE FROM THE QUEUE, HOLD SHIFT AND USE TEH"
CENTER TEXT scrW/2, 281, "CAPITALS."
CENTER TEXT scrW/2, 300, "PRESS SPACE WHEN YOU ARE READY TO DIE."
ENDIF
Key = KeyToInt(INKEY$())
IF Key <> 0 AND KeyDown = 0
IF Key < 101 AND Key <= numMoves AND levelMoves(Key) <> 0
INC numQMoves
qMoves(numQMoves) = levelMoves(Key)
qMoveKeys(numQMoves) = Key
levelMoves(Key) = 0
ENDIF
IF Key > 100
Key = Key - 100
IF Key <= numQMoves AND qMoves(Key) <> 0
DEC numQMoves
levelMoves(qMoveKeys(Key)) = qMoves(Key)
qMoves(Key) = 0
qMoveKeys(Key) = 0
FOR i = Key TO numQMoves
qMoves(i) = qMoves(i+1)
qMoveKeys(i) = qMoveKeys(i+1)
NEXT i
ENDIF
ENDIF
KeyDown = 1
ENDIF
IF Key = 0 AND KeyDown = 1 THEN KeyDown = 0
IF KEYSTATE(57) = 1 AND SpaceDown = 0
Running = 1
curMove = 1
Stopped = 1
SpaceDown = 1
ENDIF
IF KEYSTATE(57) = 0 AND SpaceDown = 1 THEN SpaceDown = 0
ENDIF
`TEXT 5, 200, STR$(nextSquare)+":"+STR$(curSquare)+":"+STR$(prevSquare)
`TEXT 5, 211, STR$(pNextI)+","+STR$(pNextJ)
`TEXT 5, 222, STR$(pI)+","+STR$(pJ)
`TEXT 5, 233, STR$(pPrevI)+","+STR$(pPrevJ)
SYNC
LOOP
UnloadLevel:
Running = 0
FOR i = 1 TO levH
FOR j = 1 to levW
DELETE OBJECT levelObj(i, j)
NEXT j
NEXT i
UNDIM level(levW, levH)
UNDIM levelObj(levW, levH)
UNDIM levelMoves(numMoves)
RETURN
LoadNextLevel:
READ levW
READ levH
DIM level(levW, levH)
DIM levelObj(levW, levH)
INC CurLevel
FOR i = 1 TO levH
FOR j = 1 to levW
READ level(i, j)
IF level(i, j) = 2
blueI = i
blueJ = j
ENDIF
levelObj(i, j) = FreeObject()
IF level(i, j) > 6 AND level(i, j) < 11
CLONE OBJECT levelObj(i, j), 7
ELSE
IF level(i, j) = 11
CLONE OBJECT levelObj(i, j), 5
ELSE
CLONE OBJECT levelObj(i, j), level(i, j)
ENDIF
ENDIF
POSITION OBJECT levelObj(i, j), j*5.4, -2.5, i*5.4
NEXT j
NEXT i
READ numMoves
DIM levelMoves(numMoves)
DIM qMoves(numMoves)
DIM qMoveKeys(numMoves)
numQMoves = 0
FOR i = 1 to numMoves
READ levelMoves(i)
NEXT i
RETURN
GetNextSquare:
YROTATE OBJECT 100, ConvAng#
remstart Space# = 5.4
MOVE OBJECT 100, 5.42
oZ# = OBJECT POSITION Z(100)
oX# = OBJECT POSITION X(100)
pNextI = oZ# / Space#
TEXT 5, 250, STR$(OBJECT POSITION Z(100))
TEXT 5, 261, STR$(OBJECT POSITION X(100))
TEXT 5, 272, STR$(OBJECT ANGLE Y(100))
pNextJ = oX# / Space#
MOVE OBJECT 100, -5.42
remend
pNextI = pI
pNextJ = pJ
IF ConvAng# = 0 THEN pNextI = pI + 1
IF ConvAng# = 90 THEN pNextJ = pJ + 1
IF ConvAng# = 180 THEN pNextI = pI - 1
IF ConvAng# = 270 THEN pNextJ = pJ - 1
YROTATE OBJECT 100, PAng#
IF pNextI > levW OR pNextJ > levH OR pNextI < 1 OR pNextJ < 1
nextSquare = 0
RETURN
ENDIF
nextSquare = level(pNextI, pNextJ)
RETURN
GetCurSquare:
pI = (OBJECT POSITION Z(100)) / 5.3
pJ = (OBJECT POSITION X(100)) / 5.3
`TEXT 5, 250, STR$(OBJECT POSITION Z(100))
`TEXT 5, 261, STR$(OBJECT POSITION X(100))
IF pI > levW OR pJ > levH OR pI < 1 OR pJ < 1
curSquare = 0
RETURN
ENDIF
curSquare = level(pI, pJ)
RETURN
GetPrevSquare:
YROTATE OBJECT 100, ConvAng#
REMSTART
MOVE OBJECT 100, -5.41
pPrevI = OBJECT POSITION Z(100) / 5.40000
pPrevJ = OBJECT POSITION X(100) / 5.40000
MOVE OBJECT 100, 5.41
REMEND
pPrevI = pI
pPrevJ = pJ
IF ConvAng# = 0 THEN pPrevI = pI - 1
IF ConvAng# = 90 THEN pPrevJ = pJ - 1
IF ConvAng# = 180 THEN pPrevI = pI + 1
IF ConvAng# = 270 THEN pPrevJ = pJ + 1
YROTATE OBJECT 100, PAng#
IF pPrevI > levW OR pPrevJ > levH OR pPrevI < 1 OR pPrevJ < 1
prevSquare = 0
RETURN
ENDIF
prevSquare = level(pPrevI, pPrevJ)
RETURN
GameOver:
SpaceDown = 1
Running = 0
Action = 0
Stopped = 0
Movement# = 0.0
FOR Key = 1 TO numQMoves
IF Key <= numQMoves AND qMoves(Key) <> 0
levelMoves(qMoveKeys(Key)) = qMoves(Key)
qMoves(Key) = 0
qMoveKeys(Key) = 0
ENDIF
NEXT Key
numQMoves = 0
DO
CENTER TEXT scrW/2, 25, "YOU FAILED. PRESS SPACE TO TRY AGAIN OR ESC TO QUIT."
IF KEYSTATE(57) = 1 AND SpaceDown = 0 THEN SpaceDown = 1 : GOSUB RESTART
IF KEYSTATE(57) = 0 AND SpaceDown = 1 THEN SpaceDown = 0
SYNC
LOOP
RETURN
FUNCTION FreeObject()
FOR i = 1 TO 65535
IF OBJECT EXIST(i) = 0 THEN EXITFUNCTION i
NEXT i
ENDFUNCTION -1
FUNCTION KeyToInt(K as String)
iKey = ASC(K)
IF iKey > 96 AND iKey < 123
EXITFUNCTION iKey - 96
ENDIF
IF iKey > 64 AND iKey < 97
EXITFUNCTION iKey + 36
ENDIF
ENDFUNCTION 0
Function Make_Robot(ObjectID)
If Object Exist (ObjectID) Then Delete Object ObjectID
Make Object Cube ObjectID,5
If Object Exist(2) Then Delete Object 2
If Mesh Exist(2) Then Delete Mesh 2
Make Object Sphere 2,5
Make Mesh From Object 2,2
Add Limb ObjectID,1,2
Offset Limb ObjectID,1,0,4,0
Delete Mesh 2
Delete Object 2
Make Object Cylinder 2,4
Scale Object 2,30,100,30
Offset Limb 2,0,0,2,0
Roll Object Right 2,100
Fix Object Pivot 2
Make Mesh From Object 2,2
Add Limb ObjectID,2,2
Add Limb ObjectID,3,2
Offset Limb ObjectID,2,0,1,-3
Offset Limb ObjectID,3,0,1,3
Color Limb ObjectID,2,RGB(128,128,128)
Color Limb ObjectID,3,RGB(128,128,128)
Delete Mesh 2
Delete Object 2
Make Object Cylinder 2,10
Scale Object 2,100,20,20
Pitch Object Down 2,90
Fix Object Pivot 2
Make Mesh From Object 2,2
Add Limb ObjectID,4,2
Add Limb ObjectID,5,2
Offset Limb ObjectID,4,0,-3,-3
Offset Limb ObjectID,5,0,-3,3
Delete Object 2
Delete Mesh 2
Make Object Sphere 2,10
Scale Object 2,100,20,1
Make Mesh from Object 2,2
Add Limb ObjectID,6,2
Add Limb ObjectID,7,2
Offset Limb ObjectID,6,0,-3,-3.9
Offset Limb ObjectID,7,0,-3,3.9
Delete Object 2
Delete Mesh 2
Set Object Cull ObjectID,0
Turn Object Left ObjectID,90
Fix Object Pivot ObjectID
Color Object ObjectID, RGB(255, 255, 0) `Robot.Color
If Bitmap Exist(1) Then Delete Bitmap 1
Create Bitmap 1,100,20
Set Current Bitmap 1
Ink RGB(210,210,210),0
Box 0,0,99,19
Ink Rgb(40,40,40),0
For i = 0 to 90 step 10
Box i,0,i+1,19
Next i
Get Image 1,0,0,99,19
Delete Bitmap 1
Texture Limb ObjectID,4,1
Texture Limb ObjectID,5,1
Set Object Collision Off ObjectID
Set Object Collision to Boxes ObjectID
EndFunction R
DATA 5, 5
DATA 2, 1, 5, 1, 1
DATA 1, 6, 1, 6, 1
DATA 1, 6, 3, 6, 1
DATA 1, 1, 6, 1, 1
DATA 1, 1, 1, 1, 1
DATA 6
DATA 1, 1, 4, 5, 6, 2
DATA 5, 5
DATA 1, 1, 1, 1, 1
DATA 1, 6, 1, 6, 5
DATA 1, 6, 2, 6, 11
DATA 1, 6, 6, 6, 5
DATA 1, 1, 1, 1, 3
DATA 9
DATA 6, 2, 6, 2, 1, 2, 4, 1, 4
` Objects:
` 1 = Grey square
` 2 = Blue square (start)
` 3 = Green square (end)
` 4 = Black square
` 5 = Red square (Rotates RIGHT)
` 6 = Yellow square (WALL)
` 7 = Purple (Rotates to the upper left)
` 8 = Purple (Rotates to the lower right)
` 9 = Purple (rotates lower left)
` 10 = Purple (Rotates upper right)
` 11 = Red Square (Rotates LEFT)
` Moves:
` 1 = "Forward 1"
` 2 = "Forward 2"
` 3 = "Forward 3"
` 4 = "Rotate Left"
` 5 = "Rotate Right"
` 6 = "Rotate 180"
` 7 = "Backward 1"
Data 5, 5 `DIMENSIONS OF LEVEL: Can be any amount. The first is Width and the Second... HEIGHT.
Data 2, 1, 7, 4, 1 `The next 5 (HEIGHT) lines contain the objects of the level
Data 4, 4, 7, 4, 3 `The levels are reversed vertically when it renders. I am lazy therefore.
Data 7, 9, 9, 4, 1
Data 1, 1, 1, 1, 1
Data 1, 1, 1, 1, 1
Data 7 `Number of possible moves
Data 5, 2, 2, 2, 4, 5, 3 `Then the list of moves.