Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"Explosion"
#1
My "explosion":
Code:
randomize timer
type particles
    x as integer
    y as integer
    vs as integer
    va as integer
end type
const PARTICLE = 20000
dim sparks(PARTICLE) as particles
dim red(6,6)
dim white(6,6)
dim brown(6,6)
startx = 1024 / 2
starty = 768 / 2
xmot = 2
ymot = 2
for i = 1 to PARTICLE
    sparks(i).x = startx
    sparks(i).y = starty
    sparks(i).vs = int(rnd * 10 + 1)
    sparks(i).va = int(rnd * 359 + 1)
next i



screen 20
for x = 1 to 6
    for y = 1 to 6
        read c
        pset (x, y), c
    next y
next x
get (0,0)-(6,6), red
cls
for x = 1 to 6
    for y = 1 to 6
        read c
        pset (x, y), c
    next y
next x
get (0,0)-(6,6), white
cls
for x = 1 to 6
    for y = 1 to 6
        read c
        pset (x, y), c
    next y
next x
get (0,0)-(6,6), brown


while inkey = ""
for i = 1 to PARTICLE
    dist = sqr(((sparks(i).x - startx)^2) + ((sparks(i).y - starty)^2))
    if dist < 150 then
        put (sparks(i).x, sparks(i).y), white
    elseif dist < 300 and dist > 150 then
        put (sparks(i).x, sparks(i).y), red
    elseif dist > 300 then
        put (sparks(i).x, sparks(i).y), brown
    end if
    if sparks(i).va < 90 then
        sparks(i).x = int(sin(sparks(i).va) * sparks(i).vs) + sparks(i).x
        sparks(i).y = int(cos(sparks(i).va) * sparks(i).vs) + sparks(i).y
    elseif sparks(i).va > 90 AND sparks(i).va < 180 then
        a = sparks(i).va - 90
        sparks(i).x = int(sin(sparks(i).va) * sparks(i).vs) + sparks(i).x
        y = int(cos(sparks(i).va) * sparks(i).vs) + sparks(i).y
        sparks(i).y = 2 * (starty - y) + starty
    elseif sparks(i).va > 180 AND sparks(i).va < 270 then
        a = sparks(i).va - 180
        x = int(sin(sparks(i).va) * sparks(i).vs) + sparks(i).x
        sparks(i).x = 2 * (startx - x) + startx
        y = int(cos(sparks(i).va) * sparks(i).vs) + sparks(i).y
        sparks(i).y = 2 * (starty - y) + starty
    elseif sparks(i).va > 270 AND sparks(i).va < 360 then
        a = sparks(i).va - 270
        x = int(sin(sparks(i).va) * sparks(i).vs) + sparks(i).x
        sparks(i).x = 2 * (startx - x) + startx
        sparks(i).y = int(cos(sparks(i).va) * sparks(i).vs) + sparks(i).y
    end if
    if sparks(i).x > 1024 or sparks(i).x < 0 or sparks(i).y > 768 or sparks(i).y < 0 then
        sparks(i).x = startx : sparks(i).y = starty
    end if
next i
cls
startx = startx + xmot
starty = starty + ymot
if startx <= 0 or startx >= 1024 then xmot = -xmot
if starty <= 0 or starty >= 768 then ymot = -ymot
wend

data 0,0,4,4,0,0
data 0,4,4,4,4,0
data 4,4,4,4,4,4
data 4,4,4,4,4,4
data 0,4,4,4,4,0
data 0,0,4,4,0,0

data 0,0,14,14,0,0
data 0,14,14,14,14,0
data 14,14,14,14,14,14
data 14,14,14,14,14,14
data 0,14,14,14,14,0
data 0,0,14,14,0,0

data 0,0,6,6,0,0
data 0,6,6,6,6,0
data 6,6,6,6,6,6
data 6,6,6,6,6,6
data 0,6,6,6,6,0
data 0,0,6,6,0,0
In the beginning, there is darkness – the emptiness of a matrix waiting for the light. Then a single photon flares into existence. Then another. Soon, thousands more. Optronic pathways connect, subroutines emerge from the chaos, and a holographic consciousness is born." -The Doctor
Reply
#2
Nice. 8)
url=http://www.random-seed.net][Image: asylumsig.png][/url]
Reply
#3
I would say it looks rather cool Smile
[Image: rg_link.png]
I'm a dog and I feel dirty baby
Reply
#4
Needs more details though. Like a cloud. Plasma. Yeah.
In the beginning, there is darkness – the emptiness of a matrix waiting for the light. Then a single photon flares into existence. Then another. Soon, thousands more. Optronic pathways connect, subroutines emerge from the chaos, and a holographic consciousness is born." -The Doctor
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)