Dark Bit Factory & Gravity

GENERAL => Challenges & Competitions => Topic started by: Shockwave on June 11, 2006

Title: Short Intro Challenge Keftales.
Post by: Shockwave on June 11, 2006
I had a line to spare so I added windowed mode so I could display the credits in the title bar :p

This effect is using the classic Keftales formula, I've added some attractive copper stlye colours, animated the colours, moved them around and done a real time zoom on it too.

Hope you like it :)

Code: [Select]
#DEFINE PTC_WIN
 #Include Once "tinyptc.bi"
 If( ptc_open( "DBF ZOOMING AND MOVING KEFTALES BY SHOCKWAVE^DBF *IN 20 LINES* ESC EXIT", 640, 480 ) = 0 ) Then End
 dim shared buffer(640*480) as integer
 dim shared as double zf
 dim shared as integer mvx,mvy,gadd,gadd2,x,y
 do             
    gadd=gadd+3
    gadd2=gadd2+20
    zf=.011+(.01*sin(gadd/191))
    mvx=499*sin(gadd/153)
    mvy=499*cos(gadd/131)
    for y=0 to 479       
    for x=0 to 640
        pwr=120+119*sin((((x+mvx)*(y+mvy))+gadd2) * zf)         
        buffer(x+(y*640))=rgb(pwr,pwr*y shr 9, pwr * y *culp)
    next
    next
 ptc_update@buffer(0)
 loop until inkey$<>""
Title: Re: Short Intro Challenge Keftales.
Post by: Tetra on June 11, 2006
 8) Nice going :) you managed to cram a lot of stuff into that one, particularly like the range of colors on the screen
Title: Re: Short Intro Challenge Keftales.
Post by: Shockwave on June 11, 2006
It's really cool what can be done in 20 lines :)
Title: Re: Short Intro Challenge Keftales.
Post by: Rbz on June 11, 2006
Really cool   8)
Title: Re: Short Intro Challenge Keftales.
Post by: Optimus on June 11, 2006
Heh,. keftales ;)
I like very much the colors.
Title: Re: Short Intro Challenge Keftales.
Post by: Shockwave on June 12, 2006
Cheers Optimus :)
Title: Re: Short Intro Challenge Keftales.
Post by: benny! on October 28, 2011
...
Code: [Select]
...
        buffer(x+(y*640))=rgb(pwr,pwr*y shr 9, pwr * y *culp)
...

Sorry for bringing this topic up, but I currently try to fork code to add some more examples to TinyC5. Since I do not know Freebasic, what is the meaning of the culp multiplier ?
Title: Re: Short Intro Challenge Keftales.
Post by: neriakX on October 28, 2011
unbelievable ... 20 lines. it's looking very nice! k++ for the source :)
Title: Re: Short Intro Challenge Keftales.
Post by: Shockwave on October 29, 2011
Sorry Benny, it's old code!
That variable doesn't seem to do anything.. I've just forgotten to take it out :)
Title: Re: Short Intro Challenge Keftales.
Post by: combatking0 on October 29, 2011
That variable doesn't seem to do anything.. I've just forgotten to take it out :)

I do that all the time - often I'll build something on top of an older program, which itself was recycled, and before I know it I've got lines from a program I made 5 years ago lurking in new code :o
Title: Re: Short Intro Challenge Keftales.
Post by: benny! on October 29, 2011
Sorry Benny, it's old code!
That variable doesn't seem to do anything.. I've just forgotten to take it out :)

Alright, no worries. I just wanted to convert the code to javascript and don't wanted to make a mistake. Hope you don't mind if I use that code (credits are of course give to you).
Title: Re: Short Intro Challenge Keftales.
Post by: Raizor on October 29, 2011
What is a keftale anyway? I googled and just found an old Kefren's demo :)
Title: Re: Short Intro Challenge Keftales.
Post by: relsoft on November 10, 2011
What is a keftale anyway? I googled and just found an old Kefren's demo :)

This.