Ok, it's 11:30 now, a bit earlier than last night's entry but if I stay up later I won't be able to get up early tomorrow morning. So here it is, my final version, which is by far, the coolest program I have ever created.
NEW in this version:
+create up to 8 different extra box with 3 different modes
+light boxes that are knocked into the air
+heavy boxes that are pushed along the surface
+and exploding boxes that explode on impact!!!
+each box can be placed anywhere on the surface
+this means you can now put 8 exploding boxes all around the main box for a massive explosion!!!
+warning! it may be just my computer but for 6 or more boxes the whole room becomes charred by the explosion!!!
+also, so many particles can slow down the program
stuff from last version include:
+camera zoom in and out
+camera rotation on or off
+slow-motion effect on or off
Rem Project: MyExplosion
Rem Created: 13/05/2008 7:29:54 PM
Rem Author: sinisterstuf
`yeah, the forum settings don't allow my name like that because
`it's apparantly too long. What a pity. Hope you like this program!
`And thanks to Papa Stiffy for showing me an easy way to rotate cameras
Rem setup
HIDE MOUSE
AUTOCAM OFF
SYNC ON
SYNC RATE 120
Rem the textures for the sparks
CREATE BITMAP 1,16,16
x1=7
x2=8
REPEAT
LINE 0,y,15,y
INC y
IF x1=0 THEN flag=1
IF flag=0 THEN DEC x1 : INC x2
IF flag=1 THEN INC x1 : DEC x2
UNTIL y=15
GET IMAGE 1,0,0,15,15
CLS
SET CURRENT BITMAP 0
Rem the box is on a surface
MAKE OBJECT PLAIN 2,270,270
ROTATE OBJECT 2,270,0,0
COLOR OBJECT 2,RGB(223,157,2)
Rem I don't like the blue background but what can I do?
MAKE OBJECT SPHERE 8,500
POSITION OBJECT 8,0,0,0
COLOR OBJECT 8,RGB(0,0,0)
SET OBJECT CULL 8,0
SET OBJECT SPECULAR 8,RGB(0,0,0)
SET OBJECT DIFFUSE 8,RGB(0,0,0)
Rem the box with explosives in:
make_face(3,0,10,0,270,0,0) `the box's detachable top face
make_face(4,5,5,0,0,90,0) `the box's detachable right face
make_face(5,0,5,-5,0,0,0) `the box's detachable front face
make_face(6,-5,5,0,0,-90,0) `the box's detachable left face
make_face(7,0,5,5,0,180,0) `the box's detachable back face
Rem more optional boxes
make_box(9,50,50)
make_box(10,-50,-50)
make_box(11,50,-50)
make_box(12,-50,50)
make_box(13,50,0)
make_box(14,-50,0)
make_box(15,0,50)
make_box(16,0,-50)
Rem all the explosives for incase the boxes are set to contain them
make_explosives(6,7,8,9,17,3,50,50)
make_explosives(10,11,12,13,18,4,-50,-50)
make_explosives(14,15,16,17,19,5,50,-50)
make_explosives(18,19,20,21,20,6,-50,50)
make_explosives(22,23,24,25,21,7,50,0)
make_explosives(26,27,28,29,22,8,-50,0)
make_explosives(30,31,32,33,23,9,0,50)
make_explosives(34,35,36,37,24,10,0,-50)
Rem sparks will fly out of the box
MAKE PARTICLES 1,1,30,30
SET PARTICLE VELOCITY 1,5
SET PARTICLE GRAVITY 1,1
SET PARTICLE LIFE 1,50
HIDE PARTICLES 1
MAKE PARTICLES 3,1,30,30
SET PARTICLE VELOCITY 3,1
SET PARTICLE GRAVITY 3,1
SET PARTICLE LIFE 3,50
HIDE PARTICLES 3
MAKE PARTICLES 4,1,30,30
SET PARTICLE VELOCITY 4,1
SET PARTICLE GRAVITY 4,0
SET PARTICLE LIFE 4,25
HIDE PARTICLES 4
MAKE PARTICLES 5,1,30,30
SET PARTICLE VELOCITY 5,10
SET PARTICLE GRAVITY 5,5
SET PARTICLE LIFE 5,25
HIDE PARTICLES 5
Rem and a massive explosion shockwave
MAKE OBJECT SPHERE 1,5
COLOR OBJECT 1,RGB(255,255,0)
POSITION OBJECT 1,0,2,0
GHOST OBJECT ON 1
Rem and this light:
MAKE LIGHT 2
SET POINT LIGHT 2,0,2,0
COLOR LIGHT 2,250,250,200
SET LIGHT RANGE 2,1
HIDE LIGHT 2
Rem and smoke from the ground at the end
MAKE PARTICLES 2,1,50,50
COLOR PARTICLES 2,20,20,20
POSITION PARTICLES 2,0,-10,0
SET PARTICLE EMISSIONS 2,1
SET PARTICLE GRAVITY 2,-10
SET PARTICLE VELOCITY 2,1
SET PARTICLE SPEED 2,0.001
GHOST PARTICLES ON 2,3
HIDE PARTICLES 2
Rem this is supposed to make the box look cooler...
MAKE LIGHT 1
SET SPOT LIGHT 1,5,10
POSITION LIGHT 1,100,30,-100
COLOR LIGHT 1,235,235,170
SET LIGHT RANGE 1,50
POINT LIGHT 1,30,5,-30
Rem position a camera
POSITION CAMERA 0,55,35,-100
POINT CAMERA 0,0,0,0
Rem these are some variables for the explosion loop
hor#=5
scale#=5
flag=0
count=1
camrot#=5
up#=10
bncflag=0
parcol=20
b=0
overlap=0
Rem you now get to choose a whole load of effects!!!
REPEAT
IF SPACEKEY()=1 AND b<8
INC b,1
IF CONTROLKEY()=1 AND overlap=0
IF b=1 THEN boxprop1=1
IF b=2 THEN boxprop2=1
IF b=3 THEN boxprop3=1
IF b=4 THEN boxprop4=1
IF b=5 THEN boxprop5=1
IF b=6 THEN boxprop6=1
IF b=7 THEN boxprop7=1
IF b=8 THEN boxprop8=1
boxprop=1
overlap=1
ENDIF
IF SHIFTKEY()=1 AND overlap=0
IF b=1 THEN boxprop1=2
IF b=2 THEN boxprop2=2
IF b=3 THEN boxprop3=2
IF b=4 THEN boxprop4=2
IF b=5 THEN boxprop5=2
IF b=6 THEN boxprop6=2
IF b=7 THEN boxprop7=2
IF b=8 THEN boxprop8=2
boxprop=2
overlap=1
ENDIF
WAIT 300
SHOW OBJECT (b+8)
xpos#=OBJECT POSITION X(b+8) : ypos#=OBJECT POSITION Y(b+8) : zpos#=OBJECT POSITION Y(b+8)
REPEAT
IF boxprop=0 THEN TEXT 0,0,"EMPTY BOX"
IF boxprop=1 THEN TEXT 0,0,"HEAVY BOX"
IF boxprop=2 THEN TEXT 0,0,"EXPLODING BOX"
TEXT 150,90,"ARROW KEYS TO POSITION"
TEXT 150,120,"SPACEBAR TO CONFIRM"
IF UPKEY()=1 THEN move_box((b+8),0,0.1)
IF DOWNKEY()=1 THEN move_box((b+8),0,-0.1)
IF LEFTKEY()=1 THEN move_box((b+8),-0.1,0)
IF RIGHTKEY()=1 THEN move_box((b+8),0.1,0)
SYNC
UNTIL SPACEKEY()=1
POINT OBJECT (b+8),0,5,0
overlap=0
boxprop=0
WAIT 300
ENDIF
IF MOUSECLICK()=1 THEN flag=1
IF MOUSECLICK()=2 THEN flag=2 : slowmoflag=1
IF RETURNKEY()=1 AND spin=0 THEN spin=1 : WAIT 300
IF RETURNKEY()=1 AND spin=1 THEN spin=0 : WAIT 300
IF UPKEY()=1 AND CAMERA POSITION Y()>10 THEN MOVE CAMERA 1
IF DOWNKEY()=1 AND CAMERA POSITION Y()<40 THEN XROTATE CAMERA 17 : MOVE CAMERA -1
IF spin=0
camrot#=CAMERA ANGLE Y()
ROTATE CAMERA 0,0,(camrot#+90),0
MOVE CAMERA 2
ROTATE CAMERA 0,0,(camrot#-90),0
POINT CAMERA 0,0,0
ENDIF
TEXT 150,150,"CLICK TO DETONATE THE BOMB IN THE BOX"
TEXT 200,290,"[RIGHT-CLICK FOR SLOW MOTION]"
TEXT 200,320,"[SPACEBAR TO ADD AN EMPTRY BOX]"
TEXT 200,350,"[CTRL+SPACEBAR TO ADD A HEAVY BOX]"
TEXT 200,380,"[SHIFT+SPACEBAR TO ADD AN EXPLODING BOX]"
TEXT 200,410,"[ARROW KEYS TO ZOOM]"
TEXT 200,440,"[ENTER TO TOGGLE CAMERA ROTATION]"
SYNC
UNTIL flag>0
IF flag=1 THEN scaleup#=64 : rotup#=2 : verup#=1 : horup#=.5 : parspeed#=0.008 : split=25 : camspeed#=2
IF flag=2 THEN scaleup#=16 : rotup#=.5 : verup#=.25 : horup#=.125 : parspeed#=0.002 : split=100 : camspeed#=0.5
flag=0
`makes explosion light and particles visible. duh.
SHOW PARTICLES 1
SET PARTICLE SPEED 1,parspeed#
SHOW PARTICLES 3
SET PARTICLE SPEED 3,parspeed#
SHOW PARTICLES 4
SET PARTICLE SPEED 4,parspeed#
SHOW PARTICLES 5
SET PARTICLE SPEED 5,parspeed#
SHOW LIGHT 2
Rem this is so that escape will delete all objects on exit; escape end loop below
DISABLE ESCAPEKEY
```````````````````````````````***MAIN LOOP***```````````````````````````````
REPEAT
`increments all movement variables
INC scale#,scaleup#
INC rot#,rotup#
INC ver#,verup#
INC hor#,horup#
IF flag=0 THEN INC up#,verup#
IF flag=1 THEN DEC up#,(verup#/2)
INC count
`"randomly" spins the box's faces
IF flag<3 THEN ROTATE OBJECT 3,rot#,(2*rot#),rot#
ROTATE OBJECT 4,(2*rot#),rot#,(rot#/2)
ROTATE OBJECT 5,rot#,rot#,(2*rot#)
ROTATE OBJECT 6,rot#,(3*rot#),rot#
ROTATE OBJECT 7,(3*rot#),rot#,rot#
`makes the faces fly apart
IF flag<3 THEN POSITION OBJECT 3,0,up#,0
POSITION OBJECT 4,ver#,hor#,5
POSITION OBJECT 5,-5,hor#,ver#
POSITION OBJECT 6,-ver#,hor#,-5
POSITION OBJECT 7,5,hor#,-ver#
`light and ghosted sphere expand with explosion
SCALE OBJECT 1,scale#,scale#,scale#
SET LIGHT RANGE 2,scale#
`yellow then white particles are produced ...and some other timed effects too
IF count>10 THEN smoke=1
IF count=split THEN COLOR PARTICLES 1,255,255,0 : COLOR PARTICLES 3,255,255,0 : COLOR PARTICLES 4,255,255,0 : COLOR PARTICLES 5,255,255,0
IF count=(2*split) THEN SET PARTICLE EMISSIONS 1,0 : SET PARTICLE EMISSIONS 3,0 : SET PARTICLE EMISSIONS 4,0 : SET PARTICLE EMISSIONS 5,0
IF count=(4*split) THEN flag=1
IF smoke=1
IF smokeon=0 THEN SHOW PARTICLES 2 : smokeon=1
ROTATE PARTICLES 2,0,-rot#,0
IF emit=8 AND emitf=0 THEN emitf=1
IF emit=-8 AND emitf=1 THEN emitf=0
IF emit<8 AND emitf=0 THEN INC emit
IF emit>-8 AND emitf=1 THEN DEC emit
POSITION PARTICLE EMISSIONS 2,0,emit,0 : `This makes smoke
ENDIF
IF boxprop1=0 AND OBJECT HIT(9,1) THEN boxflag1=1
IF boxprop1=1 AND OBJECT COLLISION(9,1) THEN boxflag1=2
IF boxprop1=2 AND OBJECT COLLISION(9,1) THEN boxflag1=3
IF boxprop2=0 AND OBJECT HIT(10,1) THEN boxflag2=1
IF boxprop2=1 AND OBJECT COLLISION(10,1) THEN boxflag2=2
IF boxprop2=2 AND OBJECT COLLISION(10,1) THEN boxflag2=3
IF boxprop3=0 AND OBJECT HIT(11,1) THEN boxflag3=1
IF boxprop3=1 AND OBJECT COLLISION(11,1) THEN boxflag3=2
IF boxprop3=2 AND OBJECT COLLISION(11,1) THEN boxflag3=3
IF boxprop4=0 AND OBJECT HIT(12,1) THEN boxflag4=1
IF boxprop4=1 AND OBJECT COLLISION(12,1) THEN boxflag4=2
IF boxprop4=2 AND OBJECT COLLISION(12,1) THEN boxflag4=3
IF boxprop5=0 AND OBJECT HIT(13,1) THEN boxflag5=1
IF boxprop5=1 AND OBJECT COLLISION(13,1) THEN boxflag5=2
IF boxprop5=2 AND OBJECT COLLISION(13,1) THEN boxflag5=3
IF boxprop6=0 AND OBJECT HIT(14,1) THEN boxflag6=1
IF boxprop6=1 AND OBJECT COLLISION(14,1) THEN boxflag6=2
IF boxprop6=2 AND OBJECT COLLISION(14,1) THEN boxflag6=3
IF boxprop7=0 AND OBJECT HIT(15,1) THEN boxflag7=1
IF boxprop7=1 AND OBJECT COLLISION(15,1) THEN boxflag7=2
IF boxprop7=2 AND OBJECT COLLISION(15,1) THEN boxflag7=3
IF boxprop8=0 AND OBJECT HIT(16,1) THEN boxflag8=1
IF boxprop8=1 AND OBJECT COLLISION(16,1) THEN boxflag8=2
IF boxprop8=2 AND OBJECT COLLISION(16,1) THEN boxflag8=3
IF boxflag1=1
IF xx1=0 THEN PITCH OBJECT DOWN 9,40 : xx1=1
MOVE OBJECT 9,(-horup#*2)
ENDIF
IF boxflag1=2
MOVE OBJECT 9,(-horup#)
ENDIF
IF boxflag1=3
detonate_box(9,6,7,8,9,17,3,(scale#-(counter*scaleup#)))
ENDIF
IF boxflag2=1
IF xx2=0 THEN PITCH OBJECT DOWN 10,40 : xx2=1
MOVE OBJECT 10,(-horup#*2)
ENDIF
IF boxflag2=2
MOVE OBJECT 10,(-horup#)
ENDIF
IF boxflag2=3
detonate_box(10,10,11,12,13,18,4,(scale#-(counter*scaleup#)))
ENDIF
IF boxflag3=1
IF xx3=0 THEN PITCH OBJECT DOWN 11,40 : xx3=1
MOVE OBJECT 11,(-horup#*2)
ENDIF
IF boxflag3=2
MOVE OBJECT 11,(-horup#)
ENDIF
IF boxflag3=3
detonate_box(11,14,15,16,17,19,5,(scale#-(counter*scaleup#)))
ENDIF
IF boxflag4=1
IF xx4=0 THEN PITCH OBJECT DOWN 12,40 : xx4=1
MOVE OBJECT 12,(-horup#*2)
ENDIF
IF boxflag4=2
MOVE OBJECT 12,(-horup#)
ENDIF
IF boxflag4=3
detonate_box(12,18,19,20,21,20,6,(scale#-(counter*scaleup#)))
ENDIF
IF boxflag5=1
IF xx5=0 THEN PITCH OBJECT DOWN 13,40 : xx5=1
MOVE OBJECT 13,(-horup#*2)
ENDIF
IF boxflag5=2
MOVE OBJECT 13,(-horup#)
ENDIF
IF boxflag5=3
detonate_box(13,22,23,24,25,21,7,(scale#-(counter*scaleup#)))
ENDIF
IF boxflag6=1
IF xx6=0 THEN PITCH OBJECT DOWN 14,40 : xx6=1
MOVE OBJECT 14,(-horup#*2)
ENDIF
IF boxflag6=2
MOVE OBJECT 14,(-horup#)
ENDIF
IF boxflag6=3
detonate_box(14,26,27,28,29,22,8,(scale#-(counter*scaleup#)))
ENDIF
IF boxflag7=1
IF xx7=0 THEN PITCH OBJECT DOWN 15,40 : xx7=1
MOVE OBJECT 15,(-horup#*2)
ENDIF
IF boxflag7=2
MOVE OBJECT 15,(-horup#)
ENDIF
IF boxflag7=3
detonate_box(15,30,31,32,33,23,9,(scale#-(counter*scaleup#)))
ENDIF
IF boxflag8=1
IF xx8=0 THEN PITCH OBJECT DOWN 16,40 : xx8=1
MOVE OBJECT 16,(-horup#*2)
ENDIF
IF boxflag8=2
MOVE OBJECT 16,(-horup#)
ENDIF
IF boxflag8=3
detonate_box(16,34,35,36,37,24,10,(scale#-(counter*scaleup#)))
ENDIF
IF OBJECT COLLISION(2,3)=1 AND flag<3 THEN flag=3
IF flag=3
xr#=OBJECT ANGLE X(3) : yr#=OBJECT ANGLE Y(3) : zr#=OBJECT ANGLE Z(3)
IF ff=0 THEN xp#=OBJECT POSITION X(3) : yp#=OBJECT POSITION Y(3) : zp#=OBJECT POSITION Z(3) : ff=1
IF OBJECT ANGLE X(3)>450 THEN DEC xr#,rotup#
IF OBJECT ANGLE Z(3)>360 THEN DEC zr#,rotup#
IF yp#=90 AND bncflag=0 THEN bncflag=1
IF yp#<90 AND bncflag=0 THEN INC xp#,(horup#/3) : INC yp#,(verup#/2) : INC zp#,(horup#/3)
IF yp#>0 AND bncflag=1 THEN INC xp#,(horup#/3) : DEC yp#,(verup#/2) : INC zp#,(horup#/3)
DEC yr#,rotup#
ROTATE OBJECT 3,xr#,yr#,zr#
POSITION OBJECT 3,xp#,yp#,zp#
IF bncflag=1 AND OBJECT COLLISION(2,3)=1 THEN flag=4 : POSITION OBJECT 3,xp#,yp#+1,zp#
ENDIF
IF flag=4
IF parcol>0 THEN DEC parcol
COLOR PARTICLES 2,parcol,parcol,parcol
IF parcol=0 THEN SET PARTICLE EMISSIONS 2,-2 : flag=5
ENDIF
`The camera spins if 'spin' has been set to 0
`Thanks to Papa Stiffy for showing me this easy-to-use camera rotation method
IF spin=0
IF flag=5 AND camspeed#>0 THEN DEC camspeed#,0.0078125
camrot#=CAMERA ANGLE Y()
ROTATE CAMERA 0,0,(camrot#+90),0
MOVE CAMERA camspeed#
ROTATE CAMERA 0,0,(camrot#-90),0
POINT CAMERA 0,0,0
ENDIF
`Displays effect modes on the screen
IF slowmoflag=1 THEN TEXT 470,0,"SLOW-MOTION ACTIVATED"
SYNC
UNTIL ESCAPEKEY()=1
`yes, sadly everything has to be deleted again ;)
DELETE IMAGE 1
DELETE BITMAP 1
count=0
REPEAT
INC count
IF count<11 THEN DELETE LIGHT count
IF count<25 THEN DELETE OBJECT count
DELETE PARTICLES count
UNTIL count=37
CLS
END
Rem This is for making cube faces:
FUNCTION make_face(n,a,b,c,d,e,f)
MAKE OBJECT PLAIN n,10,10
POSITION OBJECT n,a,b,c
ROTATE OBJECT n,d,e,f
COLOR OBJECT n,RGB(155,78,0)
ENDFUNCTION
Rem this is for making additional boxes
FUNCTION make_box(n,x,z)
MAKE OBJECT CUBE n,10
POSITION OBJECT n,x,5,z
COLOR OBJECT n,RGB(155,78,0)
HIDE OBJECT n
ENDFUNCTION
Rem This is for making explosion effects for all the boxes
FUNCTION make_explosives(n1,n2,n3,n4,n5,n6,x,z)
Rem sparks will fly out of the box
MAKE PARTICLES n1,1,30,30
POSITION PARTICLES n1,x,0,z
SET PARTICLE VELOCITY n1,5
SET PARTICLE GRAVITY n1,1
SET PARTICLE LIFE n1,50
HIDE PARTICLES n1
MAKE PARTICLES n2,1,30,30
POSITION PARTICLES n2,x,0,z
SET PARTICLE VELOCITY n2,1
SET PARTICLE GRAVITY n2,1
SET PARTICLE LIFE n2,50
HIDE PARTICLES n2
MAKE PARTICLES n3,1,30,30
POSITION PARTICLES n3,x,0,z
SET PARTICLE VELOCITY n3,1
SET PARTICLE GRAVITY n3,0
SET PARTICLE LIFE n3,25
HIDE PARTICLES n3
MAKE PARTICLES n4,1,30,30
POSITION PARTICLES n4,x,0,z
SET PARTICLE VELOCITY n4,10
SET PARTICLE GRAVITY n4,5
SET PARTICLE LIFE n4,25
HIDE PARTICLES n4
Rem and a massive explosion shockwave
MAKE OBJECT SPHERE n5,5
COLOR OBJECT n5,RGB(255,255,0)
POSITION OBJECT n5,x,2,z
GHOST OBJECT ON n5
HIDE OBJECT n5
Rem and this light:
MAKE LIGHT n6
SET POINT LIGHT n6,x,2,z
COLOR LIGHT n6,250,250,200
SET LIGHT RANGE n6,1
HIDE LIGHT n6
ENDFUNCTION
Rem This is used to move a box and all it's explosive effects during edit
FUNCTION move_box(n,x#,z#)
xpos#=OBJECT POSITION X(n)+x#
zpos#=OBJECT POSITION Z(n)+z#
IF OBJECT HIT(n,4) THEN INC xpos#,0.1
IF OBJECT HIT(n,5) THEN DEC zpos#,0.1
IF OBJECT HIT(n,6) THEN DEC xpos#,0.1
IF OBJECT HIT(n,7) THEN INC zpos#,0.1
POSITION OBJECT n,xpos#,5,zpos#
IF n=9
POSITION PARTICLES 6,xpos#,0,zpos#
POSITION PARTICLES 7,xpos#,0,zpos#
POSITION PARTICLES 8,xpos#,0,zpos#
POSITION PARTICLES 9,xpos#,0,zpos#
POSITION OBJECT 17,xpos#,2,zpos#
POSITION LIGHT 3,xpos#,2,zpos#
ENDIF
IF n=10
POSITION PARTICLES 10,xpos#,0,zpos#
POSITION PARTICLES 11,xpos#,0,zpos#
POSITION PARTICLES 12,xpos#,0,zpos#
POSITION PARTICLES 13,xpos#,0,zpos#
POSITION OBJECT 18,xpos#,2,zpos#
POSITION LIGHT 4,xpos#,2,zpos#
ENDIF
IF n=11
POSITION PARTICLES 14,xpos#,0,zpos#
POSITION PARTICLES 15,xpos#,0,zpos#
POSITION PARTICLES 16,xpos#,0,zpos#
POSITION PARTICLES 17,xpos#,0,zpos#
POSITION OBJECT 19,xpos#,2,zpos#
POSITION LIGHT 5,xpos#,2,zpos#
ENDIF
IF n=12
POSITION PARTICLES 18,xpos#,0,zpos#
POSITION PARTICLES 19,xpos#,0,zpos#
POSITION PARTICLES 20,xpos#,0,zpos#
POSITION PARTICLES 21,xpos#,0,zpos#
POSITION OBJECT 20,xpos#,2,zpos#
POSITION LIGHT 6,xpos#,2,zpos#
ENDIF
IF n=13
POSITION PARTICLES 22,xpos#,0,zpos#
POSITION PARTICLES 23,xpos#,0,zpos#
POSITION PARTICLES 24,xpos#,0,zpos#
POSITION PARTICLES 25,xpos#,0,zpos#
POSITION OBJECT 21,xpos#,2,zpos#
POSITION LIGHT 7,xpos#,2,zpos#
ENDIF
IF n=14
POSITION PARTICLES 26,xpos#,0,zpos#
POSITION PARTICLES 27,xpos#,0,zpos#
POSITION PARTICLES 28,xpos#,0,zpos#
POSITION PARTICLES 29,xpos#,0,zpos#
POSITION OBJECT 22,xpos#,2,zpos#
POSITION LIGHT 8,xpos#,2,zpos#
ENDIF
IF n=15
POSITION PARTICLES 30,xpos#,0,zpos#
POSITION PARTICLES 31,xpos#,0,zpos#
POSITION PARTICLES 32,xpos#,0,zpos#
POSITION PARTICLES 33,xpos#,0,zpos#
POSITION OBJECT 23,xpos#,2,zpos#
POSITION LIGHT 9,xpos#,2,zpos#
ENDIF
IF n=16
POSITION PARTICLES 34,xpos#,0,zpos#
POSITION PARTICLES 35,xpos#,0,zpos#
POSITION PARTICLES 36,xpos#,0,zpos#
POSITION PARTICLES 37,xpos#,0,zpos#
POSITION OBJECT 24,xpos#,2,zpos#
POSITION LIGHT 10,xpos#,2,zpos#
ENDIF
ENDFUNCTION
Rem This is to detonate boxes on contact with shockwave
FUNCTION detonate_box(n,p1,p2,p3,p4,s,l,scale#)
`box explodes
HIDE OBJECT n
SHOW OBJECT s
SHOW LIGHT l
SHOW PARTICLES p1 : COLOR PARTICLES p1,255,255,0
SHOW PARTICLES p2 : COLOR PARTICLES p2,255,255,0
SHOW PARTICLES p3 : COLOR PARTICLES p3,255,255,0
SHOW PARTICLES p4 : COLOR PARTICLES p4,255,255,0
`light and ghosted sphere expand with explosion
SCALE OBJECT s,scale#,scale#,scale#
SET LIGHT RANGE l,scale#
IF scale#>5000 THEN SET PARTICLE EMISSIONS p1,0 : SET PARTICLE EMISSIONS p2,0 : SET PARTICLE EMISSIONS p3,0 : SET PARTICLE EMISSIONS p4,0
ENDFUNCTION
This code is alot in my opinion. I hope you enjoy playing with what I have decided to call:
Sinister_Explosion_Maker_3. And if you experiences any problems or find bugs... which there might be. Or if you have any sugesstions then tell me because even though by the time you do it will be too late for me to do anything about it I would still like to know.
Things I didn't have time to add:
+play again prompt
+auto-explosion countdown timer with animated fuse

shows you not to wait till the last minute.
Enjoy!
Happy, always happy!