I think my enemies are workable now...it's just that I don't know how to make them attack or evade yet, letalone shoot your own weapon
SYNC ON : SYNC RATE 0 : HIDE MOUSE
SET DISPLAY MODE 320,240,32
SET TEXT SIZE 12 : SET TEXT FONT "MT Extra"
SYNC : CENTER TEXT 160,120,"Loading..." : SYNC
RANDOMIZE TIMER()
SET IMAGE COLORKEY 0,0,0
RETICLE=1
INK 0,0 : BOX 1,1,34,18
INK RGB(0,255,0),0
LINE 12,1,15,4 : LINE 13,1,16,4
LINE 22,1,19,4 : LINE 23,1,20,4
LINE 15,8,13,10 : LINE 16,8,14,10
LINE 19,8,21,10 : LINE 20,8,22,10
DOT 7,4 : DOT 8,4 : DOT 9,4
DOT 10,5 : DOT 10,6 : DOT 10,7
DOT 9,8 : DOT 8,8 : DOT 7,8
DOT 6,7 : DOT 6,6 : DOT 6,5
DOT 26,4 : DOT 27,4 : DOT 28,4
DOT 29,5 : DOT 29,6 : DOT 29,7
DOT 28,8 : DOT 27,8 : DOT 26,8
DOT 25,7 : DOT 25,6 : DOT 25,5
DOT 7,12 : DOT 8,12 : DOT 7,13 : DOT 8,13
DOT 27,12 : DOT 28,12 : DOT 27,13 : DOT 28,13
DOT 6,14 : DOT 4,15 : DOT 29,14 : DOT 31,15
DOT 2,16 : DOT 3,16 : DOT 2,17 : DOT 3,17
DOT 32,16 : DOT 33,16 : DOT 32,17 : DOT 33,17
DOT 15,4 : DOT 16,4 : DOT 19,4 : DOT 20,4
DOT 13,10 : DOT 14,10 : DOT 21,10 : DOT 22,10
INK RGB(0,165,0),0
DOT 6,12 : DOT 6,13 : DOT 5,14 : DOT 5,15
DOT 29,12 : DOT 29,13 : DOT 30,14 : DOT 30,15
DOT 2,15 : DOT 3,15 : DOT 4,16 : DOT 4,17
DOT 3,18 : DOT 2,18 : DOT 1,17 : DOT 1,16
DOT 32,15 : DOT 33,15 : DOT 34,16 : DOT 34,17
DOT 33,18 : DOT 32,18 : DOT 31,17 : DOT 31,16
DOT 7,11 : DOT 8,11 : DOT 9,11
DOT 7,14 : DOT 8,14 : DOT 9,14
DOT 9,12 : DOT 10,12 : DOT 10,13 : DOT 9,13
DOT 26,11 : DOT 27,11 : DOT 28,11
DOT 26,14 : DOT 27,14 : DOT 28,14
DOT 25,12 : DOT 26,12 : DOT 26,13 : DOT 25,13
GET IMAGE RETICLE,1,1,34,18
WALLS=2
INK RGB(200,200,200),0
BOX 1,1,64,64
INK RGB(180,180,180),0
FOR I=1 TO 50
LINEX=RND(64)
LINEY1=RND(32)
LINEY2=RND(32)+LINEY1
LINE LINEX,LINEY1,LINEX,LINEY2
NEXT I
INK RGB(130,130,130),0
ELLIPSE 32,32,24,24
ELLIPSE 32,32,23,23
INK RGB(255,255,255),0
CIRCLE 32,32,22
GET IMAGE WALLS,1,1,64,64
PILLAR=3
FOR I=1 TO 64
FOR J=1 TO 64
COLR=RND(80)+175
INK RGB(COLR,COLR,COLR),0
DOT J,I
NEXT J
NEXT I
GET IMAGE PILLAR,1,1,64,64
FLOOR=4
INK RGB(25,40,20),0
BOX 1,1,64,64
FOR I=1 TO 20
IF RND(1)=1 : INK RGB(60,60,20),0 : ELSE : INK RGB(20,20,60),0 : ENDIF
DOT RND(64),RND(64)
NEXT I
INK RGB(15,30,15),0
LINE 1,1,1,64 : LINE 22,1,22,64
LINE 44,1,44,64 : LINE 1,20,64,20
LINE 1,42,64,42 : LINE 1,64,64,64
GET IMAGE FLOOR,1,1,64,64
FOR I=1 TO 3
MakeDrone("Class1",I,0,0,0)
NEXT I
POSITION OBJECT 1,-30,0,0
POSITION OBJECT 2,30,0,-20
POSITION OBJECT 3,0,0,35
MAKE OBJECT CYLINDER 4,10 : TEXTURE OBJECT 4,PILLAR : POSITION OBJECT 4,30,0,30
SET OBJECT COLLISION ON 4
MAKE OBJECT BOX 5,150,1,150 : TEXTURE OBJECT 5,FLOOR : POSITION OBJECT 5,0,5.5,0
SET OBJECT COLLISION ON 5
MAKE OBJECT BOX 6,1,10,150 : TEXTURE OBJECT 6,WALLS : POSITION OBJECT 6,-75.5,0,0
SET OBJECT COLLISION ON 6
MAKE OBJECT BOX 7,1,10,150 : TEXTURE OBJECT 7,WALLS : POSITION OBJECT 7,75.5,0,0
SET OBJECT COLLISION ON 7
MAKE OBJECT BOX 8,150,10,1 : TEXTURE OBJECT 8,WALLS : POSITION OBJECT 8,0,0,75.5
SET OBJECT COLLISION ON 8
MAKE OBJECT BOX 9,150,10,1 : TEXTURE OBJECT 9,WALLS : POSITION OBJECT 9,0,0,-75.5
SET OBJECT COLLISION ON 9
MAKE OBJECT BOX 10,150,1,150 : TEXTURE OBJECT 10,FLOOR : POSITION OBJECT 10,0,-5.5,0
SET OBJECT COLLISION ON 10
MAKE OBJECT CYLINDER 11,10 : TEXTURE OBJECT 11,PILLAR : POSITION OBJECT 11,-30,0,30
SET OBJECT COLLISION ON 11
MAKE OBJECT CYLINDER 12,10 : TEXTURE OBJECT 12,PILLAR : POSITION OBJECT 12,-30,0,-30
SET OBJECT COLLISION ON 12
MAKE OBJECT CYLINDER 13,10 : TEXTURE OBJECT 13,PILLAR : POSITION OBJECT 13,30,0,-30
SET OBJECT COLLISION ON 13
GLOBAL PLR=14 : GLOBAL PLRX#=0.0 : GLOBAL PLRY#=0.0
GLOBAL PLRZ#=-30.0 : GLOBAL PLRA#=0.0 : GLOBAL HOVER#=90.0
GLOBAL SCORE=0 : GLOBAL SHIELDS=100 : GLOBAL ENERGY=100
GLOBAL CONCS=8 : THEIGHT=TEXT HEIGHT("ANYTHING")
GLOBAL LASER$="LASER LEVEL 1" : GLOBAL LASERS=2
MAKE OBJECT CUBE PLR,5
SET OBJECT COLLISION ON PLR
SET OBJECT CULL PLR,1
POSITION OBJECT PLR,PLRX#,PLRY#,PLRZ#
INK RGB(0,180,0),0
QUADS1=MakePowerup("Quads",-15,0,-10) : QUADY1=0
TYPE DronesA
SHOOTING AS INTEGER
STATE AS INTEGER
LOS AS INTEGER
COLLISION AS INTEGER
SPEED AS FLOAT
DAMMAGE AS FLOAT
INTEGRITY AS FLOAT
REFLEX AS FLOAT
DESTX AS FLOAT
DESTZ AS FLOAT
XLOCKSTATE AS INTEGER
ZLOCKSTATE AS INTEGER
ENDTYPE
DIM DRONESTAT(3) AS DronesA
FOR I=1 TO 3
DRONESTAT(I).SHOOTING=0
DRONESTAT(I).STATE=1
DRONESTAT(I).LOS=0
DRONESTAT(I).COLLISION=0
DRONESTAT(I).SPEED=(RND(2)/10)+0.1
DRONESTAT(I).DAMMAGE=RND(512)/100
DRONESTAT(I).INTEGRITY=100
DRONESTAT(I).REFLEX=RND(5)/10
DRONESTAT(I).DESTX=(RND(80)-40)
DRONESTAT(I).DESTZ=(RND(80)-40)
DRONESTAT(I).XLOCKSTATE=0
DRONESTAT(I).ZLOCKSTATE=0
NEXT I
DO
IF KEYSTATE(32)=1
PLRX#=NEWXVALUE(PLRX#,PLRA#,0.2)
PLRZ#=NEWZVALUE(PLRZ#,PLRA#,0.2)
ENDIF
IF KEYSTATE(18)=1
PLRX#=NEWXVALUE(PLRX#,PLRA#,-0.2)
PLRZ#=NEWZVALUE(PLRZ#,PLRA#,-0.2)
ENDIF
IF KEYSTATE(42)=1
PLRX#=NEWXVALUE(PLRX#,WRAPVALUE(PLRA#-90),0.2)
PLRZ#=NEWZVALUE(PLRZ#,WRAPVALUE(PLRA#-90),0.2)
ENDIF
IF KEYSTATE(33)=1
PLRX#=NEWXVALUE(PLRX#,WRAPVALUE(PLRA#+90),0.2)
PLRZ#=NEWZVALUE(PLRZ#,WRAPVALUE(PLRA#+90),0.2)
ENDIF
IF KEYSTATE(17)=1 THEN INC PLRY#,0.15
IF KEYSTATE(46)=1 THEN DEC PLRY#,0.15
IF MOUSECLICK()=1 THEN Shooting(1)
IF MOUSECLICK()=2 THEN Shooting(2)
IF MOUSECLICK()=3 THEN Shooting(1) : Shooting(2)
PLRA#=WRAPVALUE(PLRA#+(MOUSEMOVEX()*0.2))
INC HOVER#,2.5
HOVER#=WRAPVALUE(HOVER#)
PLRY#=PLRY#+(SIN(HOVER#)/33)
POSITION OBJECT PLR,PLRX#,PLRY#,PLRZ#
YROTATE OBJECT PLR,PLRA#
SlidingCollision()
FOR I=1 TO 3
HandleDrone(I)
NEXT I
IF OBJECT EXIST(QUADS1) THEN YROTATE OBJECT QUADS1,OBJECT ANGLE Y(QUADS1)+2.5
IF OBJECT EXIST(QUADS1)
IF OBJECT COLLISION (PLR,QUADS1)=1 THEN GotItem("Quads")
ENDIF
SET CAMERA TO OBJECT ORIENTATION PLR
POSITION CAMERA PLRX#,PLRY#,PLRZ#
TEXT SCREEN WIDTH()-(TEXT WIDTH("SCORE: "+STR$(SCORE))+5),5,"SCORE: "+STR$(SCORE)
TEXT 5,SCREEN HEIGHT()-(TEXT HEIGHT("ANYTHING")*2),"SHIELDS: "+STR$(SHIELDS)
TEXT 5,SCREEN HEIGHT()-TEXT HEIGHT("ANYTHING"),"ENERGY: "+STR$(ENERGY)
TEXT SCREEN WIDTH()-(TEXT WIDTH(LASER$)+5),SCREEN HEIGHT()-(THEIGHT*2),LASER$
TEXT SCREEN WIDTH()-(TEXT WIDTH("0 CONCSN MISSLES")+5),SCREEN HEIGHT()-THEIGHT,STR$(CONCS)+" CONCSN MISSLES"
PASTE IMAGE RETICLE,(SCREEN WIDTH()/2)-17,(SCREEN HEIGHT()/2)-9,1
SYNC
LOOP
FUNCTION SlidingCollision()
W=OBJECT COLLISION(PLR,0)
IF W>0
IF ABS(PLRX#-OBJECT POSITION X(W))<OBJECT SIZE X(W)/2
IF ABS(PLRY#-OBJECT POSITION Y(W))<OBJECT SIZE Y(W)/2
IF PLRZ#<OBJECT POSITION Z(W) THEN DEC PLRZ#,0.20000000000000000000000001
IF PLRZ#>OBJECT POSITION Z(W) THEN INC PLRZ#,0.20000000000000000000000001
ENDIF
ENDIF
IF ABS(PLRZ#-OBJECT POSITION Z(W))<OBJECT SIZE Z(W)/2
IF ABS(PLRY#-OBJECT POSITION Y(W))<OBJECT SIZE Y(W)/2
IF PLRX#<OBJECT POSITION X(W) THEN DEC PLRX#,0.20000000000000000000000001
IF PLRX#>OBJECT POSITION X(W) THEN INC PLRX#,0.20000000000000000000000001
ENDIF
ENDIF
IF ABS(PLRX#-OBJECT POSITION X(W))<(OBJECT SIZE X(W)/2)-0.1 AND ABS(PLRZ#-OBJECT POSITION Z(W))<(OBJECT SIZE Z(W)/2)-0.1
IF PLRY#>OBJECT POSITION Y(W) THEN INC PLRY#,0.15000000000000000000000001
IF PLRY#<OBJECT POSITION Y(W) THEN DEC PLRY#,0.15000000000000000000000001
ENDIF
ENDIF
ENDFUNCTION
FUNCTION Shooting(m)
IF m=1
IF ENERGY>0
DEADZONE#=TIMER()
IF TIMER()-DEADZONE#>=500 THEN DEC ENERGY : DEADZONE#=TIMER()
ELSE
PostMessage("ENERGY DEPLETED")
ENDIF
ENDIF
IF m=2
IF CONCS>0
DEC CONCS
ELSE
PostMessage("CONCUSSION MISSLES DEPLETED")
ENDIF
ENDIF
ENDFUNCTION
FUNCTION PostMessage(m$)
CENTER TEXT SCREEN WIDTH()/2,5,m$
ENDFUNCTION
FUNCTION MakeDrone(d$,ObNum,dX#,dY#,dZ#)
SELECT d$
CASE "Class1"
MAKE OBJECT SPHERE ObNum,4.5
COLOR OBJECT ObNum,RGB(200,50,0)
SCALE OBJECT ObNum,70,40,100
MAKE OBJECT CONE (ObNum+1),5
XROTATE OBJECT (ObNum+1),-90
SCALE OBJECT (ObNum+1),80,70,60
MAKE MESH FROM OBJECT 1,ObNum+1
DELETE OBJECT (ObNum+1)
ADD LIMB ObNum,1,1
DELETE MESH 1
OFFSET LIMB ObNum,1,0,0,-3
COLOR LIMB ObNum,1,RGB(200,50,0)
SET LIMB SMOOTHING ObNum,1,100
MAKE OBJECT CYLINDER (ObNum+1),1
SCALE OBJECT (ObNum+1),100,200,100
ZROTATE OBJECT (ObNum+1),-105
MAKE MESH FROM OBJECT 1,(ObNum+1)
DELETE OBJECT (ObNum+1)
ADD LIMB ObNum,2,1
DELETE MESH 1
OFFSET LIMB ObNum,2,2.7,-1,0.5
COLOR LIMB ObNum,2,RGB(50,50,50)
MAKE OBJECT CYLINDER (ObNum+1),1
SCALE OBJECT (ObNum+1),100,200,100
ZROTATE OBJECT (ObNum+1),-255
MAKE MESH FROM OBJECT 1,ObNum+1
DELETE OBJECT (ObNum+1)
ADD LIMB ObNum,3,1
DELETE MESH 1
OFFSET LIMB ObNum,3,-2.7,-1,0.5
COLOR LIMB ObNum,3,RGB(50,50,50)
MAKE OBJECT CONE (ObNum+1),2
XROTATE OBJECT (ObNum+1),-90
MAKE MESH FROM OBJECT 1,(ObNum+1)
DELETE OBJECT (ObNum+1)
ADD LIMB ObNum,4,1
DELETE MESH 1
OFFSET LIMB ObNum,4,3.5,-1.25,0.5
COLOR LIMB ObNum,4,RGB(200,50,0)
MAKE OBJECT CONE (ObNum+1),2
XROTATE OBJECT (ObNum+1),-90
MAKE MESH FROM OBJECT 1,(ObNum+1)
DELETE OBJECT (ObNum+1)
ADD LIMB ObNum,5,1
DELETE MESH 1
OFFSET LIMB ObNum,5,-3.5,-1.25,0.5
COLOR LIMB ObNum,5,RGB(200,50,0)
SET OBJECT CULL ObNum,0
ENDCASE
ENDSELECT
POSITION OBJECT ObNum,dX#,dY#,dZ#
SET OBJECT COLLISION ON ObNum
ENDFUNCTION
FUNCTION MakePowerup(t$,tX#,tY#,tZ#)
ItmNum=0
FOR I=1 TO 9999 STEP 2
IF OBJECT EXIST(I)<>1 THEN ItmNum=I
IF ItmNum<>0 THEN BREAK
NEXT I
SELECT t$
CASE "Quads"
MAKE OBJECT BOX ItmNum,1.5,0.125,0.75
COLOR OBJECT ItmNum,RGB(50,50,50)
MAKE OBJECT BOX (ItmNum+1),1.5,0.125,1
ZROTATE OBJECT (ItmNum+1),45
MAKE MESH FROM OBJECT 1,(ItmNum+1)
DELETE OBJECT (ItmNum+1)
ADD LIMB ItmNum,1,1
DELETE MESH 1
OFFSET LIMB ItmNum,1,-1,-0.5,0
COLOR LIMB ItmNum,1,RGB(50,50,50)
MAKE OBJECT BOX (ItmNum+1),1.5,0.125,1
ZROTATE OBJECT (ItmNum+1),-45
MAKE MESH FROM OBJECT 1,(ItmNum+1)
DELETE OBJECT (ItmNum+1)
ADD LIMB ItmNum,2,1
DELETE MESH 1
OFFSET LIMB ItmNum,2,1,-0.5,0
COLOR LIMB ItmNum,2,RGB(50,50,50)
MAKE OBJECT CYLINDER (ItmNum+1),1.3
SCALE OBJECT (ItmNum+1),20,120,20
XROTATE OBJECT (ItmNum+1),90
MAKE MESH FROM OBJECT 1,(ItmNum+1)
DELETE OBJECT (ItmNum+1)
ADD LIMB ItmNum,3,1
DELETE MESH 1
OFFSET LIMB ItmNum,3,-1,-0.5,-0.45
COLOR LIMB ItmNum,3,RGB(50,50,50)
MAKE OBJECT CYLINDER (ItmNum+1),1.3
SCALE OBJECT (ItmNum+1),20,120,20
XROTATE OBJECT (ItmNum+1),90
MAKE MESH FROM OBJECT 1,(ItmNum+1)
DELETE OBJECT (ItmNum+1)
ADD LIMB ItmNum,4,1
DELETE MESH 1
OFFSET LIMB ItmNum,4,-1.5,-0.95,-0.45
COLOR LIMB ItmNum,4,RGB(50,50,50)
MAKE OBJECT CYLINDER (ItmNum+1),1.3
SCALE OBJECT (ItmNum+1),20,120,20
XROTATE OBJECT (ItmNum+1),90
MAKE MESH FROM OBJECT 1,(ItmNum+1)
DELETE OBJECT (ItmNum+1)
ADD LIMB ItmNum,5,1
DELETE MESH 1
OFFSET LIMB ItmNum,5,1,-0.5,-0.45
COLOR LIMB ItmNum,5,RGB(50,50,50)
MAKE OBJECT CYLINDER (ItmNum+1),1.3
SCALE OBJECT (ItmNum+1),20,120,20
XROTATE OBJECT (ItmNum+1),90
MAKE MESH FROM OBJECT 1,(ItmNum+1)
DELETE OBJECT (ItmNum+1)
ADD LIMB ItmNum,6,1
DELETE MESH 1
OFFSET LIMB ItmNum,6,1.5,-0.95,-0.45
COLOR LIMB ItmNum,6,RGB(50,50,50)
SET OBJECT CULL ItmNum,0
ENDCASE
ENDSELECT
POSITION OBJECT ItmNum,tX#,tY#,tZ#
XROTATE OBJECT ItmNum,350
ENDFUNCTION ItmNum
FUNCTION HandleDrone(r)
rx#=OBJECT POSITION X(r)
ry#=OBJECT POSITION Y(r)
rz#=OBJECT POSITION Z(r)
ra#=OBJECT ANGLE Y(r)
rsx#=NEWXVALUE(rx#,ra#,100)
rsz#=NEWZVALUE(rz#,ra#,100)
DRONESTAT(r).LOS=INTERSECT OBJECT(PLR,rx#,ry#,rz#,rsx#,ry#,rsz#)
SELECT DRONESTAT(r).STATE
CASE 1
IF RND(60)=2 THEN DRONESTAT(r).DESTX=RND(1000)-500 : DRONESTAT(r).DESTZ=RND(1000)-500
ENDCASE
CASE 2
DRONESTAT(r).DESTX=NEWXVALUE(rx#,WRAPVALUE(PLRA#*-1),DRONESTAT(r).SPEED)
DRONESTAT(r).DESTZ=NEWZVALUE(rz#,WRAPVALUE(PLRA#*-1),DRONESTAT(r).SPEED)
ENDCASE
CASE 3
DRONESTAT(r).DESTX=PLRX#
DRONESTAT(r).DESTZ=PLRZ#
ENDCASE
ENDSELECT
SELECT DRONESTAT(r).LOS
CASE 1
DRONESTAT(r).STATE=3
DRONESTAT(r).SHOOTING=1
ENDCASE
CASE 0
DRONESTAT(r).STATE=1
DRONESTAT(r).SHOOTING=0
ENDCASE
ENDSELECT
IF OBJECT COLLISION(r,0)<>0
w=OBJECT COLLISION(r,0)
wx#=OBJECT POSITION X(w)
wz#=OBJECT POSITION Z(w)
wsx#=OBJECT SIZE X(w)
wsz#=OBJECT SIZE Z(w)
IF ABS(rx#-wx#)<wsx#/2
IF rz#>wz#
IF ra#>=90 AND ra#<=270
DRONESTAT(r).ZLOCKSTATE=1
ELSE
DRONESTAT(r).ZLOCKSTATE=0
ENDIF
ENDIF
IF rz#<wz#
IF ra#>=270 OR ra#<=90
DRONESTAT(r).ZLOCKSTATE=1
ELSE
DRONESTAT(r).ZLOCKSTATE=0
ENDIF
ENDIF
ENDIF
IF ABS(rz#-wz#)<wsz#/2
IF rx#>wx#
IF ra#>=180
DRONESTAT(r).XLOCKSTATE=1
ELSE
DRONESTAT(r).XLOCKSTATE=0
ENDIF
ENDIF
IF rx#<wx#
IF ra#>=0 AND ra#<=180
DRONESTAT(r).XLOCKSTATE=1
ELSE
DRONESTAT(r).XLOCKSTATE=0
ENDIF
ENDIF
ENDIF
POSITION OBJECT r,rx#,OBJECT POSITION Y(r),rz#
ELSE
DRONESTAT(r).XLOCKSTATE=0
DRONESTAT(r).ZLOCKSTATE=0
ENDIF
IF OBJECT EXIST(500+r)<>1
MAKE OBJECT PLAIN (500+r),1,1
HIDE OBJECT (500+r)
SET OBJECT COLLISION OFF (500+r)
ENDIF
POSITION OBJECT (500+r),DRONESTAT(r).DESTX,ry#,DRONESTAT(r).DESTZ
POINT OBJECT (500+r),rx#,ry#,rz# : YROTATE OBJECT (500+r),WRAPVALUE(OBJECT ANGLE Y(500+r)*-1)
ra#=CURVEANGLE(OBJECT ANGLE Y(500+r),ra#,100)
ra#=WRAPVALUE(ra#)
IF DRONESTAT(r).XLOCKSTATE=0 THEN rx#=NEWXVALUE(rx#,ra#,DRONESTAT(r).SPEED)
IF DRONESTAT(r).ZLOCKSTATE=0 THEN rz#=NEWZVALUE(rz#,ra#,DRONESTAT(r).SPEED)
POSITION OBJECT r,rx#,ry#,rz#
YROTATE OBJECT r,ra#
ENDFUNCTION
FUNCTION GotItem(i$)
SELECT i$
CASE "Quads"
LASER$="QUAD LASER LEVEL 1"
LASERS=4
ENDCASE
ENDSELECT
DELETE OBJECT OBJECT COLLISION(PLR,0)
ENDFUNCTION