DECLARE SUB warp (num!) DECLARE SUB planets () DECLARE SUB teletype (s$, ops!, yrow!, coler!) DECLARE SUB thelastsub () '3Ddemo1.BAS by Sulaiman Abdul-Khabir 'This was going to be a game but 3d was too slow(interperter) 'and also my StrWr Episode 4 intro had stars shining though ships ans planets 'that was bad so I took it out 'I going to try making a simpler 3d QB1.1 game now...look for it soon 'Most of routines are mine 'BlastLine and BlastCls subs are Andrew L. Ayers (c) still reserved though 'has anyone seen BlastQBasic 'If you use some of my stuff please just mention my name '8-17-98 'comment?questions?etc.?contactme at: saKhabir@aol.com while free trial last 'if you game has these many subs it is time to start over like me 'developed on a 6x86 233MX 48Meg 'if it runs slow then get a 450Mhz PII with 128Meg 'or I am going to have to start program in assembly 'does anyone have an all asm. qb1.1 game 'dig teletype?planets?warp? 'big for just a demo/ must be the bugs 'i use dirtX nex time he 'salaams DECLARE SUB getviewcoordinates (num!) DECLARE SUB changeobjects (num!, xrot!, yrot!, zrot!, xtran!, ytran!, ztran!) DECLARE SUB intro1 () DECLARE FUNCTION calccos! (r AS INTEGER, a AS INTEGER) DECLARE FUNCTION calcsin! (r AS INTEGER, a AS INTEGER) DECLARE SUB drawplanet () DECLARE SUB initplanet () DECLARE SUB titles () DECLARE SUB updateplanet () DECLARE SUB dataes1 () DECLARE SUB datav () DECLARE SUB dataes2 () DECLARE SUB databoss () DECLARE SUB databigone () DECLARE SUB datacanyon () DECLARE SUB databeacon () DECLARE SUB drawbeacon () DECLARE SUB drawcanyon () DECLARE SUB drawbigone () DECLARE SUB drawboss () DECLARE SUB drawes1 () DECLARE SUB drawes2 () DECLARE SUB drawv () DECLARE SUB manipulateobjects (num!, xrot!, yrot!, zrot!, xtran!, ytran!, ztran!) DECLARE SUB initalizeobjects () DECLARE SUB BlastCls (segment%, offset%, col%) DECLARE SUB BlastLine (dsegment%, doffset%, x1%, y1%, x2%, y2%, colr%) DECLARE SUB rotation (xcoord AS SINGLE, ycoord AS SINGLE, zcoord AS SINGLE, xrot!, yrot!, zrot!) TYPE vector x AS INTEGER y AS INTEGER z AS INTEGER END TYPE TYPE scalar x AS INTEGER y AS INTEGER END TYPE TYPE stat size AS INTEGER status AS INTEGER END TYPE TYPE orbit radius AS INTEGER angle AS INTEGER x AS INTEGER y AS INTEGER cradius AS INTEGER pcolor AS INTEGER END TYPE DIM SHARED planet(16) AS orbit DIM SHARED object(7) AS stat DIM SHARED v(7, 166) AS vector DIM SHARED s(7, 166) AS scalar DIM SHARED scale AS INTEGER scale = 1 'scale objects by changing this variable DIM SHARED ztran ztran = 1 'All of the objects in this program are fictitious, and any resemblance 'to actual(or not) objects,old or new, is purely coincidental. '******key for world array************* 'main ship = 0'not related to a starfox ship 'enemyship1(es1) = 1'generic ship 1 'enemyship2(es2) = 2'generic ship2 'boss = 3 'it's not what you think 'bigone = 4 'familiar? 'canyon = 5 'supposed to be a track 'beacon = 6'not yet done space station 'Lara C. = 7'oh bother 'number of vertices rotation per object object(0).size = 8 object(1).size = 14 object(2).size = 8 object(3).size = 48 object(4).size = 25 object(5).size = 166 object(6).size = 13 'object(7).size = 1000 'just kidding 'main ship FOR x = 0 TO 7 READ xa, ya, za v(0, x).x = xa v(0, x).y = ya v(0, x).z = za NEXT x DATA 0,4,0 DATA -1,0,0 DATA -3,-3,1 DATA 0,-1,0 DATA 3,-3,1 DATA 1,0,0 DATA 0,0,0 DATA 0,-2,-1 'enemy ship 1 FOR xx = 0 TO 13 READ x, y, z v(1, xx).x = x v(1, xx).y = y v(1, xx).z = z NEXT xx DATA 0,4,0 DATA -1,0,0 DATA -2,0,0 DATA -3,1,0 DATA -3,-1,0 DATA -1,-2,0 DATA 1,-2,0 DATA 3,-1,0 DATA 3,1,0 DATA 1,0,0 'data for tail DATA 0,0,0 DATA 0,-1,1 DATA 0,-2,1 DATA 0,-2,0 'enemyship 2 FOR xx = 0 TO 7 READ x, y, z v(2, xx).x = x v(2, xx).y = y v(2, xx).z = z NEXT xx DATA 0,4,0 DATA -3,-3,-1 DATA 0,-3,0 DATA 3,-3,-1 'data for twin tails 'tail 1 DATA -3,-1,-1 DATA -3,-3,1 'tail 2 DATA 3,-1,-1 DATA 3,-3,1 'boss ship FOR xx = 0 TO 47 READ x, y, z v(3, xx).x = x v(3, xx).y = y v(3, xx).z = z NEXT xx DATA -2,9,1 DATA -3, 8,1 DATA -4,7,1 DATA -4,3,1 DATA -3,2,1 DATA -2,1,1 DATA 2,1,1 DATA 3,2,1 DATA 4,3,1 DATA 4,7,1 DATA 3,8,1 DATA 2,9,1 'neck of ship DATA 0,4,1 DATA 0,2,-1 DATA 0,0,-1 DATA 0,2,1 'main engineering DATA 1,2,-1 DATA 1,2,-2 DATA -1,2,-2 DATA -1,2,-1 DATA 1,-4,-1 DATA 1,-4,-2 DATA -1,-4,-2 DATA -1,-4,-1 'right support for nacelle DATA 1,-2,-1 DATA 1,-3,-1 DATA 2,-3,1 DATA 2,-2,1 'left support for nacelle DATA -2,-2,1 DATA -2,-3,1 DATA -1,-3,-1 DATA -1,-2,-1 'right nacelle DATA 3,0,2 DATA 3,0,1 DATA 2,0,2 DATA 2,0,1 DATA 3,-8,2 DATA 3,-8,1 DATA 2,-8,2 DATA 2,-8,1 'left nacelle DATA -2,0,2 DATA -2,0,1 DATA -3,0,2 DATA -3,0,1 DATA -2,-8,2 DATA -2,-8,1 DATA -3,-8,2 DATA -3,-8,1 'the bigone FOR xx = 0 TO 24 READ x, y, z v(4, xx).x = x v(4, xx).y = y v(4, xx).z = z NEXT xx DATA 0,16,0 DATA -6,-4,0 DATA 0,-7,2 DATA 6,-4,0 DATA 0,-7,-2 'tower DATA -1,-5,3 DATA -1,-7,3 DATA 1,-7,3 DATA 1,-5,3 DATA -2,-4,3 DATA -2,-5,3 DATA 2,-5,3 DATA 2,-4,3 'engines 'center main DATA -1,-4,1 DATA -1,-4,-1 DATA 1,-4,-1 DATA 1,-4,1 DATA 2,-4,1 DATA 2,-4,-1 DATA 3,-4,-1 DATA 3,-4,1 DATA -3,-4,1 DATA -3,-4,-1 DATA -2,-4,-1 DATA -2,-4,1 'the canyon DIM start%, addit%, endit% start% = 0 endit% = 82 addit% = 0 FOR x32 = 0 TO 1 FOR xx = start% TO endit% READ xa%, ya%, za% v(5, xx).x = xa% v(5, xx).y = ya% v(5, xx).z = za% + addit% NEXT xx RESTORE canyonstuff start% = 83 endit% = 165 addit% = 50 NEXT x32 canyonstuff: DATA -16,0,0 DATA -16,24,0 DATA 24,52,0 DATA 28,96,0 DATA -8,124,0 DATA 4,152,0 DATA 4,176,0 DATA -4,184,0 DATA 4,192,0 DATA 0,208,0 DATA -8,228,0 DATA 4,240,0 DATA -8,248,0 DATA -8,268,0 DATA 0,288,0 DATA 24,308,0 DATA -4,316,0 DATA -4,308,0 DATA -12,308,0 DATA -24,284,0 DATA -16,272,0 DATA -20,260,0 DATA -24,252,0 DATA -24,232,0 DATA -12,196,0 DATA -36,168,0 DATA -28,148,0 DATA -32,136,0 DATA -12,112,0 DATA -8,104,0 DATA -8,84,10 DATA -28,64,20 DATA -44,76,30 DATA -52,88,40 DATA -52,116,50 DATA -40,116,50 DATA -8,120,50 DATA 16,96,50 DATA 16,72,50 DATA -16,44,50 DATA -12,40,50 DATA -12,28,50 DATA -16,24,50 DATA 16,0,0 DATA 16,24,0 DATA 40,52,0 DATA 60,84,0 DATA 20,124,0 DATA 20,160,0 DATA 16,184,0 DATA 20,192,0 DATA 16,200,0 DATA 20,204,0 DATA 8,224,0 DATA 20,244,0 DATA 16,252,0 DATA 28,272,0 DATA 16,288,0 DATA 48,316,0 DATA 24,316,0 DATA 16,324,0 DATA 28,332,0 DATA -12,344,0 DATA -32,324,0 DATA -40,324,0 DATA -32,316,0 DATA -44,304,0 DATA -56,280,0 DATA -56,232,0 DATA -68,204,0 DATA -44,176,0 DATA -52,124,0 DATA -24,104,0 DATA -24,96,10 DATA -32,88,20 DATA -44,100,30 DATA -40,104,40 DATA -8,104,50 DATA 0,84,50 DATA -32,44,50 DATA -40,32,50 DATA -40,28,50 DATA -32,20,50 'beacon FOR xx = 0 TO 12 READ xa, ya, za v(6, xx).x = xa v(6, xx).y = ya v(6, xx).z = za NEXT xx DATA -1,1,1 DATA -1,-1,1 DATA 1,-1,1 DATA 1,1,1 DATA 0,4,0 DATA -4,0,0 DATA 0,-4,0 DATA 4,0,0 DATA -1,1,-1 DATA -1,-1,-1 DATA 1,-1,-1 DATA 1,1,-1 DATA 0,0,-8 SCREEN 13 PI = 3.1415926535# rad = PI / 180 DIM SHARED COSa(361) AS SINGLE DIM SHARED SINa(361) AS SINGLE FOR x = 0 TO 360 LET COSa(x) = COS(x * rad) LET SINa(x) = SIN(x * rad) NEXT x DIM SHARED fps 'cutpastehere ' code$ = "1E5589E58B460C2B4610508B460A2B460E50B8010050B840015089E58B46188B5E1439" code$ = code$ + "D87E168B4602BBFFFFF7E38946028B4606BBFFFFF7E38946068B46168B5E" code$ = code$ + "1239D87E168B4600BBFFFFF7E38946008B4604BBFFFFF7E38946048B46" code$ = code$ + "1C8ED88B7616B106D3E689F3B102D3E601DE8B5E1801DE8B5E1A01DE" code$ = code$ + "8B46068B5E0439D87E2FBB000089C13D00007F07B9FFFFF7E189C18A46" code$ = code$ + "108804037602035E043B5E067C060376002B5E064983F9007DE4EB32B8" code$ = code$ + "000089D983FB007F0C89D8B9FFFFF7E189C1B800008A5E10881C037600" code$ = code$ + "0346063B46047C060376022B46044983F9007DE4585858585D1FCA0E00" ' DIM SHARED code8%(LEN(code$)) DEF SEG = VARSEG(code8%(0)) ' FOR I% = 0 TO 237 d% = VAL("&h" + MID$(code$, I% * 2 + 1, 2)) POKE VARPTR(code8%(0)) + I%, d% NEXT I% ' DEF SEG code$ = "" code$ = "1E5589E58B460C8ED88B760A8B460888C4B900FA890483C60283E90275F65D1FCA0600" ' DIM SHARED code6%(LEN(code$)) DEF SEG = VARSEG(code6%(0)) ' FOR I% = 0 TO 34 d% = VAL("&h" + MID$(code$, I% * 2 + 1, 2)) POKE VARPTR(code6%(0)) + I%, d% NEXT I% ' DEF SEG ' 'frame counter ON TIMER(1) GOSUB skip TIMER ON q$ = INKEY$ CALL initalizeobjects 'TIMER OFF DIM SHARED p AS INTEGER CALL thelastsub DO WHILE q$ <> CHR$(27) q$ = INKEY$ '>>>uncomment these to get control of objects 'for smoother movement change the 10's to 1 or less ' IF q$ = CHR$(0) + CHR$(72) THEN xrotate = xrotate - 10 ' IF q$ = CHR$(0) + CHR$(80) THEN xrotate = xrotate + 10 ' IF q$ = CHR$(0) + CHR$(75) THEN yrotate = yrotate - 10 ' IF q$ = CHR$(0) + CHR$(77) THEN yrotate = yrotate + 10 ' IF q$ = "w" THEN zrotate = zrotate - 10 ' IF q$ = "e" THEN zrotate = zrotate + 10 ' IF q$ = "o" THEN ztran = ztran - .1 ' IF q$ = "p" THEN ztran = ztran + .1 ' IF q$ = "a" THEN scale = scale - 1 ' IF q$ = "s" THEN scale = scale + 1 ' IF xrotate > 360 THEN LET xrotate = 0 ' IF xrotate < 0 THEN LET xrotate = 360 ' IF yrotate > 360 THEN LET yrotate = 0 ' IF yrotate < 0 THEN LET yrotate = 360 ' IF zrotate > 360 THEN zrotate = 0 ' IF zrotate < 0 THEN LET zrotate = 360 ' IF ztran <= 0 THEN ztran = .1 'manipulateobjects sub allows you to rotate one , some ,or all of the objects 'un-comment the objects you would like to move 'manipulateobjects does not actual move the objects but just the camera 'if you want you could add add movement on the x axis 'and on the y axis : ' eg. (if q$ = "t" then xtran = xtran + 1 ...etc.) ' eg. (call manipulateobjects(#,xrotate,yrotate,zrotate,xtran,tran,ztran...etc.) '>>un-comment statements below to allow rotation 'CALL manipulateobjects(0, xrotate, yrotate, zrotate, 0, 0, ztran) 'CALL manipulateobjects(1, xrotate, yrotate, zrotate, 0, 0, ztran) 'CALL manipulateobjects(2, xrotate, yrotate, zrotate, 0, 0, ztran) 'CALL manipulateobjects(3, xrotate, yrotate, zrotate, 0, 0, ztran) 'CALL manipulateobjects(4, xrotate, yrotate, zrotate, 0, 0, ztran) 'CALL manipulateobjects(5, xrotate, yrotate, zrotate, 0, 0, ztran) 'CALL manipulateobjects(6, xrotate, yrotate, zrotate, 0, 0, ztran) CALL BlastCls(&HA000, &H0, 0) 'frame counter LOCATE 1, 1: PRINT p 'these draw subroutine allows you to see what you move '>>uncomment these to see objects 'CALL drawv 'CALL drawes1 'CALL drawes2 'CALL drawboss 'CALL drawbigone 'CALL drawcanyon 'CALL drawbeacon 'frame counter fps = fps + 1 LOOP TIMER OFF 'the end END skip: p = fps fps = 0 RETURN SUB BlastCls (segment%, offset%, col%) ' ' Clear the screen! ' DEF SEG = VARSEG(code6%(0)) ' WAIT 986, 8 CALL ABSOLUTE(BYVAL segment%, BYVAL offset%, BYVAL col%, VARPTR(code6%(0))) ' DEF SEG ' END SUB SUB BlastLine (dsegment%, doffset%, x1%, y1%, x2%, y2%, colr%) ' slow and dirty clipping by s. a-k IF x1% < 1 THEN x1% = 1 IF x2% < 1 THEN x2% = 1 IF x2% > 319 THEN x2% = 319 IF x1% > 319 THEN x1% = 319 IF y1% < 1 THEN y1% = 1 IF y1% > 199 THEN y1% = 199 IF y2% > 199 THEN y2% = 199 IF y2% < 1 THEN y2% = 1 ' ' This is a simple routine which uses the traditional ' Bresenham Algorithm to draw a line between two points. ' ' No error checking is performed for endpoints in this routine, ' so be careful not to let the ends fall out of bounds, since ' doing so may cause your machine to crash... ' BlastLine! (BLSTLINE.ASM) DEF SEG = VARSEG(code8%(0)) ' CALL ABSOLUTE(BYVAL dsegment%, BYVAL doffset%, BYVAL x1%, BYVAL y1%, BYVAL x2%, BYVAL y2%, BYVAL colr%, VARPTR(code8%(0))) ' DEF SEG ' END SUB FUNCTION calccos (r AS INTEGER, a AS INTEGER) 'what are cos's and sin's anyways calccos = r * COSa(a) END FUNCTION FUNCTION calcsin (r AS INTEGER, a AS INTEGER) calcsin = r * SINa(a) END FUNCTION SUB changeobjects (num, xrot, yrot, zrot, xtran, ytran, ztran2) 'changes model orientation in model space 'no change to camera FOR c = 0 TO object(num).size - 1 x0 = v(num, c).x y0 = v(num, c).y z0 = v(num, c).z CALL rotation(x0, y0, z0, xrot, yrot, zrot) scale = 1 v(num, c).x = (x0 * scale) + xtran v(num, c).y = (y0 * scale) + ytran v(num, c).z = (z0 * scale) + ztran2 NEXT c END SUB SUB clearplanet 'lunes mares miercoles jueves,viernes,sabado,domingo 'Hoy es el dicisiete de agosto 'Inshalla 'La luna 'warning:low on sanity (tm) (c) (r) (u) (k) FOR x = 0 TO 15 CIRCLE (planet(x).x, planet(x).y), planet(x).cradius, 0 NEXT x END SUB SUB drawbeacon DIM t AS INTEGER FOR x = 0 TO 12 PRESET (s(6, x).x, s(6, x).y), 2 NEXT x EXIT SUB 'lot of stuff t = 1 FOR xx = 0 TO 3 CALL BlastLine(&HA000, &H0, s(6, xx).x, s(6, xx).y, s(6, t).x, s(6, t).y, 2) t = t + 1 IF t > 3 THEN t = 0 NEXT xx t = 5 FOR xx = 4 TO 7 CALL BlastLine(&HA000, &H0, s(6, xx).x, s(6, xx).y, s(6, t).x, s(6, t).y, 2) t = t + 1 IF t > 7 THEN t = 4 NEXT xx t = 9 FOR xx = 8 TO 11 CALL BlastLine(&HA000, &H0, s(6, xx).x, s(6, xx).y, s(6, t).x, s(6, t).y, 2) t = t + 1 IF t > 11 THEN t = 8 NEXT xx FOR x = 8 TO 11 CALL BlastLine(&HA000, &H0, s(6, xx).x, s(6, xx).y, s(6, 12).x, s(6, 12).y, 2) NEXT x EXIT SUB t = 4 FOR x = 0 TO 3 FOR w = 0 TO 2 CALL BlastLine(&HA000, &H0, s(6, x).x, s(6, x).y, s(6, t).x, s(6, t).y, 2) t = t + 1 NEXT w NEXT x t = 4 FOR x = 8 TO 11 FOR w = 0 TO 2 CALL BlastLine(&HA000, &H0, s(6, x).x, s(6, x).y, s(6, t).x, s(6, t).y, 2) t = t + 1 NEXT w NEXT x 'Socrates said so END SUB SUB drawbigone t = 1 FOR x = 0 TO 3 CALL BlastLine(&HA000, &H0, s(4, x).x, s(4, x).y, s(4, t).x, s(4, t).y, 2) t = t + 1 IF t > 3 THEN t = 0 NEXT x CALL BlastLine(&HA000, &H0, s(4, 1).x, s(4, 1).y, s(4, 4).x, s(4, 4).y, 2) CALL BlastLine(&HA000, &H0, s(4, 4).x, s(4, 4).y, s(4, 3).x, s(4, 3).y, 2) CALL BlastLine(&HA000, &H0, s(4, 0).x, s(4, 0).y, s(4, 2).x, s(4, 2).y, 2) CALL BlastLine(&HA000, &H0, s(4, 0).x, s(4, 0).y, s(4, 4).x, s(4, 4).y, 2) t = 6 FOR x = 5 TO 8 CALL BlastLine(&HA000, &H0, s(4, x).x, s(4, x).y, s(4, t).x, s(4, t).y, 2) t = t + 1 IF t > 8 THEN t = 5 NEXT x t = 10 FOR x = 9 TO 12 CALL BlastLine(&HA000, &H0, s(4, x).x, s(4, x).y, s(4, t).x, s(4, t).y, 2) t = t + 1 IF t > 12 THEN t = 9 NEXT x t = 14 FOR x = 13 TO 16 CALL BlastLine(&HA000, &H0, s(4, x).x, s(4, x).y, s(4, t).x, s(4, t).y, 2) t = t + 1 IF t > 16 THEN t = 13 NEXT x t = 18 FOR x = 17 TO 20 CALL BlastLine(&HA000, &H0, s(4, x).x, s(4, x).y, s(4, t).x, s(4, t).y, 2) t = t + 1 IF t > 20 THEN t = 17 NEXT x t = 22 FOR x = 21 TO 24 CALL BlastLine(&HA000, &H0, s(4, x).x, s(4, x).y, s(4, t).x, s(4, t).y, 2) t = t + 1 IF t > 24 THEN t = 21 NEXT x END SUB SUB drawboss 'main sauser t = 1 FOR x = 0 TO 11 CALL BlastLine(&HA000, &H0, s(3, x).x, s(3, x).y, s(3, t).x, s(3, t).y, 2) t = t + 1 IF t > 11 THEN t = 0 NEXT x 'neck t = 13 FOR x = 12 TO 15 CALL BlastLine(&HA000, &H0, s(3, x).x, s(3, x).y, s(3, t).x, s(3, t).y, 2) t = t + 1 IF t > 15 THEN t = 12 NEXT x 'main engineering t = 17 FOR x = 16 TO 19 CALL BlastLine(&HA000, &H0, s(3, x).x, s(3, x).y, s(3, t).x, s(3, t).y, 2) t = t + 1 IF t > 19 THEN t = 16 NEXT x t = 21 FOR x = 20 TO 23 CALL BlastLine(&HA000, &H0, s(3, x).x, s(3, x).y, s(3, t).x, s(3, t).y, 2) t = t + 1 IF t > 23 THEN t = 20 NEXT x CALL BlastLine(&HA000, &H0, s(3, 16).x, s(3, 16).y, s(3, 20).x, s(3, 20).y, 2) CALL BlastLine(&HA000, &H0, s(3, 17).x, s(3, 17).y, s(3, 21).x, s(3, 21).y, 2) CALL BlastLine(&HA000, &H0, s(3, 18).x, s(3, 18).y, s(3, 22).x, s(3, 22).y, 2) CALL BlastLine(&HA000, &H0, s(3, 19).x, s(3, 19).y, s(3, 23).x, s(3, 23).y, 2) 'nacelle supports t = 25 FOR x = 24 TO 27 CALL BlastLine(&HA000, &H0, s(3, x).x, s(3, x).y, s(3, t).x, s(3, t).y, 2) t = t + 1 IF t > 27 THEN t = 24 NEXT x t = 29 FOR x = 28 TO 31 CALL BlastLine(&HA000, &H0, s(3, x).x, s(3, x).y, s(3, t).x, s(3, t).y, 2) t = t + 1 IF t > 31 THEN t = 28 NEXT x 'right nacelle t = 33 FOR x = 32 TO 35 CALL BlastLine(&HA000, &H0, s(3, x).x, s(3, x).y, s(3, t).x, s(3, t).y, 2) t = t + 1 IF t > 35 THEN t = 32 NEXT x t = 37 FOR x = 36 TO 39 CALL BlastLine(&HA000, &H0, s(3, x).x, s(3, x).y, s(3, t).x, s(3, t).y, 2) t = t + 1 IF t > 39 THEN t = 36 NEXT x CALL BlastLine(&HA000, &H0, s(3, 32).x, s(3, 32).y, s(3, 36).x, s(3, 36).y, 2) CALL BlastLine(&HA000, &H0, s(3, 33).x, s(3, 33).y, s(3, 37).x, s(3, 37).y, 2) CALL BlastLine(&HA000, &H0, s(3, 34).x, s(3, 34).y, s(3, 38).x, s(3, 38).y, 2) CALL BlastLine(&HA000, &H0, s(3, 35).x, s(3, 35).y, s(3, 39).x, s(3, 39).y, 2) 'left nacelle t = 41 FOR x = 40 TO 43 CALL BlastLine(&HA000, &H0, s(3, x).x, s(3, x).y, s(3, t).x, s(3, t).y, 2) t = t + 1 IF t > 43 THEN t = 40 NEXT x t = 45 FOR x = 44 TO 47 CALL BlastLine(&HA000, &H0, s(3, x).x, s(3, x).y, s(3, t).x, s(3, t).y, 2) t = t + 1 IF t > 47 THEN t = 44 NEXT x CALL BlastLine(&HA000, &H0, s(3, 40).x, s(3, 40).y, s(3, 44).x, s(3, 44).y, 2) CALL BlastLine(&HA000, &H0, s(3, 41).x, s(3, 41).y, s(3, 45).x, s(3, 45).y, 2) CALL BlastLine(&HA000, &H0, s(3, 42).x, s(3, 42).y, s(3, 46).x, s(3, 46).y, 2) CALL BlastLine(&HA000, &H0, s(3, 43).x, s(3, 43).y, s(3, 47).x, s(3, 47).y, 2) END SUB SUB drawcanyon 'maybe I should use triangle instead 'saKhabir@aol.com 100 free hours yeah DIM t% 'bottom sides t% = 1 FOR xx = 0 TO 41 CALL BlastLine(&HA000, &H0, s(5, xx).x, s(5, xx).y, s(5, t%).x, s(5, t%).y, 2) t% = t% + 1 'IF t% > 42 THEN t% = 42 NEXT xx t% = 44 FOR xx = 43 TO 81 CALL BlastLine(&HA000, &H0, s(5, xx).x, s(5, xx).y, s(5, t%).x, s(5, t%).y, 2) t% = t% + 1 'IF t% > 82 THEN t% = 82 NEXT xx 'EXIT SUB 'draw floor r% = 43: l% = 0 FOR xx = 0 TO 42 CALL BlastLine(&HA000, &H0, s(5, l%).x, s(5, l%).y, s(5, r%).x, s(5, r%).y, 4) r% = r% + 1 l% = l% + 1 NEXT xx 'top sides t% = 84 FOR xx = 83 TO 124 CALL BlastLine(&HA000, &H0, s(5, xx).x, s(5, xx).y, s(5, t%).x, s(5, t%).y, 3) t% = t% + 1 'IF t% > 125 THEN t% = 125 NEXT xx t% = 127 FOR xx = 126 TO 164 CALL BlastLine(&HA000, &H0, s(5, xx).x, s(5, xx).y, s(5, t%).x, s(5, t%).y, 3) t% = t% + 1 'IF t% > 165 THEN t% = 165 NEXT xx 'draw vetical lines of canyon FOR xx = 0 TO 82 CALL BlastLine(&HA000, &H0, s(5, xx).x, s(5, xx).y, s(5, xx + 83).x, s(5, xx + 83).y, 5) NEXT xx END SUB SUB drawes1 t = 1 FOR x = 0 TO 9 CALL BlastLine(&HA000, &H0, s(1, x).x, s(1, x).y, s(1, t).x, s(1, t).y, 2) t = t + 1 IF t > 9 THEN t = 0 NEXT x t = 11 FOR x = 10 TO 13 CALL BlastLine(&HA000, &H0, s(1, x).x, s(1, x).y, s(1, t).x, s(1, t).y, 2) t = t + 1 IF t > 13 THEN t = 10 NEXT x END SUB SUB drawes2 t = 1 FOR x = 0 TO 3 CALL BlastLine(&HA000, &H0, s(2, x).x, s(2, x).y, s(2, t).x, s(2, t).y, 2) t = t + 1 IF t > 3 THEN t = 0 NEXT x 'left tail CALL BlastLine(&HA000, &H0, s(2, 1).x, s(2, 1).y, s(2, 5).x, s(2, 5).y, 2) CALL BlastLine(&HA000, &H0, s(2, 5).x, s(2, 5).y, s(2, 4).x, s(2, 4).y, 2) CALL BlastLine(&HA000, &H0, s(2, 4).x, s(2, 4).y, s(2, 1).x, s(2, 1).y, 2) 'right tail CALL BlastLine(&HA000, &H0, s(2, 3).x, s(2, 3).y, s(2, 7).x, s(2, 7).y, 2) CALL BlastLine(&HA000, &H0, s(2, 7).x, s(2, 7).y, s(2, 6).x, s(2, 6).y, 2) CALL BlastLine(&HA000, &H0, s(2, 6).x, s(2, 6).y, s(2, 3).x, s(2, 3).y, 2) END SUB SUB drawplanet FOR x = 0 TO 15 CIRCLE (planet(x).x, planet(x).y), planet(x).cradius, planet(x).pcolor NEXT x END SUB SUB drawv FOR d = 0 TO 5 t = d + 1 IF t > 5 THEN t = 0 CALL BlastLine(&HA000, &H0, s(0, d).x, s(0, d).y, s(0, t).x, s(0, t).y, 5) NEXT d CALL BlastLine(&HA000, &H0, s(0, 3).x, s(0, 3).y, s(0, 7).x, s(0, 7).y, 2) CALL BlastLine(&HA000, &H0, s(0, 7).x, s(0, 7).y, s(0, 6).x, s(0, 6).y, 2) CALL BlastLine(&HA000, &H0, s(0, 6).x, s(0, 6).y, s(0, 3).x, s(0, 3).y, 2) CALL BlastLine(&HA000, &H0, s(0, 1).x, s(0, 1).y, s(0, 3).x, s(0, 3).y, 2) CALL BlastLine(&HA000, &H0, s(0, 3).x, s(0, 3).y, s(0, 5).x, s(0, 5).y, 2) CALL BlastLine(&HA000, &H0, s(0, 5).x, s(0, 5).y, s(0, 1).x, s(0, 1).y, 2) END SUB SUB getviewcoordinates (num) 'I think this sub is just here to waste disk space 'yeah i think this sub is pretty reduntant 'you could probably find the same thing in manipulateobjects 'or in changeobjects 'so I think this sub is very wasteful of resource FOR c = 0 TO object(num).size - 1 x0 = v(num, c).x y0 = v(num, c).y z0 = v(num, c).z LOCATE 5, 1: PRINT x0; y0; z0; IF z0 <= 0 THEN z0 = 1 s(num, c).x = (x0 / z0) + 160 s(num, c).y = (y0 / z0) + 100 NEXT c END SUB SUB initalizeobjects 'initalize s FOR x = 0 TO 6 FOR c = 0 TO object(x).size x0 = v(x, c).x y0 = v(x, c).y z0 = v(x, c).z xrotate = 0 yrotate = 0 zrotate = 0 CALL rotation(x0, y0, z0, xrotate, yrotate, zrotate) s(x, c).x = (x0 / 1) + 160' s(x, c).y = (y0 / 1) + 100' NEXT c NEXT x END SUB SUB initplanet 'lots of cut and paste planet(0).radius = 10 'distance from center (dis from sun) planet(0).angle = 200 'angle (phase in orbit planet(0).x = 0 'current x position planet(0).y = 0 'current y position planet(0).cradius = 2 'radius of circle (diameter of planet) planet(0).pcolor = 15 'start great gb game here 'print "Hello World" 'end great qb game planet(1).radius = 20 'distance from center (dis from sun) planet(1).angle = 0 'angle (phase in orbit planet(1).x = 0 'current x position planet(1).y = 0 'current y position planet(1).cradius = 2 'radius of circle (diameter of planet) planet(1).pcolor = 1 planet(2).radius = 30 'distance from center (dis from sun) planet(2).angle = 190 'angle (phase in orbit planet(2).x = 0 'current x position planet(2).y = 0 'current y position planet(2).cradius = 2 'radius of circle (diameter of planet) planet(2).pcolor = 2 planet(3).radius = 5 'distance from center (dis from sun) planet(3).angle = 300 'angle (phase in orbit planet(3).x = 0 'current x position planet(3).y = 0 'current y position planet(3).cradius = 1 'radius of circle (diameter of planet) planet(3).pcolor = 3 planet(4).radius = 40 'distance from center (dis from sun) planet(4).angle = 90 'angle (phase in orbit planet(4).x = 0 'current x position planet(4).y = 0 'current y position planet(4).cradius = 2 'radius of circle (diameter of planet) planet(4).pcolor = 4 planet(5).radius = 40 'distance from center (dis from sun) planet(5).angle = 350 'angle (phase in orbit planet(5).x = 0 'current x position planet(5).y = 0 'current y position planet(5).cradius = 2 'radius of circle (diameter of planet) planet(5).pcolor = 5 planet(6).radius = 60 'distance from center (dis from sun) planet(6).angle = 220 'angle (phase in orbit planet(6).x = 0 'current x position planet(6).y = 0 'current y position planet(6).cradius = 2 'radius of circle (diameter of planet) planet(6).pcolor = 6 planet(7).radius = 5 'distance from center (dis from sun) planet(7).angle = 110 'angle (phase in orbit planet(7).x = 0 'current x position planet(7).y = 0 'current y position planet(7).cradius = 1 'radius of circle (diameter of planet) planet(7).pcolor = 7 planet(8).radius = 5 'distance from center (dis from sun) planet(8).angle = 300 'angle (phase in orbit planet(8).x = 0 'current x position planet(8).y = 0 'current y position planet(8).cradius = 1 'radius of circle (diameter of planet) planet(8).pcolor = 8 planet(9).radius = 100 'distance from center (dis from sun) planet(9).angle = 330 'angle (phase in orbit planet(9).x = 0 'current x position planet(9).y = 0 'current y position planet(9).cradius = 2 'radius of circle (diameter of planet) planet(9).pcolor = 9 planet(10).radius = 5 'distance from center (dis from sun) planet(10).angle = 0 'angle (phase in orbit planet(10).x = 0 'current x position planet(10).y = 0 'current y position planet(10).cradius = 1 'radius of circle (diameter of planet) planet(10).pcolor = 10 planet(11).radius = 5 'distance from center (dis from sun) planet(11).angle = 90 'angle (phase in orbit planet(11).x = 0 'current x position planet(11).y = 0 'current y position planet(11).cradius = 1 'radius of circle (diameter of planet) planet(11).pcolor = 11 planet(12).radius = 5 'distance from center (dis from sun) planet(12).angle = 180 'angle (phase in orbit planet(12).x = 0 'current x position planet(12).y = 0 'current y position planet(12).cradius = 1 'radius of circle (diameter of planet) planet(12).pcolor = 12 planet(13).radius = 5 'distance from center (dis from sun) planet(13).angle = 260 'angle (phase in orbit planet(13).x = 0 'current x position planet(13).y = 0 'current y position planet(13).cradius = 1 'radius of circle (diameter of planet) planet(13).pcolor = 13 planet(14).radius = 300 'distance from center (dis from sun) planet(14).angle = 5 'angle (phase in orbit planet(14).x = 0 'current x position planet(14).y = 0 'current y position planet(14).cradius = 2 'radius of circle (diameter of planet) planet(14).pcolor = 14 planet(15).radius = 3 'distance from center (dis from sun) planet(15).angle = 50 'angle (phase in orbit planet(15).x = 0 'current x position planet(15).y = 0 'current y position planet(15).cradius = 1 'radius of circle (diameter of planet) planet(15).pcolor = 15 'why are my planets technicolor? cuz i lazy END SUB SUB intro1 'ah nevermind 'FOR z = 518 TO -1 STEP -1 'more wasted space 'CALL changeobjects(4, 0, 0, 155, 0, 0, 155) 'CALL getviewcoordinates(0) 'scale = 500 'CALL manipulateobjects(4, 90, 0, 180, 0, 0, z) 'i watch pbs all the time 'CALL BlastCls(&HA000, &H0, 0) 'CALL drawbigone 'CALL drawes1 'SLEEP 1 'LOCATE 3, 1: PRINT z 'NEXT z END SUB SUB manipulateobjects (num, xrot, yrot, zrot, xtran, ytran, ztran2) 'what an affine? 'whats a matrix FOR c = 0 TO object(num).size - 1 x0 = v(num, c).x y0 = v(num, c).y z0 = v(num, c).z IF ztran2 = 0 THEN ztran = 1 'note: could store all rotation and translation coordinate 'that could be useful in object movement later on CALL rotation(x0, y0, z0, xrot, yrot, zrot) s(num, c).x = CINT(((x0 * scale) / ztran2) + 160 + xtran) s(num, c).y = CINT(((y0 * scale) / ztran2) + 100 + ytran) NEXT c END SUB SUB planets '$DYNAMIC CALL initplanet CLS SCREEN 8 TIMER ON 'ON TIMER(1) GOSUB fps DIM count ' initiate planet motion and position WINDOW (-400, -400)-(400, 400) DIM x1, y1, x2, y2 x1 = -400: y1 = -400: x2 = 400: y2 = 400 a = 2 TIMER OFF WHILE (1) GOSUB smallw 'CALL clearplanet CALL updateplanet IF count2 MOD 30000 = 1 THEN GOSUB smallw SCREEN , , a, 0 CLS CALL drawplanet CIRCLE (0, 0), 2, 4 PAINT (0, 0), 5, 4 CIRCLE (0, 0), 10, 2 CIRCLE (0, 0), 20, 2 CIRCLE (0, 0), 30, 2 CIRCLE (0, 0), 40, 2 CIRCLE (0, 0), 60, 2 CIRCLE (0, 0), 100, 2 CIRCLE (0, 0), 300, 2 CALL titles LINE (-350, 350)-(planet(4).x, planet(4).y), 15 WAIT 986, 8 PCOPY a, 0 'count = count + 1 count2 = count2 + 1 IF count2 > 30000 THEN count2 = 0 WEND CLS SCREEN 0, 0, 0 EXIT SUB '2END fps: LOCATE 10, 10: PRINT "fps"; 'flag = 0 'count count = 0 RETURN smallw: x1 = x1 + 5 y1 = y1 + 5 x2 = x2 - 5 y2 = y2 - 5 IF x1 > -45 THEN EXIT SUB 'END WINDOW (x1, y1)-(x2, y2) CLS RETURN END SUB REM $STATIC SUB rotation (xcoord AS SINGLE, ycoord AS SINGLE, zcoord AS SINGLE, xrot, yrot, zrot) '3d rotation formula found in and higher level math books 'modified no double -sak x1 = xcoord * -1 y1 = ycoord * COSa(xrot) - zcoord * SINa(xrot) z1 = ycoord * SINa(xrot) + zcoord * COSa(xrot) x2 = z1 * SINa(yrot) + x1 * COSa(yrot) y2 = y1 z2 = z1 * COSa(yrot) - x1 * SINa(yrot) x3 = x2 * COSa(zrot) - y2 * SINa(zrot) y3 = x2 * SINa(zrot) + y2 * COSa(zrot) z3 = z2 xcoord = x3 ycoord = y3 zcoord = z3 END SUB SUB teletype (s$, ops, yrow, coler) 'ops and y must be same value COLOR coler p = LEN(s$) FOR z = 1 TO p c$ = MID$(s$, z, 1) xg = (ops * 8) yg = yrow * 8 LINE (xg, yg - 8)-(xg + 8, yg - 1), 2, BF IF (ops) > 40 THEN END 'y , x LOCATE yrow, ops: PRINT c$ count = count + 8 FOR sa = 0 TO 4000: NEXT ops = ops + 1 NEXT z LINE (xg, yg - 8)-(xg + 8, yg - 1), 0, BF END SUB SUB thelastsub CLS WHILE q$ = "" q$ = INKEY$ a = a + 1 IF a > 360 THEN a = 1 xrot = (2 * a) yrot = a zrot = 90 * SIN(a * (3.14 / 180)) IF zrot < 1 THEN zrot = 360 IF zrot > 360 THEN zrot = 1 IF xrot > 360 THEN xrot = 1 IF xrot < 1 THEN xrot = 360 CALL manipulateobjects(0, xrot, yrot, zrot, 0, 0, .05) CALL BlastCls(&HA000, &H0, 0) CALL drawv WEND yrot = 0 CLS q$ = INKEY$ WHILE q$ = "" q$ = INKEY$ yrot = yrot + 1 IF yrot > 360 THEN yrot = 0 CALL manipulateobjects(0, 90, yrot, 180, 0, -50, .05) CALL BlastCls(&HA000, &H0, 0) CALL drawv WEND CALL teletype("Top Secret", 15, 1, 2) CALL teletype("The Raven", 15, 2, 4) CALL teletype("U.S.A.F Extreme Range Fighter(ERF)", 1, 11, 4) CALL teletype("Project Name:", 1, 14, 4) CALL teletype("Far Shot", 15, 14, 5) CALL teletype("Project Start Date:", 1, 15, 4) CALL teletype("8-2-98", 21, 15, 5) CALL teletype("Weapons:", 1, 16, 4) CALL teletype("23Rhz Pulse|Diode Pion Laser", 10, 16, 5) CALL teletype("Series 3 Quark Bomb", 10, 17, 5) CALL teletype("Gat45 Cannon w/ Ionization ", 10, 18, 5) CALL teletype("Sm38 Missle(Halley's NightMare)", 10, 19, 5) CALL teletype("Speed:", 1, 20, 4) CALL teletype("Normal 5.2kmt", 8, 20, 5) CALL teletype("Emergency 7.5kmt", 8, 21, 5) CALL teletype("Crew:", 1, 22, 4) CALL teletype("1", 7, 22, 5) CALL teletype("Dimensions:", 1, 23, 4) CALL teletype("23.4x X 30.1y X 7.8z", 13, 23, 5) SLEEP 10 CALL warp(0) q$ = INKEY$ WHILE q$ = "" q$ = INKEY$ a = a + 1 IF a > 360 THEN a = 1 xrot = (2 * a) yrot = a zrot = 90 * SIN(a * (3.14 / 180)) IF zrot < 1 THEN zrot = 360 IF zrot > 360 THEN zrot = 1 IF xrot > 360 THEN xrot = 1 IF xrot < 1 THEN xrot = 360 CALL manipulateobjects(1, xrot, yrot, zrot, 0, 0, .05) CALL BlastCls(&HA000, &H0, 0) CALL drawes1 WEND yrot = 0 CLS q$ = INKEY$ WHILE q$ = "" q$ = INKEY$ yrot = yrot + 1 IF yrot > 360 THEN yrot = 0 CALL manipulateobjects(1, 90, yrot, 0, 0, -50, .05) CALL BlastCls(&HA000, &H0, 0) CALL drawes1 WEND CALL teletype("Top Secret", 15, 1, 2) CALL teletype("The Riptor", 15, 2, 4) CALL teletype("Object sighted on long range pulse radar", 1, 11, 4) CALL teletype("Speed:", 1, 14, 4) CALL teletype("Unknown", 8, 14, 5) CALL teletype("Range:", 1, 15, 4) CALL teletype("Unknown", 8, 15, 5) CALL teletype("Weapons:", 1, 16, 4) CALL teletype("Unknown", 10, 16, 5) CALL teletype("Crew:", 1, 17, 4) CALL teletype("Unknown", 7, 17, 5) SLEEP 10 CALL warp(1) q$ = INKEY$ WHILE q$ = "" q$ = INKEY$ a = a + 1 IF a > 360 THEN a = 1 xrot = (2 * a) yrot = a zrot = 90 * SIN(a * (3.14 / 180)) IF zrot < 1 THEN zrot = 360 IF zrot > 360 THEN zrot = 1 IF xrot > 360 THEN xrot = 1 IF xrot < 1 THEN xrot = 360 CALL manipulateobjects(2, xrot, yrot, zrot, 0, 0, .05) CALL BlastCls(&HA000, &H0, 0) CALL drawes2 WEND yrot = 0 CLS q$ = INKEY$ WHILE q$ = "" q$ = INKEY$ yrot = yrot + 1 IF yrot > 360 THEN yrot = 0 CALL manipulateobjects(2, 90, yrot, 0, 0, -50, .05) CALL BlastCls(&HA000, &H0, 0) CALL drawes2 WEND CALL teletype("Top Secret", 15, 1, 2) CALL teletype("The Tweeter", 15, 2, 4) CALL teletype("Object sighted on long range pulse radar", 1, 11, 4) CALL teletype("Speed:", 1, 14, 4) CALL teletype("Unknown", 8, 14, 5) CALL teletype("Range:", 1, 15, 4) CALL teletype("Unknown", 8, 15, 5) CALL teletype("Weapons:", 1, 16, 4) CALL teletype("Unknown", 10, 16, 5) CALL teletype("Crew:", 1, 17, 4) CALL teletype("Unknown", 7, 17, 5) SLEEP 10 CALL warp(2) q$ = INKEY$ WHILE q$ = "" q$ = INKEY$ a = a + 1 IF a > 360 THEN a = 1 xrot = (2 * a) yrot = a zrot = 90 * SIN(a * (3.14 / 180)) IF zrot < 1 THEN zrot = 360 IF zrot > 360 THEN zrot = 1 IF xrot > 360 THEN xrot = 1 IF xrot < 1 THEN xrot = 360 CALL manipulateobjects(3, xrot, yrot, zrot, 0, 0, .1) CALL BlastCls(&HA000, &H0, 0) CALL drawboss WEND yrot = 0 CLS q$ = INKEY$ WHILE q$ = "" q$ = INKEY$ yrot = yrot + 1 IF yrot > 360 THEN yrot = 0 CALL manipulateobjects(3, 90, yrot, 0, 0, -50, .1) CALL BlastCls(&HA000, &H0, 0) CALL drawboss WEND CALL teletype("Top Secret", 15, 1, 2) CALL teletype("The Esirpretne", 15, 2, 4) CALL teletype("Object sighted on long range pulse radar", 1, 11, 4) CALL teletype("Speed:", 1, 14, 4) CALL teletype("Unknown", 8, 14, 5) CALL teletype("Range:", 1, 15, 4) CALL teletype("Unknown", 8, 15, 5) CALL teletype("Weapons:", 1, 16, 4) CALL teletype("Unknown", 10, 16, 5) CALL teletype("Crew:", 1, 17, 4) CALL teletype("Unknown", 7, 17, 5) SLEEP 10 CALL warp(3) q$ = INKEY$ WHILE q$ = "" q$ = INKEY$ a = a + 1 IF a > 360 THEN a = 1 xrot = (2 * a) yrot = a zrot = 90 * SIN(a * (3.14 / 180)) IF zrot < 1 THEN zrot = 360 IF zrot > 360 THEN zrot = 1 IF xrot > 360 THEN xrot = 1 IF xrot < 1 THEN xrot = 360 CALL manipulateobjects(4, xrot, yrot, zrot, 0, 0, .1) CALL BlastCls(&HA000, &H0, 0) CALL drawbigone WEND yrot = 0 CLS q$ = INKEY$ WHILE q$ = "" q$ = INKEY$ yrot = yrot + 1 IF yrot > 360 THEN yrot = 0 CALL manipulateobjects(4, 90, yrot, 0, 0, -50, .1) CALL BlastCls(&HA000, &H0, 0) CALL drawbigone WEND CALL teletype("Top Secret", 15, 1, 2) CALL teletype("The Destroyer", 15, 2, 4) CALL teletype("Object sighted on long range pulse radar", 1, 11, 4) CALL teletype("Speed:", 1, 14, 4) CALL teletype("Unknown", 8, 14, 5) CALL teletype("Range:", 1, 15, 4) CALL teletype("Unknown", 8, 15, 5) CALL teletype("Weapons:", 1, 16, 4) CALL teletype("Unknown", 10, 16, 5) CALL teletype("Crew:", 1, 17, 4) CALL teletype("Unknown", 7, 17, 5) SLEEP 10 CALL warp(4) CLS CALL teletype("Downloading LRPR Images", 1, 1, 1) CALL teletype("Please Wait...", 1, 2, 1) FOR x = 0 TO 10000: NEXT SLEEP 10 CALL planets SLEEP 10 SLEEP 3 SCREEN 13 CALL teletype("LRPR indicates ...", 1, 1, 4) CALL teletype("hostiles have invaded Titan4", 1, 2, 4) CALL teletype("Press Blackout continued", 1, 3, 4) CALL teletype("DEFCONX increased to full readiness", 1, 4, 4) CALL teletype("Raven prototype is operational", 1, 5, 4) CALL teletype("Quantum Nuclear Missles Armed!", 1, 6, 4) CALL teletype("Enemy expected to attack within 48 hours", 1, 7, 4) CALL teletype("Must get to Titan4 and take them out", 1, 8, 4) CALL teletype("Fly though canyon to advoid StoA missles", 1, 9, 4) SLEEP 10 CLS q$ = INKEY$ WHILE q$ = "" q$ = INKEY$ a = a + 1 IF a > 360 THEN a = 1 xrot = (2 * a) yrot = a zrot = 90 * SIN(a * (3.14 / 180)) IF zrot < 1 THEN zrot = 360 IF zrot > 360 THEN zrot = 1 IF xrot > 360 THEN xrot = 1 IF xrot < 1 THEN xrot = 360 CALL manipulateobjects(5, xrot, yrot, zrot, 0, 0, 3) CALL BlastCls(&HA000, &H0, 0) CALL drawcanyon WEND yrot = 0 CLS q$ = INKEY$ WHILE q$ = "" q$ = INKEY$ yrot = yrot + 1 IF yrot > 360 THEN yrot = 0 CALL manipulateobjects(5, 0, yrot, 0, 0, -75, 4) CALL BlastCls(&HA000, &H0, 0) CALL drawcanyon WEND CALL teletype("Top Secret", 15, 1, 2) CALL teletype("The Canyon", 15, 2, 4) CALL teletype("Object sighted Titan4", 1, 11, 4) CALL teletype("Lenght:", 1, 14, 4) CALL teletype("512km", 8, 14, 5) CALL teletype("Depth:", 1, 15, 4) CALL teletype("200app", 8, 15, 5) CALL teletype("Width:", 1, 16, 4) CALL teletype("76km", 8, 16, 5) CALL teletype("Most Narrow Point:", 1, 17, 4) CALL teletype("Unknown", 20, 17, 5) SLEEP 12 CLS CALL teletype("Good Luck Pilot", 1, 1, 6) SLEEP 5 LOCATE 15, 1: PRINT "End of Demo" LOCATE 16, 1: PRINT "Send commmts to:saKhabir@aol.com" LOCATE 24, 1: PRINT "ESC to quit" SLEEP 20 END SUB SUB titles 'i tried to program the sound blaster card but failed 'i tried to write a line drawing rotine in asm but failed 'i tried to write a 3d eng in asm but failed 'i tried to write a putpixel modex routine but failed 'i tried to write a block copy rotine by failed 'i tried to program the DMA but failed 'i tried to write a MCommand game but failed 'it is time I try windows programming so that i am in the same league 'aliakam LOCATE 1, 1: PRINT "TITAN IV" 'SLEEP 5 END SUB SUB updateplanet FOR x = 0 TO 15 IF x = 3 OR x = 7 OR x = 8 OR x = 10 OR x = 11 OR x = 12 OR x = 13 OR x = 15 THEN GOSUB moon: GOSUB skip2 planet(x).angle = planet(x).angle + 1 IF planet(x).angle > 360 THEN planet(x).angle = 0 planet(x).x = calcsin(planet(x).radius, planet(x).angle) planet(x).y = calccos(planet(x).radius, planet(x).angle) skip2: NEXT x EXIT SUB moon: planet(x).angle = planet(x).angle + 10 IF planet(x).angle > 360 THEN planet(x).angle = 0 SELECT CASE x CASE 10 TO 13 planet(x).x = calcsin(planet(x).radius, planet(x).angle) + planet(9).x planet(x).y = calccos(planet(x).radius, planet(x).angle) + planet(9).y RETURN CASE 15 planet(x).x = calcsin(planet(x).radius, planet(x).angle) + planet(14).x planet(x).y = calccos(planet(x).radius, planet(x).angle) + planet(14).y RETURN CASE 7 TO 8 planet(x).x = calcsin(planet(x).radius, planet(x).angle) + planet(6).x planet(x).y = calccos(planet(x).radius, planet(x).angle) + planet(6).y RETURN CASE 3 planet(x).x = calcsin(planet(x).radius, planet(x).angle) + planet(2).x planet(x).y = calccos(planet(x).radius, planet(x).angle) + planet(2).y END SELECT RETURN END SUB SUB warp (num) CLS RANDOMIZE TIMER IF num = 0 THEN cc = 180 ELSE cc = 0 DIM oldview(100) AS scalar DIM viewc(100) AS scalar DIM starz(100) AS SINGLE DIM starx(100) AS SINGLE DIM stary(100) AS SINGLE op = 0 FOR indexa = 0 TO 100 GOSUB newone NEXT indexa DIM flag DIM countx AS LONG DIM zoom AS SINGLE zoom = .03 WHILE (1) 'INKEY$ <> "q" FOR count = 0 TO 100 starz(count) = starz(count) - 1 'erase old, if z < 0 then get new star IF starz(count) <= 0 THEN indexa = count: GOSUB newone PRESET (oldview(count).x, oldview(count).y), 0 NEXT count FOR count = 0 TO 100 'get coords to display viewc(count).x = ((starx(count) * 256) / starz(count)) + 160 ' 3d to 2d viewc(count).y = ((stary(count) * 256) / starz(count)) + 100 oldview(count).x = viewc(count).x oldview(count).y = viewc(count).y NEXT count FOR count = 0 TO 100 'draw them stars PRESET (viewc(count).x, viewc(count).y), starz(count) NEXT count IF countx > 75 THEN zoom = zoom + .05: CALL BlastCls(&HA000, &H0, 0) IF zoom >= 4 THEN EXIT SUB 'LOCATE 1, 1: PRINT countx CALL manipulateobjects(num, 90, 0, cc, 0, 0, zoom) SELECT CASE (num) CASE 0 drawv CASE 1 drawes1 CASE 2 drawes2 CASE 3 drawboss CASE 4 drawbigone END SELECT countx = countx + 1 WEND EXIT SUB newone: ' make a new star at random start points, and z axis RANDOMIZE TIMER x = -80 + INT(160 * RND) y = -100 + INT(200 * RND) z = 1 + INT(256 * RND) starx(indexa) = x stary(indexa) = y starz(indexa) = z RETURN END SUB