sorry about that. the other one is my first version. it only has a little rotating ship. this one is controlled by the mouse. I hope you like it. move the mouse to tip the ship, and press the left mouse button to go in that direction, and go higher. the right mouse button controls the beam.
If you hit a guy, they turn red and you cannot get them. if you get them with the beam, they turn green. if you hit a building, you die. oh, and the game over message is screwed up. :oops:
Code:
DEFINT A-Z
DECLARE SUB mouse (cx, dx, bx)
DECLARE SUB mousepointer (SW)
DIM SHARED a(9) 'Set up array for code
DEF SEG = VARSEG(a(0)) 'Get array segment (nnnn: )
' (two 8 bit)
FOR i = 0 TO 17 'length of DATA to
READ r 'read
POKE VARPTR(a(0)) + i, r 'into array/2 (nnnn:iiii) (one 8 bit)
NEXT i 'until 17
'**************************** Machine Code *********************************
DATA &HB8,&H00,&H00 : ' mov AX,[n] [Swap code-(L),(H)] in AX
DATA &H55 : ' push BP Save BP
DATA &H8B,&HEC : ' mov BP,SP Get BP to c Seg
DATA &HCD,&H33 : ' int 33 Interrupt 33
DATA &H92 : ' xchg AX,[reg] [Swap code-reg] in AX
DATA &H8B,&H5E,&H06 : ' mov BX,[BP+6] Point to (variable)
DATA &H89,&H07 : ' mov [BX],AX Put AX in (variable)
DATA &H5D : ' pop BP Restore BP
DATA &HCA,&H02,&H00 : ' ret 2 Far return
SCREEN 13
'****************************** Mouse set up ******************************
CALL mousepointer(0) 'Reset mouse and
CALL mousepointer(1) 'turn pointer off
CALL mousepointer(3) 'Get coordinates
'****************************** P R O G R A M ******************************
DIM guy(100, 100)
DIM ship(100, 100)
DIM c!(360), s!(360)
DIM px(1000)
DIM py(1000)
DIM b(100, 100)
FOR i = 1 TO 360
c!(i) = COS(i * 3.14 / 180)
s!(i) = SIN(i * 3.14 / 180)
NEXT
cx = 160
cy = 100
SCREEN 13
FOR yer = 1 TO 15
FOR xer = 1 TO 30
READ ship(xer, yer)
NEXT xer
NEXT yer
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,0,0,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,3,1,3,3,30,3,0,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,3,1,3,3,3,3,30,3,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,3,1,3,3,3,3,3,3,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0
DATA 0,0,0,0,1,1,1,24,25,25,25,25,26,26,26,26,27,27,28,28,29,29,30,1,1,1,0,0,0,0
DATA 0,0,0,1,23,23,24,24,25,25,25,26,26,26,26,27,27,27,28,28,28,29,29,29,30,30,1,0,0,0
DATA 0,3,1,3,1,1,3,1,1,3,1,1,1,1,3,1,1,1,1,3,1,1,3,1,1,3,1,3,1,0
DATA 3,1,3,1,1,3,1,1,1,3,1,1,1,1,3,1,1,1,1,3,1,1,1,3,1,1,3,1,3,1
DATA 0,1,1,1,22,22,23,23,24,24,24,25,25,25,26,26,26,27,27,27,28,28,28,29,29,29,1,1,1,0
DATA 0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0
DATA 0,0,0,0,0,0,0,1,21,21,22,22,23,23,23,23,24,24,25,25,26,27,1,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,30,3,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,30,3,0,0,0,0,0,0,0,0,0,0,0,0
FOR yer = 1 TO 12
FOR xer = 1 TO 7
READ guy(xer, yer)
NEXT xer
NEXT yer
DATA 0,0,6,6,6,0,0
DATA 0,0,14,14,14,0,0
DATA 0,0,14,4,14,0,0
DATA 3,2,2,2,2,2,3
DATA 3,2,2,2,2,2,3
DATA 3,2,2,2,2,2,3
DATA 0,3,3,3,3,3,0
DATA 0,3,3,3,3,3,0
DATA 0,3,3,0,3,3,0
DATA 0,3,3,0,3,3,0
DATA 0,6,6,0,6,6,0
DATA 6,6,6,0,6,6,6
FOR yer = 0 TO 9
FOR xer = 0 TO 16
READ b(xer, yer)
FOR xe = 1 TO 20
FOR ye = 1 TO 20
PSET ((xe + (20 * xer)), (ye + (20 * yer))), b(xer, yer)
NEXT ye
NEXT xe
NEXT xer
NEXT yer
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0
DATA 0,0,0,4,4,0,0,0,0,0,0,0,0,1,0,0,0
DATA 0,0,0,6,6,0,0,0,0,0,0,0,0,1,0,0,0
DATA 0,0,0,6,6,0,0,0,2,0,2,0,0,1,1,0,0
DATA 0,0,6,6,6,6,0,0,1,0,1,0,0,1,1,1,1
DATA 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6
pnum = 3
FOR rer = 1 TO pnum
READ px(rer)
READ py(rer)
NEXT rer
DATA 1,168
DATA 135,168
DATA 302,148
x = 160
y = 70
angle = 1
DO
Key$ = INKEY$
CALL mouse(cx, dx, bx)
FOR rer = 1 TO pnum
IF (guy$(rer) <> "") THEN Key$ = "q" ELSE Key$ = INKEY$
NEXT rer
LOCATE 1, 1: PRINT Key$
IF (Key$ = "q") THEN
IF (guy$(rer) = "G") THEN
LOCATE 5, 15: PRINT "Game Over"
LOCATE 6, 16: PRINT "You Win"
ELSE
LOCATE 5, 15: PRINT "Game Over"
LOCATE 6, 15: PRINT "You loose"
END IF
END IF
FOR rer = 1 TO pnum
FOR yer = 1 TO 12
FOR xer = 1 TO 7
PSET (px(rer) + xer, py(rer) + yer), 0
NEXT xer
NEXT yer
FOR yer = 1 TO 12
FOR xer = 1 TO 7
IF (guy$(rer) <> "N" AND guy$(rer) <> "G") THEN
PSET (px(rer) + xer, py(rer) + yer), guy(xer, yer)
ELSEIF (guy$(rer) = "N") THEN
PSET (px(rer) + xer, py(rer) + yer), 4
ELSEIF (guy$(rer) = "G") THEN
PSET (px(rer) + xer, py(rer) + yer), 2
END IF
NEXT xer
NEXT yer
IF (px(rer) >= (x - 10) AND px(rer) <= (x + 10)) THEN
IF (las$ <> "Y") THEN
IF (py(rer) >= (y - 7) AND py(rer) <= (y + 7)) THEN
guy$(rer) = "N"
END IF
ELSE
IF (guy$(rer) <> "N") THEN
guy$(rer) = "G"
END IF
END IF
END IF
NEXT rer
FOR yer = 1 TO 15
FOR xer = 1 TO 30
xx = (xer - 15) * c!(angle) + (yer - 7.5) * s!(angle)
yy = (yer - 7.5) * c!(angle) - (xer - 15) * s!(angle)
PSET ((xx + x), (yy + y)), 0
NEXT xer
NEXT yer
IF (dx < 160) THEN
angle = (160 - dx) / 3
ELSEIF (dx > 160) THEN
angle = 360 - (dx - 160) / 3
END IF
IF (bx = 2) THEN
las$ = "Y"
IF (x > 2 OR x < -2) THEN
xs = xs / 3
END IF
LINE (x - 5, y)-((x + 5), 200), 0, BF
LINE (x - 2, y)-((x + 2), 200), 14, BF
END IF
IF (las$ = "Y") THEN
IF (x > 2 OR x < -2) THEN
xs = xs / 3
END IF
LINE (x - 5, y)-((x + 5), 200), 0, BF
LINE (x - 2, (y + 8))-((x + 2), 200), 14, BF
END IF
IF (bx <> 2 AND las$ = "Y") THEN
las$ = "N"
LINE (x - 5, y)-((x + 5), 200), 0, BF
LINE (x - 2, y)-((x + 2), 200), 0, BF
END IF
tr = tr + 1
IF (tr >= 15) THEN
tr = 0
IF (bx = 1) THEN
IF (dx < 160) THEN
xs = xs + (dx - 160) / 60
ELSEIF (dx > 160) THEN
xs = xs - (160 - dx) / 60
END IF
END IF
END IF
t = t + 1
IF (t >= 15) THEN
t = 0
IF (bx = 1) THEN
ys = ys - 1
END IF
END IF
at = at + 1
aat = aat + 1
IF (at >= 40) THEN
at = 0
ys = ys + 1
END IF
IF (aat >= 20) THEN
aat = 0
y = y + ys
x = x + xs
colr = (INT(RND * 16))
END IF
IF angle < 1 THEN angle = 359
IF angle > 359 THEN angle = 1
IF (b((x / 20), (y / 20)) <> 0) THEN
Key$ = "q"
END IF
FOR yer = 1 TO 15
FOR xer = 1 TO 30
xx = (xer - 15) * c!(angle) + (yer - 7.5) * s!(angle)
yy = (yer - 7.5) * c!(angle) - (xer - 15) * s!(angle)
ya = ship(xer, yer)
IF (ya = 3 AND bx = 2) THEN
PSET ((xx + x), (yy + y)), colr
ELSE
PSET ((xx + x), (yy + y)), ship(xer, yer)
END IF
NEXT xer
NEXT yer
LOOP UNTIL Key$ = "q"
'-------------------| THE END (Cut here)|----------------------------------
SUB mouse (cx, dx, bx)
POKE VARPTR(a(4)), &H92 'Swap code,Get CX setup
CALL absolute(cx, VARPTR(a(0))) 'Run Code
' cx = cx / 8 'Adjust 25x80
POKE VARPTR(a(4)), &H91 'Swap code,Get DX setup
CALL absolute(dx, VARPTR(a(0))) 'Run Code
dx = dx / 2 'Adjust 25x80
POKE VARPTR(a(4)), &H93 'Swap code,Get BX setup
CALL absolute(bx, VARPTR(a(0))) 'Run Code
'Note :
'Remove the /8
'for graphics modes.
END SUB
SUB mousepointer (SW)
POKE VARPTR(a(0)) + 1, SW 'Swap code,Set AX = (SW)
CALL absolute(c, VARPTR(a(0))) 'Run Code
'Note:
'SW = 0-reset
'SW = 1-on
'SW = 2-off
'SW = 3-coordinates
END SUB
[/code]