DrawTrek
#1
DrawTrek Demo1. To boldly go where we've likely gone before with little to no copyright or trademark violations!

Code: (Select All)
'Drawtrek  demo1
'an epic space opera demo
'by James D. Jarvis
Screen _NewImage(800, 600, 256)
Randomize Timer
Dim Shared shieldstr
Dim Shared kshieldstr
Dim Shared shieldmax
Dim Shared kshieldmax
Dim Shared st(100, 2)
For s = 1 To 100
    st(s, 1) = Int(Rnd * 800)
    st(s, 2) = Int(Rnd * 600)
Next s
shieldmax = 50
shieldstr = 50
kshieldstr = 50
kshieldmax = 50
For px = 100 To 300 Step 10
    _Limit 60
    Cls
    drawstars
    drawplayership px, 300
    drawkremulan 400 + px / 3, 300
    _Display
Next px
For x = 300 To 500 Step 8
    _Limit 60
    Cls
    drawstars
    drawplayership px, 300
    drawkremulan 500 + Int(x / 16), 300

    dburst x, 300, 4, 11
    _Display
Next x
For dspan = 4 To 20
    _Limit 60
    Cls
    drawstars
    drawplayership px, 300
    drawkremulan 500 + Int(x / 16), 300

    dburst x, 300, dspan - Int(Rnd * 3), 12
    kshieldstr = kshieldstr - 1
    _Display
Next dspan
Cls
kx = 500 + Int(x / 16)
drawstars
drawplayership 270, 300
drawkremulan kx, 300
_Delay 0.14
For x = 300 To 500 Step 8
    _Limit 60
    Cls
    drawstars
    drawplayership px, 300
    drawkremulan kx, 300

    dburst x, 300, 4, 11
    _Display
Next x
For dspan = 4 To 20
    _Limit 60
    Cls
    drawstars
    drawplayership px, 300
    drawkremulan 500 + Int(x / 16), 300

    dburst x, 300, dspan - Int(Rnd * 3), 12
    kshieldstr = kshieldstr - 3
    _Display
Next dspan
_Delay 0.14
For x = 300 To 500 Step 8
    _Limit 60
    Cls
    drawstars
    drawplayership px, 300
    drawkremulan kx, 300

    dburst x, 300, 4, 11
    _Display
Next x
For dspan = 4 To 20
    _Limit 60
    Cls
    drawstars
    drawplayership px, 300
    drawkremulan kx, 300

    dburst x, 300, dspan - Int(Rnd * 3), 12
    kshieldstr = kshieldstr - 3
    _Display
Next dspan

For boom = 1 To 30
    _Limit 60
    Cls
    drawstars
    drawplayership px, 300
    drawkremulan kx, 300


    dburst kx + Int(Rnd * 12), 300 + Int(Rnd * 7) - Int(Rnd * 7), Int(Rnd * 12) + boom / 2, 12
    If Int(Rnd * 3) < 2 Then dburst kx + Int(Rnd * 12), 300 + Int(Rnd * 7) - Int(Rnd * 7), Int(Rnd * 12) + boom / 2, 14
    If Int(Rnd * 3) < 2 Then dburst kx + Int(Rnd * 12), 300 + Int(Rnd * 7) - Int(Rnd * 7), Int(Rnd * 12) + boom / 2, 4
    _Display
Next boom
Cls
a = 0
For Y = 300 To -20 Step -5
    _Limit 60
    Cls
    If a < 90 Then
        a = a + 5
        px = px + 3
    End If
    drawstars
    Draw "ta" + Str$(a)
    drawplayership px, Y
    _Display
Next Y

Sub drawplayership (xx, yy)

    PSet (xx, yy), 0
    Color 15
    Circle (xx, yy), 5, 15
    Draw " bm -10,0 r10 bm -10,-4 d8 l3 br3 bu8 l3"
    sc = 10
    If shieldstr < shieldmax * .8 Then sc = 2
    If shieldstr < shieldmax * .6 Then sc = 14
    If shieldstr < shieldmax * .4 Then sc = 12
    If shieldstr < shieldmax * .2 Then sc = 4
    If shieldstr > 0 Then Circle (xx, yy), 20, sc, 0, (2 * _Pi) * (shieldstr / shieldmax)
    Draw "ta0"
