SYNC ON : SYNC RATE 60 : HIDE MOUSE
SET DISPLAY MODE 1024,768,32
 
SET TEXT SIZE 28 : SET TEXT FONT "Impact"
SYNC : CENTER TEXT 512,350,"Loading..." : SYNC
 
INK RGB(200,200,200),0
BOX 1,1,128,128
FOR I=0 TO 2000
   COLR=RND(255)
   INK RGB(COLR,COLR,COLR),0
   DOT RND(128),RND(128)
NEXT I
GET IMAGE 1,1,1,128,128
 
CREATE BITMAP 1,128,128
SET CURRENT BITMAP 1
FOR I=1 TO 16
   FOR J=1 TO 16
      IF RND(1)=1
         INK RGB(255,0,0),0
      ELSE
         INK RGB(255,255,0),0
      ENDIF
      BOX ((J*8)-8),((I*8)-8),(J*8),(I*8)
   NEXT J
NEXT I
BLUR BITMAP 1,6
GET IMAGE 2,1,1,128,128
SET CURRENT BITMAP 0
DELETE BITMAP 1
 
MAKE MATRIX 1,5000,5000,5,5
PREPARE MATRIX TEXTURE 1,1,1,1
SET MATRIX TEXTURE 1,1,1
FOR I=1 TO 4
   SET MATRIX HEIGHT 1,I,1,1000
   SET MATRIX HEIGHT 1,I,4,1000
NEXT I
FOR I=2 TO 3
   SET MATRIX HEIGHT 1,1,I,1000
   SET MATRIX HEIGHT 1,2,I,1000
   SET MATRIX HEIGHT 1,3,I,1000
   SET MATRIX HEIGHT 1,4,I,1000
NEXT I
SET MATRIX HEIGHT 1,2,2,0
SET MATRIX HEIGHT 1,3,3,0
SET MATRIX HEIGHT 1,1,4,0
SET MATRIX HEIGHT 1,4,1,0
UPDATE MATRIX 1
 
LAVA=2
MAKE MATRIX LAVA,7500,7500,50,50
PREPARE MATRIX TEXTURE LAVA,2,1,1
SET MATRIX TEXTURE LAVA,1,1
SET MATRIX LAVA,0,0,1,1,1,1,1
 
PLR=1
MAKE OBJECT SPHERE PLR,50,12,12
SET OBJECT COLLISION ON PLR
 
FOG ON : FOG COLOR RGB(255,60,0) : FOG DISTANCE 1500
BACKDROP ON : COLOR BACKDROP RGB(255,60,0)
 
START:
PLRA=90 : PLRY#=GET GROUND HEIGHT(1,1000,1000)+25
DIM LAVASIN(50,50)
COLOR OBJECT PLR,RGBB(200)
POSITION OBJECT PLR,1000,PLRY#,1000
YROTATE OBJECT PLR,PLRA
 
FOR I=1 TO 50
   FOR J=1 TO 50
      LAVASIN(I,J)=RND(360)
   NEXT J
NEXT I
 
POSITION MATRIX LAVA,-1250,0,-1250
 
DO
   IF UPKEY()=1 THEN MOVE OBJECT PLR,20
   IF LEFTKEY()=1 THEN PLRA=PLRA-2
   IF RIGHTKEY()=1 THEN PLRA=PLRA+2
   YROTATE OBJECT PLR,PLRA
   PLRY#=GET GROUND HEIGHT(1,OBJECT POSITION X(PLR),OBJECT POSITION Z(PLR))+25
   POSITION OBJECT PLR,OBJECT POSITION X(PLR),PLRY#,OBJECT POSITION Z(PLR)
   SET CAMERA TO OBJECT ORIENTATION PLR
   POSITION CAMERA OBJECT POSITION X(PLR),PLRY#+100,OBJECT POSITION Z(PLR)
   MOVE CAMERA -175 : POINT CAMERA OBJECT POSITION X(PLR),PLRY#+15,OBJECT POSITION Z(PLR)
 
   POSITION MATRIX 1,RND(5),RND(5),RND(5)
 
   POSITION MATRIX LAVA,-1250,MATRIX POSITION Y(LAVA)+1,-1250
   IF OBJECT POSITION Y(PLR)<=MATRIX POSITION Y(LAVA) THEN GOSUB DEATH
 
   FOR I=1 TO 50
      FOR J=1 TO 50
         INC LAVASIN(I,J),5
         IF LAVASIN(I,J)>360 THEN LAVASIN(I,J)=0
         SET MATRIX HEIGHT LAVA,I,J,SIN(LAVASIN(I,J))*50
      NEXT J
   NEXT I
   UPDATE MATRIX LAVA
 
   SYNC
LOOP
 
DEATH:
   INK RGB(255,255,255),0
   COLOR OBJECT PLR,0 : SYNC
   CENTER TEXT 512,350,"You Died" : SYNC
   SLEEP 1000 : CLS
   GOSUB START