This game is looking it’s shaping up to be really good, good work on the graphics and the levels.
Anyway, the background is a background scene, meaning it can’t be anything but a still image (it can’t move along or react on the peach). I can try adding a simple background, like just black mountains or black trees. I can’t make high detailed mountain backgrounds because a normal computer won’t be able to handle that. The forground is just taking up so much memory already that adding backgrounds like in Mario would kill the framerate. Also, because everything is flat and I can’t make he mountains have a moving effect, it will be hard to see forground from background.
However, high quality parrelax and 3D-looking backgrounds are possible to use with 2D games made in Blender, you probably have your camera in the background scene already, now create, model and texture the meshes or billboards that will make up your background (using an array modifier to repeat it across the length of the level), and make sure it’s a perspective camera.
Give the background camera these properties
BG_Height - float
BG_Distance - float
Then apply this code to the camera in the background scene (in a python controller attached to an always actuator, works in 2.56)
import GameLogic
c=GameLogic.getCurrentController()
ob=c.owner
sceneList=GameLogic.getSceneList()
scene=sceneList[1] #get the scene containing the level
OL=scene.objects
if "Main_Cam" in OL:
reference=OL["Main_Cam"]
Px, Py, Pz = ob.position
Vpx, Vpy, Vpz = reference.position
Px = Vpx
Py = Vpy
Pz = Vpz
Hz = Vpz+ob['BG_Height'] #set the starting height of the background
if "Background_Cam" in OL:
Dx = Vpx+ob['BG_Distance']-60 #get the starting distance from the background
ob.position = (Dx, Vpy, Hz)
If you implement it right you should have a 3D perspective background for your level with automatic parallax, do note that this may take a little while to load after the main scene loads if it’s complex, this can be masked by a simple loading screen that starts in front of the camera and slides out after the FPS goes up when the loading is done.
The cool thing is that since the distance and height is adjustable by changing the properties, you can have the background zoom in and out and go up and down independent of the player’s movement if you wanted to.