Author Topic: Lack of inspiration leads to another shit effect.  (Read 4788 times)

0 Members and 1 Guest are viewing this topic.

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17426
  • Karma: 499
  • evil/good
    • View Profile
    • My Homepage
I can't seem to get into my programming at the moment, I don't seem to be having any good ideas.. I did this strange looking thing tonight, I have been drinking so I apologise.

Code: [Select]

        OPTION STATIC
        OPTION EXPLICIT
       
        CONST   XRES = 800
        CONST   YRES = 600

        DIM SHARED AS INTEGER HALFX = (XRES/2)
        DIM SHARED AS INTEGER HALFY = (YRES/2)

        #INCLUDE "TINYPTC_EXT.BI"
        #INCLUDE "WINDOWS.BI"
       

        DIM SHARED AS DOUBLE GAP =2
        DIM SHARED AS INTEGER RES = 10
        DIM SHARED AS DOUBLE SIZE = 10000
        DIM SHARED AS DOUBLE MOVE = 0
        DIM SHARED AS DOUBLE XX( RES * 4)
        DIM SHARED AS DOUBLE YY( RES * 4)

        DIM SHARED AS DOUBLE XPOS,YPOS
        DIM SHARED AS INTEGER XTARG,YTARG

        XTARG=0
        YTARG=0
        XPOS=0
        YPOS=0
       
        DIM SHARED AS UINTEGER  BUFFER ( XRES * YRES )
             
             
        DECLARE SUB MAKE_GRID()
        DECLARE SUB DRAW_WAFFLE(BYVAL W_SIZE AS DOUBLE)
        DECLARE SUB EDGE(BYVAL X1 AS INTEGER , BYVAL Y1 AS INTEGER , BYVAL X2 AS INTEGER , BYVAL Y2 AS INTEGER , BYVAL LR AS INTEGER, BYVAL LG AS INTEGER, BYVAL LB AS INTEGER)             
        DECLARE SUB DRAW_STACK()

        PTC_ALLOWCLOSE(0)
        PTC_SETDIALOG(0,"",0,0)   
        IF (PTC_OPEN("<( - DBF - )>",XRES,YRES)=0) THEN
            END-1
        END IF         

'
        MAKE_GRID()
 
WHILE(GETASYNCKEYSTATE(VK_ESCAPE)<>-32767)   
    DRAW_STACK()
'    DRAW_WAFFLE(30+10*SIN(timer*3))
    PTC_UPDATE@BUFFER(0)
    ERASE BUFFER
WEND

SUB DRAW_STACK()
    DIM X AS INTEGER
    DIM CUNT AS DOUBLE
    CUNT=.001+(GAP*10)
    MOVE=MOVE+.025
   
    XPOS=XPOS+((XTARG-XPOS)/28)
    YPOS=YPOS+((YTARG-YPOS)/28)   
   
    IF MOVE>GAP THEN
        MOVE=MOVE-GAP
        XTARG= ((RND(1)-.5))*5100
        YTARG= ((RND(1)-.5))*5100
    END IF
   
    FOR X=10 TO 1 STEP-1
        DRAW_WAFFLE(CUNT-MOVE)
        CUNT=CUNT-GAP
    NEXT
END SUB


