April 29, 2024, 10:56:05 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


cool art or random junk?

Started by yujinwunz, January 13, 2009, 05:59:07 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

yujinwunz

January 13, 2009, 05:59:07 PM Last Edit: January 13, 2009, 06:00:54 PM by yujinwunz
hi everyone

is this cool art or random junk?

whatever it is it looks awsome

i discovered this effect accidentally when i was makin a game (i dont know if others have found this before me)

here's the source and i have the program as an attachment


'by yujin wu : yujinwunz@hotmail.com
IF CREATESCREEN( 800, 600, 32) < 0
   MESSAGEBOX 0,"Error creating screen","error"
   END
ENDIF
DECLARE limit(num as float, max as float), float
DEF ex[10000] as float
DEF ey[10000] as float
DEF eb[10000] as float
DEF ee[10000] as float
DEF ees as INT

DO
   FILLSCREEN RGB(0,0,0)


IF MOUSEDOWN(1) THEN

eb[ees] = 30
ex[ees] = MOUSEX()
ey[ees] = MOUSEY()
ee[ees] = 255
ees++

ENDIF
IF ees > 5000 THEN ees = 0
FOR i = 0 to 9999
IF ee[i] > 0 THEN
DRAWRECT ex[i]-0.5*eb[i],ey[i]-0.5*eb[i],eb[i], eb[i],RGB(100+(ee[i]/2),ee[i],limit(6*(ee[i]-200),240))
ee[i] = ee[i] - 2
eb[i] = eb[i] * (ee[i] / 15000 + 1)
IF RAND(80) = 1 THEN
eb[ees] = eb[i] * 0.5
ex[ees] = ex[i] + RAND(-eb[i], eb[i])
ey[ees] = ey[i] + RAND(-eb[i], eb[i])
ee[ees] = 150
ees++
ENDIF

ENDIF
NEXT i


   FLIP
UNTIL GETKEY <> ""
DO
WRITETEXT 100, 100,"by Yujin Wu, yujinwunz@hotmail.com"
FLIP
UNTIL GETKEY <> ""
CLOSESCREEN
END

SUB limit(num as float, max as float)

DEF num1 as float
num1 = num
IF num1 < 0 THEN num = 0
IF num1> max THEN num = max

RETURN num

ENDSUB




click anywhere to begin and press a key to end

mrainey

I got a cool black screen.   ???
Software For Metalworking
http://closetolerancesoftware.com

yujinwunz

try clicking and dragging before you press a key. its interactive

RG

I liked it  :D you can get quite a display going by different combinations of clicking and dragging. are you going to do anything further with it?

yujinwunz

its already a main graphics feature in  one of my games (which is still in development). what do you think would come of it? (i think it makes a nice screensaver but takes up too much cpu)

aurelCB


mrainey

Quotetry clicking and dragging before you press a key. its interactive

That made a difference.  Pretty neat.
Software For Metalworking
http://closetolerancesoftware.com

RG

it acts like a particle generator - modifying how fast they are spawned and the number spawned could minimize cpu impact. I could see several types of programs where this could be used.

Bruce Peaslee

Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles