Dark Bit Factory & Gravity
GENERAL => Challenges & Competitions => Topic started 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 :)
#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$<>""
-
8) Nice going :) you managed to cram a lot of stuff into that one, particularly like the range of colors on the screen
-
It's really cool what can be done in 20 lines :)
-
Really cool 8)
-
Heh,. keftales ;)
I like very much the colors.
-
Cheers Optimus :)
-
...
...
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 ?
-
unbelievable ... 20 lines. it's looking very nice! k++ for the source :)
-
Sorry Benny, it's old code!
That variable doesn't seem to do anything.. I've just forgotten to take it out :)
-
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
-
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).
-
What is a keftale anyway? I googled and just found an old Kefren's demo :)
-
What is a keftale anyway? I googled and just found an old Kefren's demo :)
This.