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
#2
LOL that is pretty cool!
Reply
#3
Cool... What more can I say? Cool.
May your journey be free of incident. Live long and prosper.
Reply
#4
LOL cute!
b = b + ...
Reply
#5
Someday there's going to be a game that actually uses some of that code (or at least the basic model) but I've got at least a dozen other coding projects I'd like to work on too.
Reply
#6
Reminds me to this very good one: Extended Draw Function
Reply
#7
(06-14-2022, 02:53 PM)RhoSigma Wrote: Reminds me to this very good one: Extended Draw Function

That's pretty impressive. I've really been appreciating enjoying  draw based lately, decades ago I didn't care much for them and neglected using them for years. The speedy machines we have these days make it much more appealing.
Reply
#8
(06-13-2022, 09:30 PM)James D Jarvis Wrote: DrawTrek Demo1. To boldly go where we've likely gone before with little to no copyright or trademark violations!

Nice! Now you just need some user controls and your almost ready for the next game jam. 
 
Play DrawTrek Online
Reply
#9
(06-14-2022, 10:40 PM)dbox Wrote:
(06-13-2022, 09:30 PM)James D Jarvis Wrote: DrawTrek Demo1. To boldly go where we've likely gone before with little to no copyright or trademark violations!

Nice! Now you just need some user controls and your almost ready for the next game jam. 
 
Play DrawTrek Online

That's cool, I keep being impressed by qbjs.
Reply




Users browsing this thread: 2 Guest(s)