360 Degree Scroller Background Effects

BlitzMax Forums/BlitzMax Programming/360 Degree Scroller Background Effects

I am working on a 2D 360 degree scroller and I have been trying to figure out how to improve the background graphics effects. At the moment, I have a static starmap that scrolls; it look ok but I would really like to do something better. I can improve the backround using tiles but I would still have a static backround.

How can I add some animation to the backgound? For example, Fliaxoid and Xeno Assault II both have good background scenes?

If you have a tilemap for your background, all you have to do it have animated tiles - you draw a different frame from the animated tiles each time you update the screen.

Are there other ways? That seems like a lot of work and I am fairly sure that Flaixoid is not using a tile map? Looks like a a couple of different graphics being overlayed and rotated?

You Could have 3 layers of images

First Draw Detail Textures
Then Two Use Alpha layers to bend with First
Create a motion type to keep information on the layers rotation speed and blending values
and have these updated each cycle

Try having 12 images per layer and rotate them when they leave the screen area so the background seems a little less manufactured

Cos and sin formulars really help making organic backgrounds

What do you mean when yoou say 12 images per layer and the rotate then when leaving the screen. What is my space is 4000 by 4000. Can you give me an example using this size of map?

Thanks


Graphics 1024,768,32,0

Global Glo_X
Global Glo_Y
Global Image=LoadImage("Blend1.png")
Global BG_Layer_List:TList=CreateList()




Type BG_Layer
	Field Frame[120]
	Field X[120]
	Field Y[120]
	Field Blend[120]
	Field Speed[120]
	Field Rot#[120]
	Field Scale#[120]
	
	Function Create:BG_Layer()
		Temp:BG_layer=New BG_Layer
			For times=0 To 119
				Temp.Frame[times]=Times Mod 1
				Temp.x[times]=Rand(1000)
				Temp.y[times]=Rand(1000)
				Temp.rot[times]=Rand(360)
				Temp.Scale[times]=Rand(1/50)
				Temp.Blend[times]=Rand(1,3)
				Temp.Speed[times]=Rand(100/1000)
			Next
		ListAddLast BG_Layer_list,temp
			Return temp
	End Function
	
	Method Draw_Sprites()
	SetAlpha(.1)
	SetBlend(LIGHTBLEND)
		For times=41 To 89
		SetColor(times+100,0,0)
	SetTransform(Rot[times],Scale[times],Scale[times])
	
		DrawImage Image,x[times],y[times],0
		Rot[times]:+Speed[times]
	Next
	
	'SetBlend(SHADEBLEND)
	For times=0 To 40
	'SetColor(0,times+150,0)
	SetTransform(Rot[times],Scale[times],Scale[times])
	
		DrawImage Image,x[times],y[times],0
		Rot[times]:+Speed[times]
	Next
	'SetBlend(ALPHABLEND)
	For times=90 To 119
	'SetColor(0,0,times+100)
	SetTransform(Rot[times],Scale[times],Scale[times])
	
		DrawImage Image,x[times],y[times],0
		Rot[times]:+Speed[times]
	Next


		End Method
	
End Type







BG_COLL:BG_layer=BG_Layer.create()


While Not KeyHit(KEY_ESCAPE)

BG_COLL.Draw_Sprites()


FlushMem;Flip
Cls
Wend 

	


Some Hacked up code when working with particals

You Can add layers like that over you detail back ground just some blending concepts replace blend1.png with a alpha image of you choice maybe 400*400

Smoke and cloud images prolly work best

Ok, I got it working! I couple of questions:

1) I guess I would render my detail tile map before this effect?

2) Would you recommend a different image for every layer?

3) I only seems for work if I specify 32 bit?

4) Why is the SetColor setup to only work with red in the rample code?

Thanks

I just Wacked the code together to give an example
so it it a bit rough

1) yes and no depending on what effect you want
you can use methods like these to add light and shadow effects to different layers on the screen

ie
layer 1 land Detail
layer 2 Shadows (effects layer 1)
layer 3 Building Detail
layer 4 Shadows (effects layer 1,2,3)
layer 5 enviromental effect is clouds smoke light (effects layers 1,2,3,4)

2) you can use as many images as you want per layer it just means you have to control what they do a bit more

3) Yes there is a problem with aphlabanding in 16bit modes

4) remove the comments and play around with the values