Help Needed With A Scrolling Sky Background

Hi all,

I was wondering if anyone could help me with a problem I've been having.

https://www.dropbox.com/s/fo5wzgqyz27ejwh/Lift Off.png

This is an image of the game to give you a better idea, I have it so that currently the background scrolls downwards so it appears the ship is moving. The scene is three screens high with this image being the middle of the three. The other two background images above and below are of equal size but plain blue. The background with the cityscape so to speak scrolls downwards out of view, changing into a plain blue background once it loops (I have wrapped the Y axis) after reaching the marker of 2440 pixels. I want to create the appearance of the sky gradually getting darker over time. This I was planning to do simply by replacing out the background images using one of the three background to introduce an image that would feature a gradient to describe the darkening sky and the other two backgrounds would then switch to this new darker shade, the backgrounds ever darkening in their colours of blue till we reach what is the blackness of space.

I've attempted to do this with an integer attribute that counts the number of cycles by counting the number of times the central background actors reaches the point of 2440 pixels in its cycle (I have experimented with other points), it then adds plus one to this attribute. I then assign a rule to each background dictating that when the attribute Loop = 3 for example to change the image to the new background image with a gradient allowing for the background to get darker. Unfortunately it seems that one background is changing before it has gone off screen to the new shade so I end up with a flash of darker colour before the linking background has had time to scroll into view. I have tried using timers to offset the cycle but I haven't quite achieved what I'm after as the linking background (the background that shares both shades) switches to block colour from the gradient image before it has left the screen. I have set the gradient image to be the top background image, the central (initial background) and bottom have been set to be the block colours.

While the artwork is just placeholder and there is no planned deeper player interaction with that initial city scape background it is however quite integral to the concept of the game so I can't just do without it. As it does seem with the method I'm using that that initial background is the one causing the problems as it could otherwise just be two plain backgrounds that I have to deal with.

My skills are in Art and I have to say the programming aspects of game salad are often beyond me, any help would be greatly appreciated. If you need any further clarification on any aspects of my problem, I understand my explanation may not be the clearest and would be more than happy to expand on the issues I'm having.

Thank you for you help guys and girls.

  • OF

Comments

Sign In or Register to comment.