Parallax Effect, background not visible

Blitz3D Forums/Blitz3D Programming/Parallax Effect, background not visible

Oh yeah, that works, we have updated the code. I also added an airplane onto the program to show it off even more. You have the clouds in the foreground, then I added the ground below in the background, and then the plane is the object that you can rotate around, and it looks like you're really flying. It's an awesome combination of code, here's what it looks like. Now all I need is for the plane to shoot pellets, and to make some enemy planes that come into view. Does a game like that sound familiar to you? Here's the code:

; Sky.bb - This program provides a parallaxed sky for an airplane

Graphics 800,600

; Set the default AutoMidHandle and BackBuffer() properties
AutoMidHandle True
SetBuffer BackBuffer()

; This is the segment with the images for the program

; This is the first part of the background that is closer to the player
backgroundimageclose = LoadImage("sky.png")

; There is also a more distant image in the background
backgroundimagefar = LoadImage("ground.png")

; This is the image segment of the program
; The first steps load the image into the program
planeimage = LoadImage ("plane.png")

; These load the constants in the program
; The following line determines the total amount of rotations
Const rotations = 16

; This will create the array of rotations
Dim imagearray(rotations)

; The following will take that rotation variable and copy that image for rotating to the specific degree amounts
For frame = 0 To rotations - 1
	imagearray(frame) = CopyImage (planeimage)
	RotateImage imagearray(frame), frame*360/rotations
Next

; Begin at the first frame (0) and face north
frame = 0

; Create the variable that tracks the scrolling
scrolly = 0

; This starts the main loop of the program

While Not KeyDown(1)

; Make the screen as clear as possible to start
Cls

; Make both the background tiles properly sped
TileImage backgroundimagefar,0,scrolly
TileImage backgroundimageclose,0,scrolly*2

; Increase the scrolly variable value
scrolly = scrolly + 1

; Return the variable for tracking to the original value if it exceeds the max value
If scrolly >= ImageHeight(backgroundimageclose)
	scrolly = 0
EndIf

; Add some text to the program

Text 0,0, "Press <Left> to turn left, press <Right> to turn right."
Text 0,12, "Press <Esc> to Quit:  "

; IF player chooses to move left, turn the plane to the left
If KeyDown (203)

; Decrease the frame by 1 to rotate the image
	frame = frame - 1

; Once the frame goes lower than 0, reset the maximum value for that array
	If frame <= 0
		frame = rotations - 1
	EndIf

; If player chooses to move right, turn the plane to the right
ElseIf KeyDown (205)

; Increase the value by 1, and turn the plane
	frame = frame + 1
	
; If the frame gets to be higher than the maximum value, return to the original frame
	If frame >= rotations
		frame = 0
	EndIf
EndIf

; Take the present frame, and draw it
DrawImage imagearray(frame), 400,300

Flip

; Standby for a brief delay
Delay 50

Text 0,0, "Press <ESC> to Quit:  "
Wend

; This will conclude the main loop for the program


Looks like it'll be an interesting turn of events. I guess that we'll see some good stuff coming out of this.