2D DemoFX - Source please

Miscellaneous Forums/General Discussion/2D DemoFX - Source please

hi guys...
i know there is a BB source somewhere around, to generate the twisted and moving copperbar effect... I had it on my old drive but due a hd-crash i lost it and i dont know how the fx is called :( Here a screenshot of the blue/yellow twisted-copperbar-fx i am looking for... the bars are created at runtime. if someone know the source, please post it here! many thanks in advance! i really need the source asap ^^



hm i did that with amos on amiga a while ago ;) but i used colorcycling method ;) sorry, have no source for that.

OOh another Amos programmer. I still miss those times.

I'll like to see that code to!

I used AMOS too, mmmm, liked it alot, bit slow though

Another AMOS user here. If you ever heard of AGADS that was me. I never actually made a game with it, a pattern I'm sticking to with blitz...

I never actually made a game with it, a pattern I'm sticking to with blitz...

I'll sign that one too!! ;)

Well, will you stop talking about AMOS and find the code for va!n

AMOS was fab. Anyway, I was a bit bored so I had a pop at something similar:


Graphics 640,480,0,2
SetBuffer BackBuffer()

starsAnim=CreateImage(1,1,4)
For col=0 To 3
	Color 150+(col*3),150+(col*3),150+(col*3)
	Plot 0,0
	GrabImage starsAnim,0,0,col
Next

Type star
	Field x
	Field y
	Field v
End Type
currentStar.star=Null

For y=0 To GraphicsHeight()-1
	currentStar.star=New star
	currentStar\x=Rand(0,GraphicsWidth()-1)
	currentStar\y=y
	currentStar\v=Rand(1,4)
Next

For y=0 To 31
	If y<16
		col=y
	Else
		col=(31-y)
	EndIf
	
	Color 0,0,col*12
	Line 0,y,1,y
	Line 0,y+64,1,y+64
	
	Color 0,col*12,0
	Line 0,y+32,1,y+32
	Line 0,y+96,1,y+96
Next
copperSlice=CreateImage(1,128)
GrabImage copperSlice,0,0


copperAnim=CreateImage(GraphicsWidth(),64,64)


For yoffset = 0 To 63
	y=0
	ytick=0
	ystretch=15
	For x=0 To GraphicsWidth()-1
		DrawBlock copperSlice,x,(y+yoffset) Mod 64
		ytick=ytick+1
		If ytick>ystretch
			ytick=0
			y=y+1
			If y>63 Then y=0
		EndIf
	Next
	GrabImage copperAnim,0,63,yoffset
Next
FreeImage copperSlice
Cls

;apply perspective to each frame
For frame=0 To 63
	
	lineOut=0
	For lineIn=0 To 63
		If lineIn<32
			For passes=0 To lineIn/10
				CopyRect 0,lineIn,GraphicsWidth(),1,0,LineOut,ImageBuffer(copperAnim,frame)
				lineOut=lineOut+1
			Next	
		Else
			For passes=0 To ((63-lineIn)/10)
				CopyRect 0,lineIn,GraphicsWidth(),1,0,LineOut,ImageBuffer(copperAnim,frame)
				lineOut=lineOut+1
			Next	
		EndIf
	Next

	tempImage=CreateImage (GraphicsWidth(),lineOut-1)
	GrabImage tempImage,0,0
	ResizeImage tempImage,GraphicsWidth(),64
	CopyRect 0,0,GraphicsWidth(),64,0,0,ImageBuffer(tempImage),ImageBuffer(copperAnim,frame)
	FreeImage tempImage
Next

frame=0
While Not KeyHit(1)

	For currentStar=Each star
		DrawBlock starsAnim,currentStar\x,currentStar\y,currentStar\v-1
		currentStar\x=currentStar\x-currentStar\v
		If currentStar\x<0 Then currentStar\x=currentStar\x+GraphicsWidth()
	Next

	DrawBlock copperAnim,0,0,frame
	DrawBlock copperAnim,0,GraphicsHeight()-64,frame
	frame=frame+1 : If frame>63 Then frame=frame-64
	Flip : Cls
Wend



I'm sure you can tweak it to add a bit more of a perspective effect to the edges, but it's better than nothing.

*BUMP* -- Added perspective effect (and stars). Must stop now, before I wind up writing a full demo :D

Did anyone notice which topic number this AMIGA thread has? :)

Did anyone notice which topic number this AMIGA thread has? :)
Heh - kismet! :)

CS_TBL: LOL!

Sledge: Is this for BlitzMax?


Sledge: Is this for BlitzMax?


Nope, BB. The guys in the Max forums can probably help you convert it to Max if that's what you need, though. va!n was asking after a BB routine (wonder who wrote the specific one he had in mind?!) and I haven't had much cause to look at Max myself.

Did anyone notice which topic number this AMIGA thread has? :)
Well spotted ! :o)

68k ;) i love it ;) did lots assembler stuff on this 8 mhz machine... this threadid is cool ;)

ahhh cool thx dudes... i did the same way to realize the fx ;)