Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by DaveVoyles

I know, I know, there have been 100 threads in here about scrolling backgrounds. I've looked through each one of them, several times, and even opened the code behind Xtype just to get an idea of how he does it there.

Despite all of this, I can't manage to create a scrolling background. Essentially, I'm creating a side scolling 2D space shooter. As it stands, I have my ship constantly moving from left to right (positive on X) and the screen/camera follow the ship, and the backgrounds are stationary, and created with Weltmeister (love this tool).

Ideally, I'd like to have my backgrounds scrolling from right to left (negative on X), and have my ship only maneuver within the borders of the screen.

Is it possible to have a combination of both? My ship moving AND the background moving? Even if I have a single .png as a background, that's fine!

I've attached a link to the code in my game class. How would you proceed from here? I can draw a static image for a background, but for the life of me I can't get it to scroll.

http://pastebin.com/4ptRYt4W

1 decade ago by Joncom

You want to create a repeating background layer in weltmeister, and you want this layer to continuously pan in one direction?

There's probably a better way to achieve it than this, but maybe you could make your background layer animated, and use image editing software to create the necessary frames.

Example:
/><br />
<br />
<strong>Edit</strong> Check out the effect on <a href= this website. It's not canvas, but the code used to scroll may be translatable to canvas. Who knows...

Page 1 of 1
« first « previous next › last »