SUB EDGE(BYVAL X1 AS INTEGER , BYVAL Y1 AS INTEGER , BYVAL X2 AS INTEGER , BYVAL Y2 AS INTEGER , BYVAL LR AS INTEGER, BYVAL LG AS INTEGER, BYVAL LB AS INTEGER)
'-------------------------------------------------------------------------------
'
' THIS LINE ROUTINE IS NOT VERY FAST BUT IT WORKS. THANKS TETRA.
' USAGE:
' EDGE ( X1 , Y1 , X2 , Y2 , R , G , B )
'
'-------------------------------------------------------------------------------
        DIM xdistance AS DOUBLE
        DIM ydistance AS DOUBLE
        DIM TC AS INTEGER       
        DIM i AS INTEGER
        DIM h2 AS INTEGER
       
        DIM StartX AS DOUBLE
        DIM StartY AS DOUBLE
        DIM XRatio AS DOUBLE
        DIM YRatio AS DOUBLE

        TC = RGB ( LR,LG,LB )

        xdistance = X2 - X1
        ydistance = Y2 - Y1

        h2 = sqr( xdistance * xdistance + ydistance * ydistance )
       
        StartX = X1
        StartY = Y1

        XRatio = xdistance * ( 1.0 / h2 )
        YRatio = ydistance * ( 1.0 / h2 )
       
        for i = 0 to h2
           
            IF  STARTX>0 AND STARTY>0 AND STARTX<XRES AND STARTY<YRES THEN
            BUFFER ( INT(StartX) + (INT(StartY) * XRES ) ) = TC
        END IF       
       
            StartX = StartX + XRatio
            StartY = StartY + YRatio
        next i



END SUB

SUB DRAW_WAFFLE(BYVAL W_SIZE AS DOUBLE)
   
    DIM AS INTEGER X,TX1,TY1,TX2,TY2,SV
   
   
    SV = 255/W_SIZE
   
    IF SV>255 THEN SV=255
    FOR X=0 TO RES-1
       
        TX1 = ((XX(X)+XPOS) / W_SIZE)+HALFX
        TY1 = ((YY(X)+YPOS) / W_SIZE)+HALFY
       
        TX2 = ((XX(X+RES)+XPOS) / W_SIZE)+HALFX
        TY2 = ((YY(X+RES)+YPOS) / W_SIZE)+HALFY
       
        IF TY1<0 THEN TY1=0
        IF TY1>YRES THEN TY1=YRES
        IF TY2<0 THEN TY2=0
        IF TY2>YRES THEN TY2=YRES
        IF TX1<0 THEN TX1=0
        IF TX1>XRES THEN TX1=XRES
        IF TX2<0 THEN TX2=0
        IF TX2>XRES THEN TX2=XRES


        EDGE (TX1,TY1,TX2,TY2,SV,SV,SV)

    NEXT

    FOR X=0 TO RES-1
       
        TX1 = ((XX(X+RES+RES)+XPOS) / W_SIZE)+HALFX
        TY1 = ((YY(X+RES+RES)+YPOS) / W_SIZE)+HALFY
        TX2 = ((XX(X+RES+RES+RES)+XPOS) / W_SIZE)+HALFX
        TY2 = ((YY(X+RES+RES+RES)+YPOS) / W_SIZE)+HALFY

        IF TY1<0 THEN TY1=0
        IF TY1>YRES THEN TY1=YRES
        IF TY2<0 THEN TY2=0
        IF TY2>YRES THEN TY2=YRES
        IF TX1<0 THEN TX1=0
        IF TX1>XRES THEN TX1=XRES
        IF TX2<0 THEN TX2=0
        IF TX2>XRES THEN TX2=XRES
       
        EDGE (TX1,TY1,TX2,TY2,SV,SV,SV)

    NEXT


   
END SUB



SUB MAKE_GRID()
    DIM AS INTEGER X
    DIM AS DOUBLE INTR 
    DIM AS DOUBLE STRT
    DIM AS DOUBLE ACTUAL
   
 
    INTR = (SIZE  / (RES-1))
    STRT = (-(SIZE/ 2))
    ACTUAL = STRT
   
    ' CALCULATE GRID
   
    FOR X=0 TO RES-1

        XX(X) = ACTUAL
        YY(X) = STRT

        XX(X+RES) =  ACTUAL
        YY(X+RES) = -STRT

        YY(X+RES+RES) = ACTUAL
        XX(X+RES+RES) = STRT

        YY(X+RES+RES+RES) = ACTUAL
        XX(X+RES+RES+RES) = -STRT
       
         ACTUAL = ACTUAL + INTR
       
    NEXT
   
END SUB