End Sub

Sub drawkremulan (xx, yy)
    PSet (xx, yy), 0
    kk = 6
    Color kk
    Circle (xx, yy - 2), 2, kk
    Circle (xx, yy + 2), 2, kk
    Draw "bm -0,-2 l10 e3 l5 r5 g3 f3 l5 "
    sc = 10
    If kshieldstr < kshieldmax * .8 Then sc = 2
    If kshieldstr < kshieldmax * .6 Then sc = 14
    If kshieldstr < kshieldmax * .4 Then sc = 12
    If kshieldstr < kshieldmax * .2 Then sc = 4

    If kshieldstr > 0 Then Circle (xx, yy), 20, sc, 0, (2 * _Pi) * (kshieldstr / kshieldmax)
End Sub

Sub drawmraar (xx, yy)
    PSet (xx, yy), 0
    kk = 13
    Color kk
    Line (xx - 4, yy - 4)-(xx + 4, yy + 4), kk, B
    Draw "l18 d4 u4 r18 u8 l18 u4"


    sc = 10
    If kshieldstr < kshieldmax * .8 Then sc = 2
    If kshieldstr < kshieldmax * .6 Then sc = 14
    If kshieldstr < kshieldmax * .4 Then sc = 12
    If kshieldstr < kshieldmax * .2 Then sc = 4
    Circle (xx, yy), 20, sc, 0, (2 * _Pi) * (kshieldstr / kshieldmax)

End Sub
Sub drawvelnax (xx, yy)
    PSet (xx, yy), 0
    kk = 10
    Color kk
    Line (xx - 3, yy - 3)-(xx + 5, yy + 3), kk, B
    PSet (xx, yy)
    Draw "l15 u7 d14 u7 r4 u7 d14 "


    sc = 10
    If kshieldstr < kshieldmax * .8 Then sc = 2
    If kshieldstr < kshieldmax * .6 Then sc = 14
    If kshieldstr < kshieldmax * .4 Then sc = 12
    If kshieldstr < kshieldmax * .2 Then sc = 4
    Circle (xx, yy), 20, sc, 0, (2 * _Pi) * (kshieldstr / kshieldmax)

End Sub
Sub dcircle (xx, yy, r, klr)
    'draw a circle
    PSet (xx, yy), klr
    Draw "c" + Str$(klr)
    For d = 0 To 360 Step 1
        Draw "ta " + Str$(d) + " r" + Str$(r) + " bl" + Str$(r)
    Next d
End Sub
Sub dburst (xx, yy, r, klr)
    PSet (xx, yy), klr
    Draw "c" + Str$(klr)
    For d = 0 To 360 Step (1 + Rnd * 10)
        rv = Int(r \ 1.9 + Rnd * (r / 2))
        Draw "ta " + Str$(d) + " r" + Str$(rv) + " bl" + Str$(rv)
    Next d

End Sub

Sub darc (xx, yy, r, klr, arc1, arc2)
    'draws an arc, will draw an unfilled circle if the arc goes from 0 to 360
    PSet (xx, yy), klr
    Draw "c" + Str$(klr)
    For d = arc1 To arc2 Step 1
        Draw "ta " + Str$(d) + " br" + Str$(r - 1) + "r  bl" + Str$(r)
    Next d
End Sub
Sub drawstars
    For s = 1 To 100
        PSet (st(s, 1), st(s, 2)), 15
    Next s
End Sub
Reply


Messages In This Thread
DrawTrek - by James D Jarvis - 06-13-2022, 09:30 PM
RE: DrawTrek - by SierraKen - 06-13-2022, 09:48 PM
RE: DrawTrek - by johnno56 - 06-13-2022, 09:50 PM
RE: DrawTrek - by bplus - 06-13-2022, 09:56 PM
RE: DrawTrek - by James D Jarvis - 06-14-2022, 01:52 PM
RE: DrawTrek - by RhoSigma - 06-14-2022, 02:53 PM
RE: DrawTrek - by James D Jarvis - 06-14-2022, 08:45 PM
RE: DrawTrek - by dbox - 06-14-2022, 10:40 PM
RE: DrawTrek - by James D Jarvis - 06-20-2022, 02:12 PM



Users browsing this thread: 4 Guest(s)