Under version-control.
This commit is contained in:
commit
b20967daec
314
3dland.bas
Normal file
314
3dland.bas
Normal file
@ -0,0 +1,314 @@
|
||||
''''''''''''''''
|
||||
' Let's see if we can make us some 3D graphics! In Basic, Hehe.
|
||||
|
||||
DECLARE FUNCTION maxval% (v1%, v2%, limit%)
|
||||
DECLARE FUNCTION minval% (v1%, v2%, v3%)
|
||||
DECLARE SUB hline (x1%, x2%, y%, c%)
|
||||
DECLARE FUNCTION min% (v1%, v2%, v3%)
|
||||
DECLARE FUNCTION max% (v1%, v2%, v3%)
|
||||
DECLARE SUB pal ()
|
||||
DECLARE SUB pixel (x%, y%, c%)
|
||||
|
||||
DEFINT A-Z 'set default var type to int 'cos it's my fav.
|
||||
'$STATIC 'use static arrays
|
||||
CLS 'clear the screen. duh
|
||||
SCREEN 13 'initialize screen mode 13 (0x013 (19) 4 real)
|
||||
|
||||
CONST SCRX = 320 'sort of like #define so I can use SCRX/Y instead
|
||||
CONST SCRY = 200 'of the actual #'s in case the width changes, etc.
|
||||
CONST CLRS = 255 'ditto w/ color depth
|
||||
CONST HLFX = 160 'half the screen width
|
||||
CONST HLFY = 100 'half screen height (both use lots, should save calc.)
|
||||
CONST PI = 3.141592654# 'close enuf
|
||||
CONST VIEWRANGE = 16 'how far before fade to blackness
|
||||
CONST MSZE = 16 'size of the map (x & y are = )
|
||||
CONST MHGT = 4 'height of random mountains (TEMP)
|
||||
CONST MININT = -32768 'lowest possible integer
|
||||
CONST CONTRAST = 20 'multiplied by light values
|
||||
CONST AMBIENT = 50 'added to light values
|
||||
|
||||
LOCATE 1, 1: COLOR 200: PRINT "Loading"
|
||||
|
||||
' make lookup-tables
|
||||
DIM sine(0 TO 255) AS SINGLE
|
||||
DIM cosine(0 TO 255) AS SINGLE
|
||||
FOR i = 0 TO 255
|
||||
sine(i) = SIN(i) * PI / 200 'Convert rad to "hex"
|
||||
cosine(i) = COS(i) * PI / 200 'Convert rad to "hex"
|
||||
NEXT i
|
||||
'Note to self: REMEMBER I'm using "hexians" (256) NOT degrees (360)
|
||||
|
||||
'Layout of the landscape. . . just some random sample data for now!
|
||||
DIM land(1 TO MSZE, 1 TO MSZE) AS INTEGER 'array containing landscape
|
||||
RANDOMIZE TIMER 'use timer to seed random
|
||||
'# generator
|
||||
FOR x = 1 TO MSZE
|
||||
FOR y = 1 TO MSZE
|
||||
land(x, y) = INT(RND * MHGT) 'fill w/ random data
|
||||
NEXT y
|
||||
NEXT x
|
||||
|
||||
'make a variable to hold edge buffers
|
||||
TYPE edge
|
||||
ls AS INTEGER
|
||||
rs AS INTEGER
|
||||
END TYPE
|
||||
DIM edge(0 TO SCRY) AS edge
|
||||
|
||||
'. . . and make an gradiant green palette
|
||||
OUT &H3C8, 0 ' tell port whole palette is coming (otherwise # of color)
|
||||
FOR i = 0 TO 255
|
||||
OUT &H3C9, 0 'red
|
||||
OUT &H3C9, INT(i / 4) 'green
|
||||
OUT &H3C9, 0 'blue
|
||||
'Hahaha! I'll never use THIS command again,
|
||||
'PALETTE i, INT(i / 4) * 256
|
||||
NEXT i
|
||||
|
||||
' Initialize the player variale to hold info on player position
|
||||
TYPE spot
|
||||
x AS INTEGER 'x runs horizontally to player (pitch)
|
||||
y AS INTEGER 'y runs out from player (roll)
|
||||
z AS INTEGER 'z runs up and down (yaw) aka altitude
|
||||
'I know these are not std. but they fit better w/ the flat map
|
||||
END TYPE
|
||||
DIM pov AS spot
|
||||
DIM currentpoint AS spot ' used w/i the program loop
|
||||
pov.x = 8
|
||||
pov.y = -8
|
||||
pov.z = 7
|
||||
|
||||
'temp
|
||||
DIM points(1 TO MSZE, 1 TO MSZE) AS spot'uses x and y as screen co-ords & z as
|
||||
'distance
|
||||
DIM ver(1 TO 3) AS spot 'vertex: used for drawing polygons, x
|
||||
'and y are co-ords & z is color
|
||||
DIM tmp(1 TO 3) AS spot 'used w/ ver for sorting
|
||||
|
||||
BEEP
|
||||
CLS
|
||||
|
||||
DO
|
||||
a$ = INKEY$
|
||||
SELECT CASE a$
|
||||
CASE "a": pov.x = pov.x + 1: CLS
|
||||
CASE "d": pov.x = pov.x - 1: CLS
|
||||
CASE "w": pov.y = pov.y + 1: CLS
|
||||
CASE "s": pov.y = pov.y - 1: CLS
|
||||
CASE "e": pov.z = pov.z + 1: CLS
|
||||
CASE "c": pov.z = pov.z - 1: CLS
|
||||
CASE CHR$(27): SYSTEM
|
||||
END SELECT
|
||||
FOR x = 1 TO MSZE
|
||||
FOR y = 1 TO MSZE
|
||||
'in front of us
|
||||
rely = y - pov.y
|
||||
relx = x - pov.x
|
||||
relz = land(x, y) - pov.z
|
||||
IF rely > 0 AND ABS(relx) <= rely AND ABS(relz) <= rely THEN
|
||||
points(x, y).y = HLFY - relz * HLFY / rely
|
||||
points(x, y).x = HLFX - relx * HLFX / rely
|
||||
'a^3 = b^3 + c^3 + d^3 to find z (pixel dist.)
|
||||
points(x, y).z = (ABS(relz) ^ 3 + ABS(rely) ^ 3 + ABS(relx) ^ 3) ^ (1 / 3)
|
||||
ELSE points(x, y).z = -1
|
||||
IF points(x, y).y < 0 OR points(x, y).y > SCRY OR points(x, y).x < 0 OR points(x, y).x > SCRX OR points(x, y).z > VIEWRANGE THEN points(x, y).z = -1
|
||||
END IF
|
||||
NEXT y
|
||||
NEXT x
|
||||
|
||||
FOR y = MSZE - 1 TO 1 STEP -1
|
||||
FOR x = MSZE - 1 TO 1 STEP -1
|
||||
'if the current point has not been flagged as offscreen, out of FOV, or not w/i range of VIEWRANGE (z=-1)
|
||||
IF points(x, y).z >= 0 THEN
|
||||
'seperate into two triangles
|
||||
FOR p = 0 TO 1
|
||||
'get points of tri.
|
||||
IF p = 0 THEN
|
||||
ver(1).x = points(x, y).x: ver(1).y = points(x, y).y: ver(1).z = points(x, y).z
|
||||
ver(2).x = points(x, y + 1).x: ver(2).y = points(x, y + 1).y: ver(2).z = points(x, y + 1).z
|
||||
ver(3).x = points(x + 1, y + 1).x: ver(3).y = points(x + 1, y + 1).y: ver(3).z = points(x + 1, y + 1).z
|
||||
ELSE
|
||||
'sides 1 & 3 are reversed so will be
|
||||
'in same rotational order (this could
|
||||
'be more efficient - swap lables)
|
||||
ver(3).x = points(x, y).x: ver(3).y = points(x, y).y: ver(3).z = points(x, y).z
|
||||
ver(1).x = points(x + 1, y + 1).x: ver(1).y = points(x + 1, y + 1).y: ver(1).z = points(x + 1, y + 1).z
|
||||
'side 2 is other corner of square
|
||||
ver(2).x = points(x + 1, y).x: ver(2).y = points(x + 1, y).y: ver(2).z = points(x + 1, y).z
|
||||
END IF
|
||||
|
||||
'translate tri. so ver[1] is origin
|
||||
'of tmp, w/ V2 & V3 as vectors
|
||||
tmp(2).x = ver(2).x - ver(1).x
|
||||
tmp(2).y = ver(2).y - ver(1).y
|
||||
tmp(3).x = ver(3).x - ver(1).x
|
||||
tmp(3).y = ver(3).y - ver(1).y
|
||||
|
||||
'if we are facing the polygon (uses
|
||||
'vectors to find if c.clockwise)
|
||||
IF tmp(2).x * tmp(3).y < tmp(3).x * tmp(2).y THEN
|
||||
'sort ver[] tp-bt
|
||||
GOSUB sort
|
||||
|
||||
'find tri. height
|
||||
dy = ver(1).y - ver(3).y
|
||||
|
||||
'delta-y for short side 1
|
||||
dy1 = ver(1).y - ver(2).y
|
||||
|
||||
'slope of long side
|
||||
m! = (ver(3).x - ver(1).x) / dy
|
||||
|
||||
'find width at middle
|
||||
midwidth = ver(2).x - (ver(1).x + (m! * dy1))
|
||||
|
||||
'if long side is on the left
|
||||
'IF midwidth > 1 THEN
|
||||
'if width is big enough to see
|
||||
IF ABS(midwidth) > 1 THEN
|
||||
'if height is big enough to see
|
||||
IF dy > 1 THEN
|
||||
'delta-y of short side 2
|
||||
dy2 = ver(2).y - ver(3).y
|
||||
'slope of short side 1 (clause prevents div by 0)
|
||||
IF ABS(dy1) > 0 THEN m1! = (ver(2).x - ver(1).x) / dy1
|
||||
'slope of short side 2 (clause prevents division by 0)
|
||||
IF ABS(dy2) > 0 THEN m2! = (ver(3).x - ver(2).x) / dy2
|
||||
'calculate the color
|
||||
'colr = points(x, y).y - points(x + 1, y + 1).y + 30'VIEWRANGE - ver(1).z + 20
|
||||
IF p = 0 THEN
|
||||
colr = (land(x, y + 1) - (land(x, y) + land(x + 1, y + 1)) / 2) * CONTRAST + AMBIENT
|
||||
ELSE
|
||||
colr = ((land(x, y) + land(x + 1, y + 1)) / 2 - land(x + 1, y)) * CONTRAST + AMBIENT
|
||||
END IF
|
||||
FOR h = 0 TO dy
|
||||
ypos = ver(1).y - h
|
||||
IF h <= dy1 THEN
|
||||
LINE (ver(1).x + (m! * h), ypos)-(ver(1).x + (m1! * h), ypos), colr
|
||||
'xa = ver(1).x + (m! * h)
|
||||
'xb = ver(1).x + (m1! * h)
|
||||
'x1 = minval(xa, xb, 0)
|
||||
'x2 = maxval(xa, xb, SCRX)
|
||||
'hline x1, x2, ypos, colr
|
||||
ELSE
|
||||
LINE (ver(1).x + (m! * h), ypos)-(ver(2).x + (m2! * (h - dy1)), ypos), colr
|
||||
'xa = ver(1).x + (m! * h)
|
||||
'xb = ver(2).x + (m2! * h)
|
||||
'x1 = minval(xa, xb, 0)
|
||||
'x2 = maxval(xa, xb, SCRX)
|
||||
'hline x1, x2, ypos, colr
|
||||
END IF
|
||||
NEXT h
|
||||
END IF
|
||||
END IF
|
||||
'END IF
|
||||
|
||||
'if long side is on the right
|
||||
'IF midwidth < -1 THEN
|
||||
'END IF
|
||||
|
||||
'else is too thin to see
|
||||
'LINE (ver(1).x, ver(1).y)-(ver(2).x, ver(2).y), 255'VIEWRANGE - ver(1).z
|
||||
'LINE (ver(2).x, ver(2).y)-(ver(3).x, ver(3).y), 255'VIEWRANGE - ver(1).z
|
||||
'LINE (ver(3).x, ver(3).y)-(ver(1).x, ver(1).y), 255'VIEWRANGE - ver(1).z
|
||||
END IF
|
||||
NEXT p
|
||||
END IF
|
||||
NEXT x
|
||||
NEXT y
|
||||
LOOP
|
||||
|
||||
sort:
|
||||
'assign tmp the values of ver
|
||||
FOR i = 1 TO 3
|
||||
tmp(i).x = ver(i).x
|
||||
tmp(i).y = ver(i).y
|
||||
tmp(i).z = ver(i).z
|
||||
NEXT i
|
||||
|
||||
'order them top to bottom [1st pnt]
|
||||
flag = max(tmp(1).y, tmp(2).y, tmp(3).y)
|
||||
'used to skip 3rd calculation
|
||||
topflag = flag
|
||||
'assign values to the first vertex
|
||||
ver(1).x = tmp(flag).x: ver(1).y = tmp(flag).y: ver(1).z = tmp(flag).z
|
||||
'make y lowest possible # 4 further compares
|
||||
tmp(flag).y = MININT
|
||||
|
||||
'order top-bottom 2 (prev. top is now -32768)
|
||||
flag = max(tmp(1).y, tmp(2).y, tmp(3).y)
|
||||
'add to flag to find which of 3 is not used
|
||||
topflag = topflag + flag
|
||||
'assign values to the 2nd vertex
|
||||
ver(2).x = tmp(flag).x: ver(2).y = tmp(flag).y: ver(2).z = tmp(flag).z
|
||||
|
||||
'use topflag to find last point in order
|
||||
SELECT CASE topflag
|
||||
CASE 3 'used 1 & 2
|
||||
flag = 3
|
||||
CASE 4 'used 1 & 3
|
||||
flag = 2
|
||||
CASE 5 'used 2 & 3
|
||||
flag = 1
|
||||
CASE ELSE 'just in case
|
||||
BEEP
|
||||
flag = 1
|
||||
END SELECT
|
||||
'assign values to the 3rd vertex
|
||||
ver(3).x = tmp(flag).x: ver(3).y = tmp(flag).y: ver(3).z = tmp(flag).z
|
||||
|
||||
RETURN
|
||||
|
||||
SUB hline (x1, x2, y, c)
|
||||
FOR i = x1 TO x2
|
||||
pixel i, y, c
|
||||
NEXT i
|
||||
END SUB
|
||||
|
||||
''''''''''''''''
|
||||
' Returns 1, 2, or 3, depending on which value: 1st, 2nd, or 3d is largest
|
||||
FUNCTION max (v1, v2, v3)
|
||||
r = 0
|
||||
IF v1 >= v2 AND v1 >= v3 THEN r = 1
|
||||
IF v2 >= v1 AND v2 >= v3 THEN r = 2
|
||||
IF v3 >= v2 AND v3 >= v1 THEN r = 3
|
||||
max = r
|
||||
END FUNCTION
|
||||
|
||||
''''''''''''''''
|
||||
' Returns the largest of the three values passed to it w/i limit
|
||||
FUNCTION maxval (v1, v2, limit)
|
||||
r = 0
|
||||
IF v1 >= v2 THEN r = v1
|
||||
IF v2 >= v1 THEN r = v2
|
||||
IF r > limit THEN r = limit
|
||||
maxval = r
|
||||
END FUNCTION
|
||||
|
||||
''''''''''''''''
|
||||
' Returns the smallest of the three values passed to it w/i limit
|
||||
FUNCTION minval (v1, v2, limit)
|
||||
r = 0
|
||||
IF v1 <= v2 THEN r = v1
|
||||
IF v2 <= v1 THEN r = v2
|
||||
IF r < limit THEN r = limit
|
||||
minval = r
|
||||
END FUNCTION
|
||||
|
||||
'This SUB does the same thing as PSET only by writing directly to the video
|
||||
'memory which *should* be much faster (Muahahaha!)
|
||||
'
|
||||
SUB pixel (x, y, c)
|
||||
DEF SEG = &HA000 'A000h is where the video mem. starts in mode
|
||||
'13h, which we're using
|
||||
IF x < 0 OR x > SCRX THEN EXIT SUB 'make sure x is on the screen
|
||||
IF y < 0 OR y > SCRY THEN EXIT SUB 'make sure y is on the screen
|
||||
'(We do NOT want to be writing directly into
|
||||
'memory somewhere we're not supposed to!)
|
||||
IF c < 0 OR c > CLRS THEN EXIT SUB 'make sure c is w/i the color palette
|
||||
y& = y 'needed to prevent overflow (where's an
|
||||
'unsigned int when you need it?)
|
||||
POKE y& * SCRX + x, c 'put c into the right spot offset from A000h
|
||||
'(pixels go lt-rt, tp-bt in a linear fashion)
|
||||
END SUB
|
||||
|
2
3dland.bas.d
Normal file
2
3dland.bas.d
Normal file
@ -0,0 +1,2 @@
|
||||
3D Landscape - ADSWEC Controls; a good example of what a 3D engine looks like
|
||||
without important stuff like clipping and rotation.
|
BIN
3dland.exe
Normal file
BIN
3dland.exe
Normal file
Binary file not shown.
1
3dland.exe.d
Normal file
1
3dland.exe.d
Normal file
@ -0,0 +1 @@
|
||||
Compiled.
|
266
3dobject.bas
Normal file
266
3dobject.bas
Normal file
@ -0,0 +1,266 @@
|
||||
'default integer type
|
||||
DEFINT A-Z
|
||||
|
||||
'screen mode 13h
|
||||
SCREEN 13
|
||||
|
||||
'set palette
|
||||
'. . . and make an gradiant green palette
|
||||
OUT &H3C8, 0 ' tell port whole palette is coming (otherwise # of color)
|
||||
FOR i = 0 TO 255
|
||||
OUT &H3C9, 10 'red
|
||||
OUT &H3C9, INT(i / 4) 'green
|
||||
OUT &H3C9, 50 'blue
|
||||
NEXT i
|
||||
|
||||
'define program constants
|
||||
'CONST SCRX = 320 unused
|
||||
'CONST SCRY = 200
|
||||
'CONST CLRS = 255
|
||||
CONST HLFX = 160
|
||||
CONST HLFY = 100
|
||||
CONST PI = 3.141592654#
|
||||
CONST FACES = 11
|
||||
CONST SHAPES = 0
|
||||
|
||||
'trig lookup-tables
|
||||
DIM sine(255) AS SINGLE: DIM cosine(255) AS SINGLE
|
||||
FOR i = 0 TO 255
|
||||
sine(i) = SIN(i * PI / 128)
|
||||
cosine(i) = COS(i * PI / 128)
|
||||
NEXT i
|
||||
|
||||
'data types:
|
||||
'integer vector (for initial shape data)
|
||||
TYPE vec3it
|
||||
x AS INTEGER
|
||||
y AS INTEGER
|
||||
z AS INTEGER
|
||||
END TYPE
|
||||
'real vector
|
||||
TYPE vec3t
|
||||
x AS SINGLE
|
||||
y AS SINGLE
|
||||
z AS SINGLE
|
||||
END TYPE
|
||||
'a face
|
||||
TYPE face3t
|
||||
'object vertices
|
||||
ov1 AS vec3it
|
||||
ov2 AS vec3it
|
||||
ov3 AS vec3it
|
||||
'world verteces
|
||||
wv1 AS vec3t
|
||||
wv2 AS vec3t
|
||||
wv3 AS vec3t
|
||||
END TYPE
|
||||
'an object
|
||||
TYPE objt
|
||||
p AS vec3t 'position
|
||||
r AS vec3it 'rotation
|
||||
END TYPE
|
||||
'a pixel point
|
||||
TYPE vec2it
|
||||
x AS INTEGER
|
||||
y AS INTEGER
|
||||
END TYPE
|
||||
'a triangle on-screen
|
||||
TYPE face2t
|
||||
v1 AS vec2it
|
||||
v2 AS vec2it
|
||||
v3 AS vec2it
|
||||
END TYPE
|
||||
|
||||
'make a 12-polygon shape
|
||||
DIM shape(0 TO SHAPES, 0 TO FACES) AS face3t 'holds shape's form (obj spc)
|
||||
DIM obj(0 TO SHAPES) AS objt 'holds shape's pos (wrld spc)
|
||||
'make the viewer
|
||||
DIM pov AS objt
|
||||
'make a variable to hold mapped 2d drawing data
|
||||
DIM tri AS face2t
|
||||
|
||||
'load the shape's data
|
||||
'base (-y)
|
||||
DATA -10,-10,-10, -10,-10,10, 10,-10,-10
|
||||
DATA -10,-10,10, 10,-10,10, 10,-10,-10
|
||||
'front (-z)
|
||||
DATA -10,-10,-10, 10,-10,-10, -10,10,-10
|
||||
DATA -10,10,-10, 10,-10,-10, 10,10,-10
|
||||
'left (-x)
|
||||
DATA -10,-10,-10, -10,10,-10, -10,-10,10
|
||||
DATA -10,-10,10, -10,10,-10, -10,10,10
|
||||
'top (+y)
|
||||
DATA 10,10,10, -10,10,-10, 10,10,-10
|
||||
DATA 10,10,10, -10,10,10, -10,10,-10
|
||||
'back (+z)
|
||||
DATA 10,10,10, 10,-10,10, -10,10,10
|
||||
DATA -10,10,10, 10,-10,10, -10,-10,10
|
||||
'right (+x)
|
||||
DATA 10,10,10, 10,10,-10, 10,-10,10
|
||||
DATA 10,-10,10, 10,10,-10, 10,-10,-10
|
||||
FOR i = 0 TO FACES
|
||||
READ shape(0, i).ov1.x 'read first vertex position
|
||||
READ shape(0, i).ov1.y
|
||||
READ shape(0, i).ov1.z
|
||||
READ shape(0, i).ov2.x 'read second vertex position
|
||||
READ shape(0, i).ov2.y
|
||||
READ shape(0, i).ov2.z
|
||||
READ shape(0, i).ov3.x 'read third vertex position
|
||||
READ shape(0, i).ov3.y
|
||||
READ shape(0, i).ov3.z
|
||||
NEXT i
|
||||
'read shape's starting position
|
||||
'imput strating pov position
|
||||
pov.p.x = 20
|
||||
pov.p.y = 30
|
||||
pov.p.z = -70
|
||||
|
||||
DO
|
||||
'draw the shapes
|
||||
FOR j = 0 TO SHAPES 'go through @ shape
|
||||
FOR i = 0 TO FACES 'go through @ face
|
||||
obj(j).r.y = (obj(j).r.y + 1) MOD 256
|
||||
'transform @ point from object to world space
|
||||
rx = obj(j).r.x 'extra 2-letter vars are for
|
||||
ry = obj(j).r.y 'simplification only
|
||||
rz = obj(j).r.z
|
||||
|
||||
vx = shape(j, i).ov1.x
|
||||
vy = shape(j, i).ov1.y
|
||||
vz = shape(j, i).ov1.z
|
||||
shape(j, i).wv1.x = ((vx * cosine(ry) - vz * sine(ry)) - pov.p.x)' * sine(pov.r.y)
|
||||
shape(j, i).wv1.y = vy - pov.p.y
|
||||
shape(j, i).wv1.z = ((vx * sine(ry) + vz * cosine(ry)) - pov.p.z)' * cosine(pov.r.y)
|
||||
|
||||
vx = shape(j, i).ov2.x
|
||||
vy = shape(j, i).ov2.y
|
||||
vz = shape(j, i).ov2.z
|
||||
shape(j, i).wv2.x = ((vx * cosine(ry) - vz * sine(ry)) - pov.p.x)' * sine(pov.r.y)
|
||||
shape(j, i).wv2.y = vy - pov.p.y
|
||||
shape(j, i).wv2.z = ((vx * sine(ry) + vz * cosine(ry)) - pov.p.z)' * cosine(pov.r.y)
|
||||
|
||||
vx = shape(j, i).ov3.x
|
||||
vy = shape(j, i).ov3.y
|
||||
vz = shape(j, i).ov3.z
|
||||
shape(j, i).wv3.x = ((vx * cosine(ry) - vz * sine(ry)) - pov.p.x)' * sine(pov.r.y)
|
||||
shape(j, i).wv3.y = vy - pov.p.y
|
||||
shape(j, i).wv3.z = ((vx * sine(ry) + vz * cosine(ry)) - pov.p.z)' * cosine(pov.r.y)
|
||||
|
||||
'map the world-space coords into a 2d triangle
|
||||
tri.v1.x = HLFX + (shape(j, i).wv1.x / shape(j, i).wv1.z * HLFX)
|
||||
tri.v1.y = HLFY - (shape(j, i).wv1.y / shape(j, i).wv1.z * HLFY)
|
||||
|
||||
tri.v2.x = HLFX + (shape(j, i).wv2.x / shape(j, i).wv2.z * HLFX)
|
||||
tri.v2.y = HLFY - (shape(j, i).wv2.y / shape(j, i).wv2.z * HLFY)
|
||||
|
||||
tri.v3.x = HLFX + (shape(j, i).wv3.x / shape(j, i).wv3.z * HLFX)
|
||||
tri.v3.y = HLFY - (shape(j, i).wv3.y / shape(j, i).wv3.z * HLFY)
|
||||
|
||||
'check if clockwise (backface culling)
|
||||
x1 = tri.v2.x - tri.v1.x 'make (x1, y1) & (x2, y2)
|
||||
x2 = tri.v3.x - tri.v1.x 'normalized
|
||||
y1 = tri.v2.y - tri.v1.y
|
||||
y2 = tri.v3.y - tri.v1.y
|
||||
IF x1 * y2 < x2 * y1 THEN
|
||||
'order the vertices top-bottom
|
||||
IF tri.v1.y > tri.v2.y THEN
|
||||
tmp = tri.v1.y
|
||||
tri.v1.y = tri.v2.y
|
||||
tri.v2.y = tmp
|
||||
tmp = tri.v1.x
|
||||
tri.v1.x = tri.v2.x
|
||||
tri.v2.x = tmp
|
||||
END IF
|
||||
IF tri.v1.y > tri.v3.y THEN
|
||||
tmp = tri.v1.y
|
||||
tri.v1.y = tri.v3.y
|
||||
tri.v3.y = tmp
|
||||
tmp = tri.v1.x
|
||||
tri.v1.x = tri.v3.x
|
||||
tri.v3.x = tmp
|
||||
END IF
|
||||
IF tri.v2.y > tri.v3.y THEN
|
||||
tmp = tri.v2.y
|
||||
tri.v2.y = tri.v3.y
|
||||
tri.v3.y = tmp
|
||||
tmp = tri.v2.x
|
||||
tri.v2.x = tri.v3.x
|
||||
tri.v3.x = tmp
|
||||
END IF
|
||||
|
||||
'find the color of the face
|
||||
colr = 255 - shape(j, i).wv1.z
|
||||
|
||||
''fill in the 2d triangle
|
||||
'dx = tri.v3.x - tri.v1.x
|
||||
'dy = tri.v3.y - tri.v1.y
|
||||
'dx1 = tri.v2.x - tri.v1.x
|
||||
'dy1 = tri.v2.y - tri.v1.y
|
||||
'dx1 = tri.v3.x - tri.v2.x
|
||||
'dy1 = tri.v3.y - tri.v2.y
|
||||
'
|
||||
'sdx = SGN(dx) 'sign of dy is always positive
|
||||
'sdx1 = SGN(dx1) 'since they've been sorted top to
|
||||
'sdx2 = SGN(dx2) 'bottom: sdy = 1; ady = dy
|
||||
'
|
||||
'adx = ABS(dx)
|
||||
'adx1 = ABS(dx1)
|
||||
'adx2 = ABS(dx2)
|
||||
'
|
||||
'px = tri.v1.x
|
||||
'px1 = tri.v1.x
|
||||
'x = 0
|
||||
'x1 = 0
|
||||
'x2 = 0
|
||||
'IF dy > adx THEN 'the line is tall
|
||||
' FOR h = 0 TO dy
|
||||
' x = x + adx
|
||||
' IF x > dy THEN px = px + sdx: x = x - dy
|
||||
' NEXT h
|
||||
'ELSE 'the line is wide
|
||||
'END IF
|
||||
|
||||
'wireframe
|
||||
IF colr >= 0 AND colr <= 255 THEN
|
||||
LINE (tri.v1.x, tri.v1.y)-(tri.v2.x, tri.v2.y), colr
|
||||
LINE (tri.v2.x, tri.v2.y)-(tri.v3.x, tri.v3.y), colr
|
||||
LINE (tri.v3.x, tri.v3.y)-(tri.v1.x, tri.v1.y), colr
|
||||
END IF
|
||||
END IF 'end backface cull
|
||||
NEXT i
|
||||
NEXT j
|
||||
a$ = INKEY$
|
||||
SELECT CASE a$
|
||||
CASE CHR$(27)
|
||||
SYSTEM
|
||||
CASE CHR$(13)
|
||||
SYSTEM
|
||||
CASE "w" 'forward
|
||||
pov.p.z = pov.p.z + 1
|
||||
CASE "s" 'back
|
||||
pov.p.z = pov.p.z - 1
|
||||
CASE "a" 'strafe left
|
||||
pov.p.x = pov.p.x - 1
|
||||
CASE "d" 'strafe right
|
||||
pov.p.x = pov.p.x + 1
|
||||
CASE "e" 'jump
|
||||
pov.p.y = pov.p.y + 1
|
||||
CASE "c" 'crouch
|
||||
pov.p.y = pov.p.y - 1
|
||||
CASE "f" 'yaw left
|
||||
pov.r.y = pov.r.y + 1
|
||||
CASE "h" 'yaw right
|
||||
pov.r.y = pov.r.y - 1
|
||||
CASE "e" 'roll left
|
||||
pov.r.z = pov.r.z + 1
|
||||
CASE "t" 'roll right
|
||||
pov.r.z = pov.r.z - 1
|
||||
CASE "r" 'pitch forward
|
||||
pov.r.x = pov.r.x - 1
|
||||
CASE "f" 'pitch backward
|
||||
pov.r.x = pov.r.x + 1
|
||||
END SELECT
|
||||
t! = TIMER: DO: LOOP UNTIL TIMER > t! + .01
|
||||
CLS
|
||||
LOOP
|
||||
|
2
3dobject.bas.d
Normal file
2
3dobject.bas.d
Normal file
@ -0,0 +1,2 @@
|
||||
3D Wireframe Box - ADSWEC Controls; can you figure out the fastest way to cause
|
||||
an interger overflow?
|
BIN
3dobject.exe
Normal file
BIN
3dobject.exe
Normal file
Binary file not shown.
1
3dobject.exe.d
Normal file
1
3dobject.exe.d
Normal file
@ -0,0 +1 @@
|
||||
Compiled.
|
683
asciitur.bas
Normal file
683
asciitur.bas
Normal file
@ -0,0 +1,683 @@
|
||||
DECLARE SUB pause (timeval!)
|
||||
|
||||
'filename: picture4.bas
|
||||
'picture of turtle
|
||||
CLS
|
||||
LOCATE 20, 20
|
||||
COLOR 6
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 21, 15
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 22, 14
|
||||
COLOR 2
|
||||
PRINT "XXXX"
|
||||
LOCATE 23, 10
|
||||
PRINT "XXXXX"
|
||||
LOCATE 22, 20
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 20
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 25
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
COLOR 2
|
||||
LOCATE 22, 30
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 30
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 35
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
LOCATE 22, 37
|
||||
COLOR 2
|
||||
|
||||
LOCATE 22, 37
|
||||
COLOR 2
|
||||
PRINT "XXXXXXXXXXX XXXXX"
|
||||
LOCATE 22, 48
|
||||
COLOR 1
|
||||
PRINT "0"
|
||||
|
||||
pause .1
|
||||
CLS
|
||||
LOCATE 20, 21
|
||||
COLOR 6
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 21, 16
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 22, 15
|
||||
COLOR 2
|
||||
PRINT "XXXX"
|
||||
LOCATE 23, 11
|
||||
PRINT "XXXXX"
|
||||
LOCATE 22, 20
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 20
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 25
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
COLOR 2
|
||||
LOCATE 22, 30
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 30
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 35
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
|
||||
LOCATE 22, 38
|
||||
COLOR 2
|
||||
PRINT "XXXXXXXXXXX XXXXX"
|
||||
LOCATE 22, 49
|
||||
COLOR 1
|
||||
PRINT "0"
|
||||
|
||||
pause .1
|
||||
CLS
|
||||
LOCATE 20, 22
|
||||
COLOR 6
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 21, 17
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 22, 16
|
||||
COLOR 2
|
||||
PRINT "XXXX"
|
||||
LOCATE 23, 12
|
||||
PRINT "XXXXX"
|
||||
LOCATE 22, 20
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 20
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 25
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
COLOR 2
|
||||
LOCATE 22, 30
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 30
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 35
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
|
||||
LOCATE 22, 39
|
||||
COLOR 2
|
||||
PRINT "XXXXXXXXXXX XXXXX"
|
||||
LOCATE 22, 50
|
||||
COLOR 1
|
||||
PRINT "0"
|
||||
|
||||
pause .1
|
||||
CLS
|
||||
LOCATE 20, 23
|
||||
COLOR 6
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 21, 18
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 22, 17
|
||||
COLOR 2
|
||||
PRINT "XXXX"
|
||||
LOCATE 23, 13
|
||||
PRINT "XXXXX"
|
||||
LOCATE 22, 23
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 23
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 28
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
COLOR 2
|
||||
LOCATE 22, 33
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 33
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 38
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
|
||||
LOCATE 22, 40
|
||||
COLOR 2
|
||||
PRINT "XXXXXXXXXXX XXXXX"
|
||||
LOCATE 22, 51
|
||||
COLOR 1
|
||||
PRINT "0"
|
||||
|
||||
pause .1
|
||||
CLS
|
||||
LOCATE 20, 24
|
||||
COLOR 6
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 21, 19
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 22, 18
|
||||
COLOR 2
|
||||
PRINT "XXXX"
|
||||
LOCATE 23, 14
|
||||
PRINT "XXXXX"
|
||||
LOCATE 22, 23
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 23
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 28
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
COLOR 2
|
||||
LOCATE 22, 33
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 33
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 38
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
|
||||
LOCATE 22, 41
|
||||
COLOR 2
|
||||
PRINT "XXXXXXXXXXX XXXXX"
|
||||
LOCATE 22, 52
|
||||
COLOR 1
|
||||
PRINT "0"
|
||||
|
||||
pause .1
|
||||
CLS
|
||||
LOCATE 20, 25
|
||||
COLOR 6
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 21, 20
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 22, 19
|
||||
COLOR 2
|
||||
PRINT "XXXX"
|
||||
LOCATE 23, 15
|
||||
PRINT "XXXXX"
|
||||
LOCATE 22, 23
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 23
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 28
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
COLOR 2
|
||||
LOCATE 22, 33
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 33
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 38
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
|
||||
LOCATE 22, 42
|
||||
COLOR 2
|
||||
PRINT "XXXXXXXXXXX XXXXX"
|
||||
LOCATE 22, 53
|
||||
COLOR 1
|
||||
PRINT "0"
|
||||
|
||||
pause .1
|
||||
CLS
|
||||
LOCATE 20, 26
|
||||
COLOR 6
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 21, 21
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 22, 20
|
||||
COLOR 2
|
||||
PRINT "XXXX"
|
||||
LOCATE 23, 16
|
||||
PRINT "XXXXX"
|
||||
LOCATE 22, 26
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 26
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 31
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
COLOR 2
|
||||
LOCATE 22, 36
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 36
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 41
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
|
||||
LOCATE 22, 43
|
||||
COLOR 2
|
||||
PRINT "XXXXXXXXXXX XXXXX"
|
||||
LOCATE 22, 54
|
||||
COLOR 1
|
||||
PRINT "0"
|
||||
|
||||
pause .1
|
||||
CLS
|
||||
LOCATE 20, 27
|
||||
COLOR 6
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 21, 22
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 22, 21
|
||||
COLOR 2
|
||||
PRINT "XXXX"
|
||||
LOCATE 23, 17
|
||||
PRINT "XXXXX"
|
||||
LOCATE 22, 26
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 26
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 31
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
COLOR 2
|
||||
LOCATE 22, 36
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 36
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 41
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
|
||||
LOCATE 22, 44
|
||||
COLOR 2
|
||||
PRINT "XXXXXXXXXXX XXXXX"
|
||||
LOCATE 22, 55
|
||||
COLOR 1
|
||||
PRINT "0"
|
||||
|
||||
pause .1
|
||||
CLS
|
||||
LOCATE 20, 28
|
||||
COLOR 6
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 21, 23
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 22, 22
|
||||
COLOR 2
|
||||
PRINT "XXXX"
|
||||
LOCATE 23, 18
|
||||
PRINT "XXXXX"
|
||||
LOCATE 22, 26
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 26
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 31
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
COLOR 2
|
||||
LOCATE 22, 36
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 36
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 41
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
|
||||
LOCATE 22, 45
|
||||
COLOR 2
|
||||
PRINT "XXXXXXXXXXX XXXXX"
|
||||
LOCATE 22, 56
|
||||
COLOR 1
|
||||
PRINT "0"
|
||||
|
||||
pause .1
|
||||
CLS
|
||||
LOCATE 20, 29
|
||||
COLOR 6
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 21, 24
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 22, 23
|
||||
COLOR 2
|
||||
PRINT "XXXX"
|
||||
LOCATE 23, 19
|
||||
PRINT "XXXXX"
|
||||
LOCATE 22, 29
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 29
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 34
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
COLOR 2
|
||||
LOCATE 22, 39
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 39
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 44
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
|
||||
LOCATE 22, 46
|
||||
COLOR 2
|
||||
PRINT "XXXXXXXXXXX XXXXX"
|
||||
LOCATE 22, 57
|
||||
COLOR 1
|
||||
PRINT "0"
|
||||
|
||||
pause .1
|
||||
CLS
|
||||
LOCATE 20, 30
|
||||
COLOR 6
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 21, 25
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 22, 24
|
||||
COLOR 2
|
||||
PRINT "XXXX"
|
||||
LOCATE 23, 20
|
||||
PRINT "XXXXX"
|
||||
LOCATE 22, 29
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 29
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 34
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
COLOR 2
|
||||
LOCATE 22, 39
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 39
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 44
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
|
||||
LOCATE 22, 47
|
||||
COLOR 2
|
||||
PRINT "XXXXXXXXXXX XXXXX"
|
||||
LOCATE 22, 58
|
||||
COLOR 1
|
||||
PRINT "0"
|
||||
|
||||
pause .1
|
||||
CLS
|
||||
LOCATE 20, 31
|
||||
COLOR 6
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 21, 26
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 22, 25
|
||||
COLOR 2
|
||||
PRINT "XXXX"
|
||||
LOCATE 23, 21
|
||||
PRINT "XXXXX"
|
||||
LOCATE 22, 29
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 29
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 34
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
COLOR 2
|
||||
LOCATE 22, 39
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 39
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 44
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
|
||||
LOCATE 22, 48
|
||||
COLOR 2
|
||||
PRINT "XXXXXXXXXXX XXXXX"
|
||||
LOCATE 22, 59
|
||||
COLOR 1
|
||||
PRINT "0"
|
||||
|
||||
pause .1
|
||||
CLS
|
||||
LOCATE 20, 32
|
||||
COLOR 6
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 21, 27
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 22, 26
|
||||
COLOR 2
|
||||
PRINT "XXXX"
|
||||
LOCATE 23, 22
|
||||
PRINT "XXXXX"
|
||||
LOCATE 22, 32
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 32
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 37
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
COLOR 2
|
||||
LOCATE 22, 42
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 42
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 47
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
|
||||
|
||||
LOCATE 22, 49
|
||||
COLOR 2
|
||||
PRINT "XXXXXXXXXXX XXXXX"
|
||||
LOCATE 22, 60
|
||||
COLOR 1
|
||||
PRINT "0"
|
||||
pause .1
|
||||
CLS
|
||||
LOCATE 20, 33
|
||||
COLOR 6
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 21, 28
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 22, 27
|
||||
COLOR 2
|
||||
PRINT "XXXX"
|
||||
LOCATE 23, 23
|
||||
PRINT "XXXXX"
|
||||
LOCATE 22, 32
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 32
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 37
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
COLOR 2
|
||||
LOCATE 22, 42
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 42
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 47
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
|
||||
LOCATE 22, 50
|
||||
COLOR 2
|
||||
PRINT "XXXXXXXXXXX XXXXX"
|
||||
LOCATE 22, 61
|
||||
COLOR 1
|
||||
PRINT "0"
|
||||
pause .1
|
||||
CLS
|
||||
LOCATE 20, 34
|
||||
COLOR 6
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 21, 29
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 22, 28
|
||||
COLOR 2
|
||||
PRINT "XXXX"
|
||||
LOCATE 23, 24
|
||||
PRINT "XXXXX"
|
||||
LOCATE 22, 32
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 32
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 37
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
COLOR 2
|
||||
LOCATE 22, 42
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 42
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 47
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
|
||||
LOCATE 22, 51
|
||||
COLOR 2
|
||||
PRINT "XXXXXXXXXXX XXXXX"
|
||||
LOCATE 22, 62
|
||||
COLOR 1
|
||||
PRINT "0"
|
||||
pause .1
|
||||
CLS
|
||||
LOCATE 20, 35
|
||||
COLOR 6
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 21, 30
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 22, 29
|
||||
COLOR 2
|
||||
PRINT "XXXX"
|
||||
LOCATE 23, 25
|
||||
PRINT "XXXXX"
|
||||
LOCATE 22, 35
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 35
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 40
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
COLOR 2
|
||||
LOCATE 22, 45
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 45
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 50
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
|
||||
LOCATE 22, 52
|
||||
COLOR 2
|
||||
PRINT "XXXXXXXXXXX XXXXX"
|
||||
LOCATE 22, 63
|
||||
COLOR 1
|
||||
PRINT "0"
|
||||
pause .1
|
||||
CLS
|
||||
LOCATE 20, 36
|
||||
COLOR 6
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 21, 31
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 22, 30
|
||||
COLOR 2
|
||||
PRINT "XXXX"
|
||||
LOCATE 23, 26
|
||||
PRINT "XXXXX"
|
||||
LOCATE 22, 35
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 35
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 40
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
COLOR 2
|
||||
LOCATE 22, 45
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 45
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 50
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
|
||||
LOCATE 22, 53
|
||||
COLOR 2
|
||||
PRINT "XXXXXXXXX"
|
||||
LOCATE 23, 56
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 57
|
||||
COLOR 1
|
||||
PRINT "0"
|
||||
LOCATE 23, 59
|
||||
PRINT "0"
|
||||
pause .1
|
||||
CLS
|
||||
LOCATE 20, 36
|
||||
COLOR 6
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 21, 31
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 22, 30
|
||||
COLOR 2
|
||||
PRINT "XXXX"
|
||||
LOCATE 23, 26
|
||||
PRINT "XXXXX"
|
||||
LOCATE 22, 35
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 35
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 40
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
COLOR 2
|
||||
LOCATE 22, 45
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 45
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 50
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
|
||||
LOCATE 22, 53
|
||||
COLOR 2
|
||||
PRINT "XXXXXXXXX"
|
||||
LOCATE 23, 56
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 57
|
||||
COLOR 1
|
||||
PRINT "0"
|
||||
PLAY "D"
|
||||
pause .1
|
||||
CLS
|
||||
LOCATE 20, 36
|
||||
COLOR 6
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 21, 31
|
||||
PRINT "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
||||
LOCATE 22, 30
|
||||
COLOR 2
|
||||
PRINT "XXXX"
|
||||
LOCATE 23, 26
|
||||
PRINT "XXXXX"
|
||||
LOCATE 22, 35
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 35
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 40
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
COLOR 2
|
||||
LOCATE 22, 45
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 45
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 50
|
||||
COLOR 7
|
||||
PRINT "\"
|
||||
|
||||
LOCATE 22, 53
|
||||
COLOR 2
|
||||
PRINT "XXXXXXXXX"
|
||||
LOCATE 23, 56
|
||||
PRINT "XXXXX"
|
||||
LOCATE 23, 57
|
||||
COLOR 1
|
||||
PRINT "0"
|
||||
LOCATE 23, 59
|
||||
PRINT "0"
|
||||
|
||||
SYSTEM
|
||||
|
||||
SUB pause (timeval)
|
||||
w = TIMER + timeval
|
||||
DO
|
||||
LOOP UNTIL TIMER > w
|
||||
END SUB
|
1
asciitur.bas.d
Normal file
1
asciitur.bas.d
Normal file
@ -0,0 +1 @@
|
||||
ASCII Turtle - awful ASCII art.
|
BIN
asciitur.exe
Normal file
BIN
asciitur.exe
Normal file
Binary file not shown.
1
asciitur.exe.d
Normal file
1
asciitur.exe.d
Normal file
@ -0,0 +1 @@
|
||||
Compiled.
|
1
feuru.bas.d
Normal file
1
feuru.bas.d
Normal file
@ -0,0 +1 @@
|
||||
Annoying Adventure Game - set on the tropical island of Feuru.
|
3
index.d
Normal file
3
index.d
Normal file
@ -0,0 +1,3 @@
|
||||
This dusty diskette from ages past comes up and I go to the library and
|
||||
read it; it's my old QBasic programmes. Remember when muti-player meant
|
||||
you sit around the same computer and use different controls?
|
149
index.html
Normal file
149
index.html
Normal file
@ -0,0 +1,149 @@
|
||||
<!doctype html public "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>http://neil.chaosnet.org/code/qbasic/</title>
|
||||
<meta name = "Content-type" http-equiv = "Content-Type" content = "text/html; charset=us-ascii">
|
||||
<meta name = "Keywords" content = "code, qbasic, neil">
|
||||
<meta name = "Description" content = "Do'n't go here. Ultra-secret archive."> <!-- bad form, print index.d -->
|
||||
<meta name = "Author" content = "Neil">
|
||||
<meta name = "Generator" content = "This pristine code lies unmarred by infantile editors!">
|
||||
<link rel = "top" href = "http://neil.chaosnet.org/">
|
||||
<link rel = "icon" href = "/favicon.ico" type = "image/x-icon">
|
||||
<link rel = "shortcut icon" href = "/favicon.ico" type = "image/x-icon">
|
||||
<link rel = "stylesheet" type = "text/css" href = "/neil.css">
|
||||
<link rel = "alternate" type = "application/rss+xml" title = "News from Afar" href = "/newsfeed.rss">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p class = "noprint"><img src = "/neil.jpeg" width = 528 height = 56 alt = "[ Mælström ]"></p>
|
||||
<p>
|
||||
This dusty diskette from ages past comes up and I go to the library and
|
||||
read it; it's my old QBasic programmes. Remember when muti-player meant
|
||||
you sit around the same computer and use different controls?
|
||||
</p>
|
||||
|
||||
<div class = "clear"></div>
|
||||
|
||||
<div class = "file"><div class = "file-leftfixed">
|
||||
<a href = ".."><img src = "../../dir.jpeg" alt = "[ Dir ]"></a>
|
||||
<div class = "icontext"><div><a href = "..">..</a></div></div>
|
||||
</div><div class = "file-rightfixed">
|
||||
Programming.
|
||||
</div></div>
|
||||
|
||||
<div class = "file"><div class = "file-leftfixed">
|
||||
<a href = "3dland.bas"><img src = "../../file.jpeg" alt = "[ File ]"></a>
|
||||
<div class = "icontext"><div><a href = "3dland.bas">3dland.bas</a> (15 KB)</div></div>
|
||||
</div><div class = "file-rightfixed">
|
||||
3D Landscape - ADSWEC Controls; a good example of what a 3D engine looks like
|
||||
without important stuff like clipping and rotation.
|
||||
</div></div>
|
||||
|
||||
<div class = "file"><div class = "file-leftfixed">
|
||||
<a href = "3dland.exe"><img src = "../../file.jpeg" alt = "[ File ]"></a>
|
||||
<div class = "icontext"><div><a href = "3dland.exe">3dland.exe</a> (41 KB)</div></div>
|
||||
</div><div class = "file-rightfixed">
|
||||
Compiled.
|
||||
</div></div>
|
||||
|
||||
<div class = "file"><div class = "file-leftfixed">
|
||||
<a href = "3dobject.bas"><img src = "../../file.jpeg" alt = "[ File ]"></a>
|
||||
<div class = "icontext"><div><a href = "3dobject.bas">3dobject.bas</a> (9 KB)</div></div>
|
||||
</div><div class = "file-rightfixed">
|
||||
3D Wireframe Box - ADSWEC Controls; can you figure out the fastest way to cause
|
||||
an interger overflow?
|
||||
</div></div>
|
||||
|
||||
<div class = "file"><div class = "file-leftfixed">
|
||||
<a href = "3dobject.exe"><img src = "../../file.jpeg" alt = "[ File ]"></a>
|
||||
<div class = "icontext"><div><a href = "3dobject.exe">3dobject.exe</a> (41 KB)</div></div>
|
||||
</div><div class = "file-rightfixed">
|
||||
Compiled.
|
||||
</div></div>
|
||||
|
||||
<div class = "file"><div class = "file-leftfixed">
|
||||
<a href = "asciitur.bas"><img src = "../../file.jpeg" alt = "[ File ]"></a>
|
||||
<div class = "icontext"><div><a href = "asciitur.bas">asciitur.bas</a> (9 KB)</div></div>
|
||||
</div><div class = "file-rightfixed">
|
||||
ASCII Turtle - awful ASCII art.
|
||||
</div></div>
|
||||
|
||||
<div class = "file"><div class = "file-leftfixed">
|
||||
<a href = "asciitur.exe"><img src = "../../file.jpeg" alt = "[ File ]"></a>
|
||||
<div class = "icontext"><div><a href = "asciitur.exe">asciitur.exe</a> (40 KB)</div></div>
|
||||
</div><div class = "file-rightfixed">
|
||||
Compiled.
|
||||
</div></div>
|
||||
|
||||
<div class = "file"><div class = "file-leftfixed">
|
||||
<a href = "feuru.bas"><img src = "../../file.jpeg" alt = "[ File ]"></a>
|
||||
<div class = "icontext"><div><a href = "feuru.bas">feuru.bas</a> (20 KB)</div></div>
|
||||
</div><div class = "file-rightfixed">
|
||||
Annoying Adventure Game - set on the tropical island of Feuru.
|
||||
</div></div>
|
||||
|
||||
<div class = "file"><div class = "file-leftfixed">
|
||||
<a href = "noschool.bas"><img src = "../../file.jpeg" alt = "[ File ]"></a>
|
||||
<div class = "icontext"><div><a href = "noschool.bas">noschool.bas</a> (10 KB)</div></div>
|
||||
</div><div class = "file-rightfixed">
|
||||
Battleship-Style UFO Game - dish out some DFA.
|
||||
</div></div>
|
||||
|
||||
<div class = "file"><div class = "file-leftfixed">
|
||||
<a href = "noschool.exe"><img src = "../../file.jpeg" alt = "[ File ]"></a>
|
||||
<div class = "icontext"><div><a href = "noschool.exe">noschool.exe</a> (62 KB)</div></div>
|
||||
</div><div class = "file-rightfixed">
|
||||
Compiled.
|
||||
</div></div>
|
||||
|
||||
<div class = "file"><div class = "file-leftfixed">
|
||||
<a href = "pop.bas"><img src = "../../file.jpeg" alt = "[ File ]"></a>
|
||||
<div class = "icontext"><div><a href = "pop.bas">pop.bas</a> (2 KB)</div></div>
|
||||
</div><div class = "file-rightfixed">
|
||||
Balloon Animation - why laser pointers and land mines should be banned from
|
||||
public parks.
|
||||
</div></div>
|
||||
|
||||
<div class = "file"><div class = "file-leftfixed">
|
||||
<a href = "pop.exe"><img src = "../../file.jpeg" alt = "[ File ]"></a>
|
||||
<div class = "icontext"><div><a href = "pop.exe">pop.exe</a> (41 KB)</div></div>
|
||||
</div><div class = "file-rightfixed">
|
||||
Compiled.
|
||||
</div></div>
|
||||
|
||||
<div class = "file"><div class = "file-leftfixed">
|
||||
<a href = "scrworms.bas"><img src = "../../file.jpeg" alt = "[ File ]"></a>
|
||||
<div class = "icontext"><div><a href = "scrworms.bas">scrworms.bas</a> (1 KB)</div></div>
|
||||
</div><div class = "file-rightfixed">
|
||||
Wormish Animation - a screen-saver wanna-be.
|
||||
</div></div>
|
||||
|
||||
<div class = "file"><div class = "file-leftfixed">
|
||||
<a href = "scrworms.exe"><img src = "../../file.jpeg" alt = "[ File ]"></a>
|
||||
<div class = "icontext"><div><a href = "scrworms.exe">scrworms.exe</a> (36 KB)</div></div>
|
||||
</div><div class = "file-rightfixed">
|
||||
Compiled.
|
||||
</div></div>
|
||||
|
||||
<div class = "file"><div class = "file-leftfixed">
|
||||
<a href = "ufovisit.bas"><img src = "../../file.jpeg" alt = "[ File ]"></a>
|
||||
<div class = "icontext"><div><a href = "ufovisit.bas">ufovisit.bas</a> (6 KB)</div></div>
|
||||
</div><div class = "file-rightfixed">
|
||||
UFO Attack - senseless, wanton animated destruction.
|
||||
</div></div>
|
||||
|
||||
<div class = "file"><div class = "file-leftfixed">
|
||||
<a href = "ufovisit.exe"><img src = "../../file.jpeg" alt = "[ File ]"></a>
|
||||
<div class = "icontext"><div><a href = "ufovisit.exe">ufovisit.exe</a> (44 KB)</div></div>
|
||||
</div><div class = "file-rightfixed">
|
||||
Compiled.
|
||||
</div></div>
|
||||
|
||||
<div><img src = "/hline.gif" width = 528 height = 2 alt = "--">
|
||||
<img src = "/pi.gif" width = 16 height = 16 alt = "π" class = "right"></div>
|
||||
<p class = "noscreen">From <a href = "http://neil.chaosnet.org/code/qbasic/">http://neil.chaosnet.org/code/qbasic/</a>.</p>
|
||||
</body>
|
||||
|
||||
</html>
|
481
noschool.bas
Normal file
481
noschool.bas
Normal file
@ -0,0 +1,481 @@
|
||||
DEFINT A-Z
|
||||
DECLARE SUB pause (timeval!)
|
||||
DECLARE SUB win ()
|
||||
DECLARE SUB die ()
|
||||
DECLARE SUB f1 ()
|
||||
DECLARE SUB f3 ()
|
||||
DECLARE SUB main ()
|
||||
DECLARE SUB chrage (z)
|
||||
DECLARE SUB intro ()
|
||||
DECLARE SUB framework ()
|
||||
DECLARE SUB shot ()
|
||||
DECLARE SUB palett ()
|
||||
DECLARE SUB e1 ()
|
||||
DECLARE SUB e2 ()
|
||||
DECLARE SUB e3 ()
|
||||
DECLARE SUB e4 ()
|
||||
DECLARE SUB SCHOOL ()
|
||||
DATA 196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,180
|
||||
DATA 000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179
|
||||
DATA 196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,180
|
||||
DATA 000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179
|
||||
DATA 196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,180
|
||||
DATA 000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179
|
||||
DATA 196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,180
|
||||
DATA 000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179
|
||||
DATA 196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,180
|
||||
DATA 000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179
|
||||
DATA 196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,180
|
||||
DATA 000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179
|
||||
DATA 196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,180
|
||||
DATA 000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179
|
||||
DATA 196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,180
|
||||
DATA 000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179
|
||||
DATA 196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,180
|
||||
DATA 000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179
|
||||
DATA 196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,197,196,180
|
||||
DATA 000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179,000,179
|
||||
|
||||
'inputs
|
||||
|
||||
DIM SHARED crt(1 TO 20, 1 TO 22) AS INTEGER
|
||||
|
||||
CLS
|
||||
SCREEN 13
|
||||
intro
|
||||
main
|
||||
|
||||
SUB chrage (z)
|
||||
CLS
|
||||
SCREEN 12
|
||||
WIDTH 80, 60
|
||||
IF z = 1 THEN
|
||||
LOCATE 1, 1
|
||||
word$ = "ANALIZING SURFACE . . ."
|
||||
FOR p = 1 TO LEN(word$)
|
||||
LOCATE 1, p
|
||||
PRINT MID$(word$, p, 1)
|
||||
PLAY "o1t255l20b"
|
||||
pause .01
|
||||
IF INKEY$ <> "" THEN GOTO 9
|
||||
NEXT p
|
||||
LOCATE 3, 1
|
||||
word$ = "Welcome to Earth."
|
||||
FOR p = 1 TO LEN(word$)
|
||||
PRINT MID$(word$, p, 1);
|
||||
PLAY "o1t255l20b"
|
||||
pause .01
|
||||
IF INKEY$ <> "" THEN GOTO 9
|
||||
NEXT p
|
||||
LOCATE 5, 1
|
||||
word$ = "You are controlling the UFO. Target the school's grid coordinates before nuclear counterstrikes target you! Arbitrary proximity sensors will tell you how close each shot is. Good luck . . . "
|
||||
FOR p = 1 TO LEN(word$)
|
||||
PRINT MID$(word$, p, 1);
|
||||
PLAY "o1t255l20b"
|
||||
pause .01
|
||||
IF INKEY$ <> "" THEN GOTO 9
|
||||
NEXT p
|
||||
|
||||
9
|
||||
'IF z = 1 THEN
|
||||
FOR h = 1 TO 20
|
||||
FOR i = 1 TO 22
|
||||
READ crt(h, i)
|
||||
NEXT i
|
||||
NEXT h
|
||||
END IF
|
||||
|
||||
'output
|
||||
|
||||
FOR n = 1 TO 20
|
||||
FOR o = 1 TO 22
|
||||
LOCATE 10 + n, 1 + o
|
||||
PRINT CHR$(crt(n, o))
|
||||
'IF z = 1 THEN pause .00005
|
||||
NEXT o
|
||||
NEXT n
|
||||
|
||||
FOR l = 1 TO 10
|
||||
LOCATE 9, l * 2 + 2
|
||||
PRINT CHR$(64 + l)
|
||||
NEXT l
|
||||
|
||||
FOR n = 1 TO 10
|
||||
LOCATE 10 + n * 2, 1
|
||||
PRINT n - 1
|
||||
NEXT n
|
||||
|
||||
END SUB
|
||||
|
||||
SUB die
|
||||
SCREEN 13
|
||||
CIRCLE (200, 100), 50, 4, , , .5
|
||||
PAINT (200, 100), 4, 4
|
||||
CIRCLE (200, 100), 25, 5, , , .7
|
||||
PAINT (200, 100), 5, 5
|
||||
rocket$ = "c4u1l1d4r4u4l4r4c7r10f2g2l10"
|
||||
FOR i = 1 TO 200
|
||||
PSET (i, 100), 4
|
||||
DRAW "X" + VARPTR$(rocket$)
|
||||
PAINT (i, 100), 4, 4
|
||||
pause .01
|
||||
NEXT i
|
||||
FOR t = 1 TO 120
|
||||
CIRCLE (200 + t, 100), t / 3 + 50, 4
|
||||
NEXT t
|
||||
FOR i = 1 TO 63
|
||||
c = 64 - i
|
||||
PALETTE 4, c
|
||||
NEXT i
|
||||
CLS
|
||||
SCREEN 12
|
||||
COLOR 15
|
||||
LOCATE 1, 1
|
||||
PRINT "YOU HAVE BEEN HIT!!!"
|
||||
SLEEP
|
||||
SYSTEM
|
||||
END SUB
|
||||
|
||||
SUB e1
|
||||
'184,-3,-4,-5,64
|
||||
|
||||
FOR i = 1 TO 400
|
||||
x = INT(RND * 60) + 131
|
||||
y = INT(RND * 25) + 176
|
||||
PSET (x, y), 65
|
||||
NEXT i
|
||||
|
||||
FOR i = 1 TO 20
|
||||
a = INT(RND * 220) + 51
|
||||
b = INT(RND * 30) + 171
|
||||
debris$ = "c184r3d3l2c183d2r1l1u4"
|
||||
PSET (a, b), 185: DRAW "X" + VARPTR$(debris$)
|
||||
NEXT i
|
||||
|
||||
FOR i = 1 TO 100
|
||||
c = INT(RND * 220) + 51
|
||||
d = INT(RND * 30) + 171
|
||||
debris$ = "c183r1d1l2c184d1r3"
|
||||
PSET (c, d), 185: DRAW "X" + VARPTR$(debris$)
|
||||
NEXT i
|
||||
|
||||
FOR i = 1 TO 500
|
||||
e = INT(RND * 220) + 51
|
||||
f = INT(RND * 30) + 171
|
||||
PSET (e, f), 64
|
||||
NEXT i
|
||||
|
||||
END SUB
|
||||
|
||||
SUB e2
|
||||
|
||||
LINE (57, 2)-(57, 13), 49
|
||||
LINE (63, 2)-(63, 13), 49
|
||||
LINE (56, 3)-(56, 10), 50
|
||||
LINE (64, 3)-(64, 10), 50
|
||||
LINE (55, 6)-(55, 7), 51
|
||||
LINE (65, 6)-(65, 7), 51
|
||||
|
||||
DIM pic(55 TO 65, 2 TO 13) AS INTEGER
|
||||
GET (55, 2)-(65, 13), pic
|
||||
|
||||
LINE (57, 2)-(57, 13), 0
|
||||
LINE (63, 2)-(63, 13), 0
|
||||
LINE (56, 3)-(56, 10), 0
|
||||
LINE (64, 3)-(64, 10), 0
|
||||
LINE (55, 6)-(55, 7), 0
|
||||
LINE (65, 6)-(65, 7), 0
|
||||
|
||||
FOR p = 0 TO 170
|
||||
PUT (155, p), pic, XOR
|
||||
PUT (155, p), pic, XOR
|
||||
NEXT p
|
||||
|
||||
END SUB
|
||||
|
||||
SUB e3
|
||||
'185,184,183,182
|
||||
FOR r = 0 TO 30
|
||||
CIRCLE (250, 200), r + 20, 185 - r / 10, 0, 2
|
||||
CIRCLE (220, 200), r + 15, 185 - r / 10, 1, 2
|
||||
CIRCLE (170, 190), r + 15, 185 - r / 10, 0, 3
|
||||
CIRCLE (140, 185), r + 5, 185 - r / 10, 1, 3
|
||||
CIRCLE (100, 185), r + 20, 185 - r / 10, .5, 3
|
||||
CIRCLE (60, 200), r + 5, 184 - r / 10, .5, 4
|
||||
NEXT r
|
||||
e1
|
||||
END SUB
|
||||
|
||||
SUB e4
|
||||
|
||||
LINE (150, 0)-(170, 155), 0, BF
|
||||
'49,50,51,46,45,44
|
||||
|
||||
'15,64,183,184,185
|
||||
|
||||
FOR i = 1 TO 63 STEP 10
|
||||
a = 64 - i
|
||||
PALETTE 15, a
|
||||
PALETTE 64, a
|
||||
PALETTE 65, a
|
||||
PALETTE 181, a
|
||||
PALETTE 182, a
|
||||
PALETTE 183, a
|
||||
PALETTE 184, a
|
||||
PALETTE 185, a
|
||||
PALETTE 45, a
|
||||
PALETTE 46, a
|
||||
pause .005
|
||||
NEXT i
|
||||
PALETTE 15, 0
|
||||
PALETTE 64, 0
|
||||
PALETTE 65, 0
|
||||
PALETTE 181, 0
|
||||
PALETTE 182, 0
|
||||
PALETTE 183, 0
|
||||
PALETTE 184, 0
|
||||
PALETTE 185, 0
|
||||
PALETTE 45, 0
|
||||
PALETTE 46, 0
|
||||
|
||||
END SUB
|
||||
|
||||
SUB f1
|
||||
FOR i = 1 TO 50
|
||||
x = INT(RND * 60) + 131
|
||||
y = INT(RND * 25) + 176
|
||||
PSET (x, y), 65
|
||||
NEXT i
|
||||
|
||||
FOR i = 1 TO 50
|
||||
e = INT(RND * 80) + 111
|
||||
f = INT(RND * 10) + 171
|
||||
PSET (e, f), 64
|
||||
NEXT i
|
||||
|
||||
END SUB
|
||||
|
||||
SUB f3
|
||||
FOR r = 0 TO 100
|
||||
CIRCLE (200, 200), r / 3, 185 - r / 34, 0, 2
|
||||
CIRCLE (140, 200), r / 3, 185 - r / 34, 1, 3
|
||||
CIRCLE (170, 200), r / 3, 185 - r / 34, 0, 3
|
||||
NEXT r
|
||||
|
||||
END SUB
|
||||
|
||||
SUB framework
|
||||
LINE (60, 175)-(260, 200), 0, BF
|
||||
LINE (160 - 100, 200)-(160 - 20, 180), 184, BF
|
||||
LINE (160 - 20, 200)-(160 + 20, 175), 183, BF
|
||||
LINE (160 + 20, 200)-(160 + 100, 180), 184, BF
|
||||
|
||||
FOR i = 1 TO 20 STEP 9
|
||||
FOR o = 1 TO 75 STEP 7
|
||||
LINE (60 + o, 180 + i)-(65 + o, 185 + i), 65, BF
|
||||
NEXT o
|
||||
NEXT i
|
||||
|
||||
FOR i = 1 TO 20 STEP 9
|
||||
FOR o = 1 TO 75 STEP 7
|
||||
LINE (255 - o, 180 + i)-(260 - o, 185 + i), 65, BF
|
||||
NEXT o
|
||||
NEXT i
|
||||
|
||||
END SUB
|
||||
|
||||
SUB intro
|
||||
CIRCLE (100, 100), 30, 2
|
||||
PAINT (100, 100), 1, 2
|
||||
|
||||
FOR i = 1 TO 80
|
||||
CIRCLE (200 - i, 200 - i), 10 - i / 10, 4, , , .5
|
||||
PAINT (200 - i, 200 - i), 4, 4
|
||||
|
||||
CIRCLE (200 - i, 200 - i), 5 - i / 20, 5, , , .5
|
||||
PAINT (200 - i, 200 - i), 5, 5
|
||||
|
||||
pause .001
|
||||
|
||||
CIRCLE (200 - i, 200 - i), 10 - i / 10, 0, , , .5
|
||||
|
||||
IF INKEY$ <> "" THEN GOTO 8
|
||||
NEXT i
|
||||
|
||||
8
|
||||
CLS
|
||||
END SUB
|
||||
|
||||
SUB main
|
||||
z = 1
|
||||
chrage (z)
|
||||
z = 0
|
||||
chrage (z)
|
||||
|
||||
RANDOMIZE TIMER
|
||||
|
||||
acr = INT(RND * 10)
|
||||
across$ = CHR$(acr + 97)
|
||||
down = INT(RND * 10)
|
||||
|
||||
acr = INT(RND * 10)
|
||||
yacross$ = CHR$(acr + 97)
|
||||
ydown = INT(RND * 10)
|
||||
|
||||
DO
|
||||
LOCATE 5, 5
|
||||
PRINT "Enter Letter"
|
||||
DO
|
||||
l$ = INKEY$
|
||||
IF LEN(l$) <> 1 THEN l$ = " "
|
||||
IF l$ = CHR$(27) OR l$ = CHR$(13) OR l$ = "q" THEN SYSTEM
|
||||
l$ = LCASE$(l$)
|
||||
LOOP UNTIL ASC(l$) >= 97 AND ASC(l$) <= 106
|
||||
LOCATE 7, 5
|
||||
PRINT "Enter Number"
|
||||
DO
|
||||
n$ = INKEY$
|
||||
IF LEN(n$) <> 1 THEN n$ = " "
|
||||
IF n$ = CHR$(27) OR n$ = CHR$(13) OR n$ = "q" THEN SYSTEM
|
||||
LOOP UNTIL ASC(n$) >= 48 AND ASC(n$) <= 57
|
||||
|
||||
dist = INT(SQR(ABS(ASC(l$) - ASC(across$)) ^ 2 + ABS(VAL(n$) - down) ^ 2)) + 48
|
||||
IF dist >= 58 THEN dist = 45
|
||||
crt((VAL(n$) + 1) * 2, 2 * (ASC(l$) - 96) + 1) = dist
|
||||
|
||||
IF l$ = across$ AND VAL(n$) = down THEN SCREEN 13: SCHOOL: SLEEP 1: shot: framework: e1: e2: e3: e4: win: SYSTEM ELSE SCREEN 13: SLEEP 1: shot: f1: e2: f3: e4: SCREEN 12: chrage (z)
|
||||
|
||||
'LOCATE 1, 1: PRINT across$: PRINT down
|
||||
|
||||
LOCATE 45, 5
|
||||
COLOR 12
|
||||
PRINT "Automatic anti-UFO weapons systems are now firing at you! Please wait."
|
||||
pause .5
|
||||
LOCATE 45, 5
|
||||
PRINT " "
|
||||
pause .1
|
||||
LOCATE 45, 5
|
||||
COLOR 12
|
||||
PRINT "Automatic anti-UFO weapons systems are now firing at you! Please wait."
|
||||
pause .5
|
||||
LOCATE 45, 5
|
||||
PRINT " "
|
||||
|
||||
k = INT(RND * 10): l$ = CHR$(k + 97)
|
||||
n = INT(RND * 10)
|
||||
IF l$ = yacross$ AND n = ydown THEN die
|
||||
|
||||
k = INT(RND * 10): l$ = CHR$(k + 97)
|
||||
n = INT(RND * 10)
|
||||
IF l$ = yacross$ AND n = ydown THEN die
|
||||
|
||||
k = INT(RND * 10): l$ = CHR$(k + 97)
|
||||
n = INT(RND * 10)
|
||||
IF l$ = yacross$ AND n = ydown THEN die
|
||||
|
||||
k = INT(RND * 10): l$ = CHR$(k + 97)
|
||||
n = INT(RND * 10)
|
||||
IF l$ = yacross$ AND n = ydown THEN die
|
||||
|
||||
LOOP
|
||||
END SUB
|
||||
|
||||
DEFSNG A-Z
|
||||
SUB pause (timeval)
|
||||
w = TIMER + timeval
|
||||
DO
|
||||
LOOP UNTIL TIMER > w
|
||||
END SUB
|
||||
|
||||
DEFINT A-Z
|
||||
SUB SCHOOL
|
||||
LINE (160 - 100, 200)-(160 - 20, 180), 184, BF
|
||||
LINE (160 - 20, 200)-(160 + 20, 175), 183, BF
|
||||
LINE (160 + 20, 200)-(160 + 100, 180), 184, BF
|
||||
|
||||
FOR i = 1 TO 20 STEP 9
|
||||
FOR o = 1 TO 75 STEP 7
|
||||
LINE (60 + o, 180 + i)-(65 + o, 185 + i), 0, BF
|
||||
NEXT o
|
||||
NEXT i
|
||||
|
||||
FOR i = 1 TO 20 STEP 9
|
||||
FOR o = 1 TO 75 STEP 7
|
||||
LINE (255 - o, 180 + i)-(260 - o, 185 + i), 0, BF
|
||||
NEXT o
|
||||
NEXT i
|
||||
|
||||
PSET (151, 177), 15
|
||||
PSET (152, 176), 15
|
||||
PSET (152, 178), 15
|
||||
PSET (151, 179), 15
|
||||
|
||||
PSET (155, 177), 15
|
||||
PSET (154, 178), 15
|
||||
PSET (155, 179), 15
|
||||
|
||||
PSET (157, 176), 15
|
||||
PSET (157, 177), 15
|
||||
PSET (157, 178), 15
|
||||
PSET (157, 179), 15
|
||||
|
||||
PSET (158, 178), 15
|
||||
PSET (159, 178), 15
|
||||
PSET (159, 179), 15
|
||||
|
||||
PSET (161, 177), 15
|
||||
PSET (161, 178), 15
|
||||
PSET (161, 179), 15
|
||||
PSET (163, 177), 15
|
||||
PSET (163, 178), 15
|
||||
PSET (163, 179), 15
|
||||
PSET (162, 177), 15
|
||||
PSET (162, 179), 15
|
||||
|
||||
PSET (165, 177), 15
|
||||
PSET (165, 178), 15
|
||||
PSET (165, 179), 15
|
||||
PSET (167, 177), 15
|
||||
PSET (167, 178), 15
|
||||
PSET (167, 179), 15
|
||||
PSET (166, 177), 15
|
||||
PSET (166, 179), 15
|
||||
|
||||
PSET (169, 176), 15
|
||||
PSET (169, 177), 15
|
||||
PSET (169, 178), 15
|
||||
PSET (169, 178), 15
|
||||
PSET (169, 179), 15
|
||||
|
||||
COLOR 7
|
||||
man$ = "e3f3h3u3r2l4r2e2h2g2f2"
|
||||
PSET (300, 200)
|
||||
DRAW "X" + VARPTR$(man$)
|
||||
PSET (310, 200)
|
||||
DRAW "x" + VARPTR$(man$)
|
||||
END SUB
|
||||
|
||||
SUB shot
|
||||
'40-43
|
||||
'49,50,51,46,45,44
|
||||
LINE (158, 0)-(158, 200), 46
|
||||
LINE (159, 0)-(159, 200), 45
|
||||
LINE (160, 0)-(160, 200), 44
|
||||
LINE (161, 0)-(161, 200), 45
|
||||
LINE (162, 0)-(162, 200), 46
|
||||
END SUB
|
||||
|
||||
SUB win
|
||||
LOCATE 20, 21
|
||||
COLOR 7
|
||||
LINE (300, 187)-(270, 160)
|
||||
PRINT "Way cool man!"
|
||||
SLEEP
|
||||
CLS
|
||||
COLOR 14
|
||||
LOCATE 1, 1
|
||||
SCREEN 12
|
||||
PRINT "THE SCHOOL HAS BEEN ELIMINATED - GOOD WORK, RETURN TO BASE!"
|
||||
SLEEP
|
||||
END SUB
|
||||
|
1
noschool.bas.d
Normal file
1
noschool.bas.d
Normal file
@ -0,0 +1 @@
|
||||
Battleship-Style UFO Game - dish out some DFA.
|
BIN
noschool.exe
Normal file
BIN
noschool.exe
Normal file
Binary file not shown.
1
noschool.exe.d
Normal file
1
noschool.exe.d
Normal file
@ -0,0 +1 @@
|
||||
Compiled.
|
100
pop.bas
Normal file
100
pop.bas
Normal file
@ -0,0 +1,100 @@
|
||||
DECLARE SUB pause (time!)
|
||||
DECLARE SUB fire ()
|
||||
DECLARE SUB laser ()
|
||||
DECLARE SUB pop ()
|
||||
DECLARE SUB icbm ()
|
||||
DECLARE SUB trees ()
|
||||
DECLARE SUB baloons ()
|
||||
CLS
|
||||
SCREEN 12
|
||||
trees
|
||||
baloons
|
||||
laser
|
||||
pop
|
||||
fire
|
||||
SYSTEM
|
||||
|
||||
SUB baloons
|
||||
FOR q = 1 TO 100
|
||||
CIRCLE (q, 100), 10, 4, , , 2
|
||||
LINE (0 + q, 110)-(-100 + q * 2, 150 + q / 10), 7
|
||||
pause .05
|
||||
CIRCLE (q, 100), 10, 0, , , 2
|
||||
LINE (q, 110)-(-100 + q * 2, 150 + q / 10), 0
|
||||
NEXT q
|
||||
CIRCLE (0 + q, 100), 10, 4, , , 2
|
||||
LINE (q, 110)-(-100 + q * 2, 150 + q / 10), 7
|
||||
END SUB
|
||||
|
||||
SUB fire
|
||||
FOR noo = 1 TO 3
|
||||
PLAY "T160O0L32EFGEFDC"
|
||||
FOR n = 1 TO 6
|
||||
FOR q = 1 TO 60 'hight of flame
|
||||
a = SIN(n + q / 10) * 10
|
||||
FOR b = 1 TO q / 6 'width of flame
|
||||
PSET (100 + (noo * 20) + a + b, 480 - 60 + q), 4
|
||||
NEXT b
|
||||
NEXT q
|
||||
pause .001
|
||||
FOR q = 1 TO 60 'hight of flame
|
||||
a = SIN(n + q / 10) * 10
|
||||
FOR b = 1 TO q / 6 'width of flame
|
||||
PSET (100 + (noo * 20) + a + b, 480 - 60 + q), 0
|
||||
NEXT b
|
||||
NEXT q
|
||||
NEXT n
|
||||
NEXT noo
|
||||
FOR i = 1 TO 3
|
||||
PLAY "T160O0L32EFGEFDC"
|
||||
NEXT i
|
||||
FOR f = 1 TO 650
|
||||
CIRCLE (190, 480), f, 4
|
||||
pause .000001
|
||||
NEXT f
|
||||
END SUB
|
||||
|
||||
SUB laser
|
||||
FOR b = 1 TO 15
|
||||
LINE (640, 300)-(100, 100), b
|
||||
pause .005
|
||||
NEXT b
|
||||
LINE (640, 300)-(100, 100), 0
|
||||
END SUB
|
||||
|
||||
SUB pause (time)
|
||||
t = TIMER + time
|
||||
DO: LOOP WHILE TIMER < t
|
||||
END SUB
|
||||
|
||||
SUB pop
|
||||
FOR i = 1 TO 3
|
||||
PLAY "T160O0L32EFGEFDC"
|
||||
NEXT i
|
||||
FOR r = 1 TO 20
|
||||
CIRCLE (100, 100), r, 4
|
||||
pause .0001
|
||||
NEXT r
|
||||
FOR r = 1 TO 380
|
||||
CIRCLE (100, 100 + r), 20 + r / 10, 4
|
||||
PAINT (100, 100 + r), 4, 4
|
||||
pause .00001
|
||||
PAINT (100, 100 + r), 0, 0
|
||||
NEXT r
|
||||
CIRCLE (100, 100 + r - 1), 20 + r / 10, 0
|
||||
FOR i = 1 TO 3
|
||||
PLAY "T160O0L32EFGEFDC"
|
||||
NEXT i
|
||||
END SUB
|
||||
|
||||
SUB trees
|
||||
DRAW "bm0,430"
|
||||
FOR t = 0 TO 11
|
||||
tree$ = "c2g10r5g10r5g10r5g10r50h10r5h10r5h10r5h10bd40r2d1c6d4l4u5c2r2bu40"
|
||||
DRAW "br50X" + VARPTR$(tree$)
|
||||
NEXT t
|
||||
CIRCLE (190, 480), 10, 5, , , .5
|
||||
PAINT (190, 478), 5, 5
|
||||
pause .5
|
||||
END SUB
|
||||
|
2
pop.bas.d
Normal file
2
pop.bas.d
Normal file
@ -0,0 +1,2 @@
|
||||
Balloon Animation - why laser pointers and land mines should be banned from
|
||||
public parks.
|
60
scrworms.bas
Normal file
60
scrworms.bas
Normal file
@ -0,0 +1,60 @@
|
||||
DECLARE FUNCTION around! (spot!)
|
||||
CLS
|
||||
SCREEN 12
|
||||
RANDOMIZE TIMER
|
||||
TYPE coor
|
||||
x AS INTEGER
|
||||
y AS INTEGER
|
||||
END TYPE
|
||||
DIM newspot(6) AS coor
|
||||
FOR c = 1 TO 15
|
||||
PALETTE c, c * 3
|
||||
NEXT c
|
||||
newspot(1).x = 200
|
||||
newspot(1).y = 200
|
||||
newspot(2).x = 200
|
||||
newspot(2).y = 200
|
||||
newspot(3).x = 200
|
||||
newspot(3).y = 200
|
||||
newspot(4).x = 200
|
||||
newspot(4).y = 200
|
||||
newspot(5).x = 200
|
||||
newspot(5).y = 200
|
||||
|
||||
DO
|
||||
i = i + 1
|
||||
IF INKEY$ <> "" THEN SYSTEM
|
||||
CIRCLE (newspot(1).x, newspot(1).y), 1, i MOD 15
|
||||
CIRCLE (newspot(2).x, newspot(2).y), 1, i MOD 15
|
||||
CIRCLE (newspot(3).x, newspot(3).y), 1, i MOD 15
|
||||
CIRCLE (newspot(4).x, newspot(4).y), 1, i MOD 15
|
||||
CIRCLE (newspot(5).x, newspot(5).y), 1, i MOD 15
|
||||
oldspot = newspot(1).x
|
||||
newspot(1).x = newspot(1).x + around(oldspot)
|
||||
oldspot = newspot(1).y
|
||||
newspot(1).y = newspot(1).y + around(oldspot)
|
||||
oldspot = newspot(2).x
|
||||
newspot(2).x = newspot(2).x + around(oldspot)
|
||||
oldspot = newspot(2).y
|
||||
newspot(2).y = newspot(2).y + around(oldspot)
|
||||
oldspot = newspot(3).x
|
||||
newspot(3).x = newspot(3).x + around(oldspot)
|
||||
oldspot = newspot(3).y
|
||||
newspot(3).y = newspot(3).y + around(oldspot)
|
||||
oldspot = newspot(4).x
|
||||
newspot(4).x = newspot(4).x + around(oldspot)
|
||||
oldspot = newspot(4).y
|
||||
newspot(4).y = newspot(4).y + around(oldspot)
|
||||
oldspot = newspot(5).x
|
||||
newspot(5).x = newspot(5).x + around(oldspot)
|
||||
oldspot = newspot(5).y
|
||||
newspot(5).y = newspot(5).y + around(oldspot)
|
||||
LOOP
|
||||
|
||||
FUNCTION around (spot)
|
||||
a = INT(RND * 3) - 1
|
||||
IF spot < 100 THEN a = 200
|
||||
IF spot > 300 THEN a = -200
|
||||
around = a
|
||||
END FUNCTION
|
||||
|
1
scrworms.bas.d
Normal file
1
scrworms.bas.d
Normal file
@ -0,0 +1 @@
|
||||
Wormish Animation - a screen-saver wanna-be.
|
BIN
scrworms.exe
Normal file
BIN
scrworms.exe
Normal file
Binary file not shown.
1
scrworms.exe.d
Normal file
1
scrworms.exe.d
Normal file
@ -0,0 +1 @@
|
||||
Compiled.
|
377
ufovisit.bas
Normal file
377
ufovisit.bas
Normal file
@ -0,0 +1,377 @@
|
||||
DECLARE SUB pause (time!)
|
||||
DECLARE SUB lafin ()
|
||||
DECLARE SUB opening ()
|
||||
DECLARE SUB stars ()
|
||||
DECLARE SUB resetstars ()
|
||||
DECLARE SUB photon ()
|
||||
DECLARE SUB dematerialize ()
|
||||
DECLARE SUB city ()
|
||||
DECLARE SUB fire ()
|
||||
DECLARE SUB materialize ()
|
||||
SCREEN 9
|
||||
CLS
|
||||
stars
|
||||
city
|
||||
materialize
|
||||
fire
|
||||
photon
|
||||
resetstars
|
||||
dematerialize
|
||||
SYSTEM
|
||||
|
||||
SUB city
|
||||
FOR q = 1 TO 15
|
||||
PSET (30, 350 - q * 3)
|
||||
PSET (34, 350 - q * 3)
|
||||
PSET (38, 350 - q * 3)
|
||||
PSET (42, 350 - q * 3)
|
||||
PSET (46, 350 - q * 3)
|
||||
PSET (50, 350 - q * 3)
|
||||
NEXT q
|
||||
FOR q = 1 TO 9
|
||||
PSET (57, 350 - q * 5)
|
||||
PSET (65, 350 - q * 5)
|
||||
PSET (73, 350 - q * 5)
|
||||
|
||||
NEXT q
|
||||
FOR q = 1 TO 18
|
||||
PSET (80, 350 - q * 3)
|
||||
PSET (84, 350 - q * 3)
|
||||
PSET (88, 350 - q * 3)
|
||||
PSET (92, 350 - q * 3)
|
||||
PSET (96, 350 - q * 3)
|
||||
PSET (100, 350 - q * 3)
|
||||
PSET (104, 350 - q * 3)
|
||||
NEXT q
|
||||
PSET (84, 293)
|
||||
FOR q = 1 TO 2
|
||||
PSET (88, 293 + 3 - q * 3)
|
||||
NEXT q
|
||||
FOR q = 1 TO 3
|
||||
PSET (92, 293 + 3 - q * 3)
|
||||
NEXT q
|
||||
FOR q = 1 TO 4
|
||||
PSET (96, 293 + 3 - q * 3)
|
||||
NEXT q
|
||||
FOR q = 1 TO 5
|
||||
PSET (100, 293 + 3 - q * 3)
|
||||
NEXT q
|
||||
FOR q = 1 TO 6
|
||||
PSET (104, 293 + 3 - q * 3)
|
||||
NEXT q
|
||||
FOR q = 1 TO 15
|
||||
PSET (109, 355 - q * 5 - 3)
|
||||
PSET (117, 355 - q * 5 - 3)
|
||||
PSET (125, 355 - q * 5 - 3)
|
||||
NEXT q
|
||||
|
||||
FOR q = 1 TO 35
|
||||
PSET (150, 350 - q * 3)
|
||||
PSET (151, 350 - q * 3)
|
||||
PSET (153, 350 - q * 3)
|
||||
PSET (156, 350 - q * 3)
|
||||
PSET (160, 350 - q * 3)
|
||||
NEXT q
|
||||
FOR q = 145 TO 165
|
||||
PSET (q, 243)
|
||||
NEXT q
|
||||
FOR q = 135 TO 175
|
||||
PSET (q, 240)
|
||||
NEXT q
|
||||
FOR q = 143 TO 167
|
||||
PSET (q, 237)
|
||||
NEXT q
|
||||
FOR q = 1 TO 10
|
||||
PSET (155, 235 - q)
|
||||
NEXT q
|
||||
|
||||
FOR q = 1 TO 30
|
||||
PSET (230, 350 - q * 3)
|
||||
PSET (234, 350 - q * 3)
|
||||
PSET (238, 350 - q * 3)
|
||||
PSET (242, 350 - q * 3)
|
||||
PSET (246, 350 - q * 3)
|
||||
PSET (250, 350 - q * 3)
|
||||
NEXT q
|
||||
FOR q = 1 TO 18
|
||||
PSET (257, 350 - q * 5)
|
||||
PSET (265, 350 - q * 5)
|
||||
PSET (273, 350 - q * 5)
|
||||
NEXT q
|
||||
|
||||
FOR q = 1 TO 15
|
||||
PSET (330, 350 - q * 3)
|
||||
PSET (334, 350 - q * 3)
|
||||
PSET (338, 350 - q * 3)
|
||||
PSET (342, 350 - q * 3)
|
||||
PSET (346, 350 - q * 3)
|
||||
PSET (350, 350 - q * 3)
|
||||
NEXT q
|
||||
FOR q = 1 TO 9
|
||||
PSET (357, 350 - q * 5)
|
||||
PSET (365, 350 - q * 5)
|
||||
PSET (373, 350 - q * 5)
|
||||
NEXT q
|
||||
|
||||
FOR q = 1 TO 18
|
||||
PSET (390, 350 - q * 3)
|
||||
PSET (394, 350 - q * 3)
|
||||
PSET (398, 350 - q * 3)
|
||||
PSET (402, 350 - q * 3)
|
||||
PSET (406, 350 - q * 3)
|
||||
PSET (410, 350 - q * 3)
|
||||
PSET (414, 350 - q * 3)
|
||||
NEXT q
|
||||
FOR q = 1 TO 11
|
||||
PSET (419, 355 - q * 5 - 3)
|
||||
PSET (427, 355 - q * 5 - 3)
|
||||
PSET (435, 355 - q * 5 - 3)
|
||||
NEXT q
|
||||
|
||||
FOR q = 1 TO 18
|
||||
PSET (480, 350 - q * 3)
|
||||
PSET (484, 350 - q * 3)
|
||||
PSET (488, 350 - q * 3)
|
||||
PSET (492, 350 - q * 3)
|
||||
PSET (496, 350 - q * 3)
|
||||
PSET (500, 350 - q * 3)
|
||||
PSET (504, 350 - q * 3)
|
||||
NEXT q
|
||||
PSET (484, 293)
|
||||
FOR q = 1 TO 2
|
||||
PSET (488, 293 + 3 - q * 3)
|
||||
NEXT q
|
||||
FOR q = 1 TO 3
|
||||
PSET (492, 293 + 3 - q * 3)
|
||||
NEXT q
|
||||
FOR q = 1 TO 4
|
||||
PSET (496, 293 + 3 - q * 3)
|
||||
NEXT q
|
||||
FOR q = 1 TO 5
|
||||
PSET (500, 293 + 3 - q * 3)
|
||||
NEXT q
|
||||
FOR q = 1 TO 6
|
||||
PSET (504, 293 + 3 - q * 3)
|
||||
NEXT q
|
||||
FOR q = 1 TO 15
|
||||
PSET (509, 355 - q * 5 - 3)
|
||||
PSET (517, 355 - q * 5 - 3)
|
||||
PSET (525, 355 - q * 5 - 3)
|
||||
NEXT q
|
||||
|
||||
FOR q = 1 TO 30
|
||||
PSET (550, 350 - q * 3)
|
||||
PSET (554, 350 - q * 3)
|
||||
PSET (558, 350 - q * 3)
|
||||
PSET (562, 350 - q * 3)
|
||||
PSET (566, 350 - q * 3)
|
||||
PSET (570, 350 - q * 3)
|
||||
NEXT q
|
||||
FOR q = 1 TO 18
|
||||
PSET (577, 350 - q * 5)
|
||||
PSET (585, 350 - q * 5)
|
||||
PSET (593, 350 - q * 5)
|
||||
NEXT q
|
||||
|
||||
END SUB
|
||||
|
||||
SUB dematerialize
|
||||
SLEEP 1
|
||||
FOR z = 1 TO 50
|
||||
COLOR 0
|
||||
a% = INT(RND * 30) + 1
|
||||
PSET (300 + a%, 30)
|
||||
b% = INT(RND * 28) + 1
|
||||
PSET (301 + b%, 31)
|
||||
c% = INT(RND * 28) + 1
|
||||
COLOR 0
|
||||
PSET (301 + c%, 29)
|
||||
pause .005
|
||||
NEXT z
|
||||
COLOR 0
|
||||
LINE (300, 30)-(330, 30)
|
||||
LINE (301, 31)-(329, 31)
|
||||
COLOR 0
|
||||
LINE (301, 29)-(329, 29)
|
||||
|
||||
END SUB
|
||||
|
||||
SUB fire
|
||||
FOR a = 1 TO 31
|
||||
COLOR 4
|
||||
PSET (299 + a, 30)
|
||||
pause .005
|
||||
NEXT a
|
||||
|
||||
FOR i = 2 TO 15
|
||||
COLOR i
|
||||
LINE (316, 32)-(40, 350)
|
||||
pause .002
|
||||
NEXT i
|
||||
|
||||
COLOR 4
|
||||
FOR s = 1 TO 100
|
||||
CIRCLE (40, 350), s
|
||||
pause .00001
|
||||
NEXT s
|
||||
|
||||
COLOR 0
|
||||
LINE (316, 32)-(40, 350)
|
||||
|
||||
FOR a = 1 TO 100
|
||||
CIRCLE (40, 350), a
|
||||
pause .00001
|
||||
NEXT a
|
||||
|
||||
COLOR 15
|
||||
LINE (300, 30)-(330, 30)
|
||||
|
||||
FOR a = 1 TO 31
|
||||
COLOR 4
|
||||
PSET (299 + a, 30)
|
||||
pause .005
|
||||
NEXT a
|
||||
|
||||
FOR i = 2 TO 15
|
||||
COLOR i
|
||||
LINE (316, 32)-(150, 250)
|
||||
pause .002
|
||||
NEXT i
|
||||
|
||||
COLOR 4
|
||||
FOR s = 1 TO 100
|
||||
CIRCLE (150, 250), s
|
||||
pause .00001
|
||||
NEXT s
|
||||
|
||||
COLOR 0
|
||||
LINE (316, 32)-(150, 250)
|
||||
|
||||
FOR a = 1 TO 100
|
||||
CIRCLE (150, 250), a
|
||||
pause .00001
|
||||
NEXT a
|
||||
|
||||
COLOR 15
|
||||
LINE (300, 30)-(330, 30)
|
||||
|
||||
FOR a = 1 TO 31
|
||||
COLOR 4
|
||||
PSET (299 + a, 30)
|
||||
pause .005
|
||||
NEXT a
|
||||
|
||||
FOR i = 2 TO 15
|
||||
COLOR i
|
||||
LINE (316, 32)-(410, 350)
|
||||
pause .002
|
||||
NEXT i
|
||||
|
||||
COLOR 4
|
||||
FOR s = 1 TO 100
|
||||
CIRCLE (410, 350), s
|
||||
pause .00001
|
||||
NEXT s
|
||||
|
||||
COLOR 0
|
||||
LINE (316, 32)-(410, 350)
|
||||
|
||||
FOR a = 1 TO 100
|
||||
CIRCLE (410, 350), a
|
||||
pause .00001
|
||||
NEXT a
|
||||
|
||||
COLOR 15
|
||||
LINE (300, 30)-(330, 30)
|
||||
|
||||
FOR a = 1 TO 31
|
||||
COLOR 4
|
||||
PSET (299 + a, 30)
|
||||
pause .005
|
||||
NEXT a
|
||||
|
||||
FOR i = 2 TO 15
|
||||
COLOR i
|
||||
LINE (316, 32)-(570, 300)
|
||||
pause .002
|
||||
NEXT i
|
||||
|
||||
COLOR 4
|
||||
FOR s = 1 TO 100
|
||||
CIRCLE (570, 300), s
|
||||
pause .00001
|
||||
NEXT s
|
||||
|
||||
COLOR 0
|
||||
LINE (316, 32)-(570, 300)
|
||||
|
||||
FOR a = 1 TO 100
|
||||
CIRCLE (570, 300), a
|
||||
pause .00001
|
||||
NEXT a
|
||||
|
||||
COLOR 15
|
||||
LINE (300, 30)-(330, 30)
|
||||
|
||||
END SUB
|
||||
|
||||
SUB materialize
|
||||
SLEEP 1
|
||||
FOR z = 1 TO 50
|
||||
COLOR 15
|
||||
a% = INT(RND * 30) + 1
|
||||
PSET (300 + a%, 30)
|
||||
b% = INT(RND * 28) + 1
|
||||
PSET (301 + b%, 31)
|
||||
c% = INT(RND * 28) + 1
|
||||
COLOR 3
|
||||
PSET (301 + c%, 29)
|
||||
pause .005
|
||||
NEXT z
|
||||
COLOR 15
|
||||
LINE (300, 30)-(330, 30)
|
||||
LINE (301, 31)-(329, 31)
|
||||
COLOR 3
|
||||
LINE (301, 29)-(329, 29)
|
||||
|
||||
END SUB
|
||||
|
||||
SUB pause (time)
|
||||
t = TIMER + time
|
||||
DO: LOOP WHILE TIMER < t
|
||||
END SUB
|
||||
|
||||
SUB photon
|
||||
FOR o = 1 TO 350
|
||||
COLOR 14
|
||||
CIRCLE (315, 33 + o), 2
|
||||
pause .00004
|
||||
COLOR 0
|
||||
CIRCLE (315, 33 + o), 2
|
||||
NEXT o
|
||||
COLOR 4
|
||||
FOR i = 1 TO 400
|
||||
CIRCLE (315, 400), i
|
||||
pause .00001
|
||||
NEXT i
|
||||
COLOR 0
|
||||
FOR i = 1 TO 400
|
||||
CIRCLE (315, 400), i
|
||||
pause .00001
|
||||
NEXT i
|
||||
END SUB
|
||||
|
||||
SUB resetstars
|
||||
COLOR 15
|
||||
FOR s = 1 TO 50
|
||||
PSET (INT(RND * 640), (INT(RND * 230) + 120))
|
||||
NEXT s
|
||||
END SUB
|
||||
|
||||
SUB stars
|
||||
COLOR 15
|
||||
FOR s = 1 TO 200
|
||||
PSET (INT(RND * 640), (INT(RND * 350)))
|
||||
NEXT s
|
||||
END SUB
|
||||
|
1
ufovisit.bas.d
Normal file
1
ufovisit.bas.d
Normal file
@ -0,0 +1 @@
|
||||
UFO Attack - senseless, wanton animated destruction.
|
BIN
ufovisit.exe
Normal file
BIN
ufovisit.exe
Normal file
Binary file not shown.
1
ufovisit.exe.d
Normal file
1
ufovisit.exe.d
Normal file
@ -0,0 +1 @@
|
||||
Compiled.
|
Loading…
Reference in New Issue
Block a user