Come on, you must have had mental blocks too? :) In my mind this idea looked so cool too.. It just doesn't work.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Lack of inspiration leads to another shit effect.
« Reply #1 on: August 11, 2007 »
It reminds me of one of Parabellum's yabasic demos that had a ball infinitely falling through a set of grid lines like that.

I'm not just mentally blocked at the moment.  I'm not motivated either.

Jim


Challenge Trophies Won:

Offline Merick

  • Atari ST
  • ***
  • Posts: 113
  • Karma: 7
    • View Profile
Re: Lack of inspiration leads to another shit effect.
« Reply #2 on: August 11, 2007 »
Maybe change it so that the lines look kinda like steel girders, then add a ragdoll stick-figure and have it bounce off them...

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: Lack of inspiration leads to another shit effect.
« Reply #3 on: August 11, 2007 »
@Shocky:
Like it - good start. Possible ideas to improve it :

- make it a tunnel (fly through the grid)
- make it infinitve to the left and right ( now it seems that the second row of lines
are cutted to the left / right
- increase the line width for the lines which are "nearer to the viewer" to improve
3D fx ?
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17426
  • Karma: 499
  • evil/good
    • View Profile
    • My Homepage
Re: Lack of inspiration leads to another shit effect.
« Reply #4 on: August 11, 2007 »
Thanks for the tips :) This code is now in the bin though, I just posted it in case anyone wanted to use it.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline DrewPee

  • I Toast Therefore I am
  • Pentium
  • *****
  • Posts: 563
  • Karma: 25
  • Eat Cheese - It's good for you!
    • View Profile
    • Retro Computer Museum
Re: Lack of inspiration leads to another shit effect.
« Reply #5 on: August 13, 2007 »
Shockwave,
looks the dogs to me . . . I will be looking closely at the code . . . thanks!

Drew
DrewPee
aka Falcon of The Lost Boyz (Amiga)
Ex-Amiga Coder and Graphic Designer
Administrator of > www.retrocomputermuseum.co.uk

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17426
  • Karma: 499
  • evil/good
    • View Profile
    • My Homepage
Re: Lack of inspiration leads to another shit effect.
« Reply #6 on: August 13, 2007 »
It could probably look ok if the lines closest got thicker as Benny suggested but I've stopped on this now :)

looks the dogs to me . . . I will be looking closely at the code . . . thanks!

It just looks bollocks to me mate :)
It reminds me of one of Parabellum's yabasic demos that had a ball infinitely falling through a set of grid lines like that.

Ah yes, Ball chase. that was really nice. Much better than this :D
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Ghost^BHT

  • Clueless and Happy
  • ^GVY
  • Pentium
  • ******
  • Posts: 931
  • Karma: 49
  • BYTE ME!
    • View Profile
Re: Lack of inspiration leads to another shit effect.
« Reply #7 on: August 18, 2007 »
ok  I will first apologize for being drunk and incoherebt .... i can see this infinit grid thing morphing from a 3d starfield then  zooming twords the z point as well as rotating through  th x and y and finally morphing to the starfield again  only this time parallax starfield while a scroller becomes sinus or 3d sinus depemding on mode plus the usual cubic dissoreder ont he upper and lower bounds with logo would be  akiller intro/crcktro ... well if i cud code as well as i drink it would be killer anyways
 dont hit me

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17426
  • Karma: 499
  • evil/good
    • View Profile
    • My Homepage
Re: Lack of inspiration leads to another shit effect.
« Reply #8 on: August 18, 2007 »
K++
Shockwave ^ Codigos
Challenge Trophies Won:

Offline stormbringer

  • Time moves by fast, no second chance
  • Amiga 1200
  • ****
  • Posts: 453
  • Karma: 73
    • View Profile
    • www.retro-remakes.net
Re: Lack of inspiration leads to another shit effect.
« Reply #9 on: August 18, 2007 »
add a C64-like writer with some cool C64 charset, a chip-tune and you should end up with a nice cracktro IMO

Best,

Stormbringer
We once had a passion
It all seemed so right
So young and so eager
No end in sight
But now we are prisoners
In our own hearts
Nothing seems real
It's all torn apart