B2D wave image.

BlitzPlus Forums/BlitzPlus Programming/B2D wave image.

Well I got it in the end, thanks to Skully for the animimage idea, its one of those why the hell didnt I think of that things...

Here it is. All you need to do is supply an image. it will read it and get the sizes and stuff so you dont need to worry about how big it is.

;Image Wave Test..



Graphics 640,480,16,2
SetBuffer BackBuffer()
Cls


Global image=LoadImage("yavin.bmp")
Global Width,height
width=ImageWidth(image)
height=ImageHeight(image)
FreeImage image
image=LoadAnimImage("yavin.bmp",width,1,1,height-1)



Global wave#,amp#,slice
slice=1
wave=.2
amp=8

;Main
While Not KeyHit(1)
Cls
	update()
	render()
Flip
Wend


Function update()
	wave=wave+6
End Function

Function render()
	For looper=1 To height-2
		DrawImage image,100+Sin(wave+looper)*amp,100+looper,looper
	Next
End Function