Basic 2D Wavey Sea?

Blitz3D Forums/Blitz3D Beginners Area/Basic 2D Wavey Sea?

Hotshot2005(Posted 2008) [#1]
I seem forgot how to do them...using Cos or sin for rect commands to make 2D Wavey Sea.

could anyone tell me how to do it please?


DheDarkhCustard(Posted 2008) [#2]
you mean a wavey sea like side on or bird's eye view?

you could always use an animation for it rather than program it. I've never needed to make water so i dont know.


Santiworld(Posted 2008) [#3]
ups, i read 3d waves, sorry


Hotshot2005(Posted 2008) [#4]
Side on - you all seen the Worm game that show wavey sea and I would like to know how do that


Stevie G(Posted 2008) [#5]
Worms is done using several animated images.

Using rects is ugly and slow as you can see from this quick example ...

Graphics 640,480,32,1

Global WATERloop = 0
Global WATERheight = 10
Const WATERstep = 2

While Not KeyDown(1)

	SetBuffer BackBuffer()
	Cls
	Color 50,50,250
	For x = 0 To 639-WATERstep Step WATERstep
		y = 240 + WATERheight * Sin( WATERloop ) * Sin( 5.0 * x )
		Rect x, y, WATERstep, 400,1
	Next
	WATERloop = ( WATERloop + 10 ) Mod 360
	
	Flip
	
Wend



Hotshot2005(Posted 2008) [#6]
thank you very much Stevie G :)


mtnhome3d(Posted 2008) [#7]

found in the archives.
http://www.blitzbasic.com/codearcs/codearcs.php?code=292