after checking out some other's work on the 20-line challenge,
i couldn't rest until i made one myself.
(made in DBP)
here is my game, 20 LINE ASTEROIDS.
It is an actual game, with progressively harder levels, shield bonuses, and the ability to be destroyed,as well as creating all
necessary media within the program.
SYNC ON : SYNC RATE 20 : RANDOMIZE TIMER() : AUTOCAM OFF : COLOR BACKDROP 0 : INK RGB(255,0,0),0 : POSITION CAMERA 0,0,-167.0 : HIDE MOUSE
AST=3 : SIZ=2 : SPD#=1.0 : LEVEL=1 : SHIELD=5 : DIM SX(150) : DIM SY(150) : DIM SC(150) : FOR T=1 TO 50 : SX(T)=RND(640) : SY(T)=RND(480) : SC(T)=RND(150)+50 : NEXT T
CREATE BITMAP 1,50,50 : FOR T=1 TO 150 : A=RND(45) : B=RND(45) : C=RND(255) : D=RND(255) : E=RND(255) : BOX A,B,A+RND(5)+1,B+RND(5)+1,RGB(C,0,0),RGB(E,0,0),RGB(D,0,0),RGB(C,E,D) : NEXT T : GET IMAGE 2,0,0,50,50 : DELETE BITMAP 1 : SET CURRENT BITMAP 0
MAKE PARTICLES 1,2,25,25 : POSITION PARTICLES 1,0,0,0 : ROTATE PARTICLES 1,-90,0,0 : FOR T=1 TO 50 : CENTER TEXT 320,180,"20 LINE ASTEROIDS" : SYNC : NEXT T
STARTLEVEL:
CREATE BITMAP 1,50,50 : FOR T=1 TO 150 : A=RND(45) : B=RND(45) : C=RND(150)+105 : BOX A,B,A+RND(5)+1,B+RND(5)+1,RGB(C,C,C),RGB(C,C,C),RGB(C,C,C),RGB(C,C,C) : BLUR BITMAP 1,1.2 : NEXT T : GET IMAGE 1,0,0,50,50 : DELETE BITMAP 1 : SET CURRENT BITMAP 0
MAKE OBJECT CONE 1,10 : POSITION OBJECT 1,0,0,0 : MAKE OBJECT CUBE 2,3 : HIDE OBJECT 2 : SET OBJECT COLLISION OFF 2 : COLOR OBJECT 1,RGB(0,0,255) : COLOR OBJECT 2,RGB(255,13,255) : IF AST>6 THEN AST=6
FOR T=20 TO 19+AST : MAKE OBJECT SPHERE T,SIZ : TEXTURE OBJECT T,1 : FADE OBJECT T,500 : POSITION OBJECT T,RND(270)-135,RND(200)-100,0 : ROTATE OBJECT T,RND(360),RND(360),RND(360) : NEXT T : IF SPD#>3.0 THEN SPD#=3.0
DO : FOR T=1 TO 150 : DOT SX(T),SY(T),RGB(SC(T),SC(T),SC(T)) : NEXT T : ZROTATE OBJECT 1,OBJECT ANGLE Z(1)-RIGHTKEY()*4*SPD#+LEFTKEY()*4*SPD#
HIDE PARTICLES 1 : DED=0 : FOR T=20 TO 19+AST : IF OBJECT EXIST(T) THEN MOVE OBJECT T,SPD# : POSITION OBJECT T,OBJECT POSITION X(T),OBJECT POSITION Y(T),0 : IF OBJECT POSITION X(T)<-135 OR OBJECT POSITION X(T)>135 OR OBJECT POSITION Y(T)<-100 OR OBJECT POSITION Y(T)>100 THEN POINT OBJECT T,RND(100)-50,RND(100)-50,0 : MOVE OBJECT T,SPD#
IF OBJECT EXIST(T)=0 THEN INC DED
IF OBJECT EXIST(T) THEN IF OBJECT COLLISION(T,1) THEN A=OBJECT SIZE(T) : DELETE OBJECT T : SHIELD=SHIELD-A : POSITION PARTICLES 1,0,0,0 : SHOW PARTICLES 1
NEXT T
IF SPACEKEY()=1 THEN POSITION OBJECT 2,0,0,0 : ROTATE OBJECT 2,270,90,OBJECT ANGLE Z(1) : SET OBJECT COLLISION ON 2 : SHOW OBJECT 2
MOVE OBJECT 2,5 : X=OBJECT COLLISION(2,0) : IF X>19
HIDE OBJECT 2 : SET OBJECT COLLISION OFF 2 : A=OBJECT SIZE(X) : SCO=SCO+A*10 : POSITION PARTICLES 1,OBJECT POSITION X(X),OBJECT POSITION Y(X),OBJECT POSITION Z(X) : SHOW PARTICLES 1 : DELETE OBJECT X : A=A-1-RND(1) : IF A>0 THEN MAKE OBJECT SPHERE X,A*2 : TEXTURE OBJECT X,1 : FADE OBJECT X,500 : POSITION OBJECT X,OBJECT POSITION X(2),OBJECT POSITION Y(2),OBJECT POSITION Z(2) : ROTATE OBJECT X,OBJECT ANGLE X(2)+RND(150)-75,OBJECT ANGLE Y(2)+RND(150)-75,OBJECT ANGLE Z(2)+RND(150)-75
ENDIF
IF DED=AST THEN DELETE IMAGE 1 : DELETE OBJECT 1 : DELETE OBJECT 2 : INC AST : INC SIZ,2 : SPD#=SPD#+0.15 : INC LEVEL : INC SHIELD,LEVEL : CENTER TEXT 320,100,"GET READY FOR LEVEL "+STR$(LEVEL) : SYNC : WAIT 1500 : GOTO STARTLEVEL
IF SHIELD<0 THEN FOR T=1 TO 20: CENTER TEXT 320,T*20,"YOU ARE DEAD!" : NEXT T : SYNC : WAIT 3000 : END
SET CURSOR 0,0 : PRINT "LEVEL: ";LEVEL : PRINT "SCORE: ";SCO :PRINT "SHIELD: ";SHIELD : SYNC : LOOP
(heh heh forgot code!)
Use the LEFT and RIGHT ARROWKEYS to turn your little blue space ship left and right.
Use the SPACEBAR to fire your bullet at the asteroids (you only get one bullet at a time).
bob