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 maguire123

We're creating a game with this incredible framework but we seem to be having a slight problem with the background. We're intending to create a moving background ( 2 to be precise, parallax) but without tileset (it's a big image - 2400 px x 1800) so we aren't using the layers. It's kinda like "Jetpack Joyride" where the character only moves top and bot and only the background ( plus the collision layer) actually move.

Any suggestions?

1 decade ago by mimik

Yeah i ended up removing my awesome parallax for Springa http://springa-app.com

You could try to use the draw function a position the images manually via a variable in the update loop, don't know about performance hit on that?

Something like this:


draw: function() {
var x = ig.system.width / 2,
y = ig.system.height / 2;
this.background1.draw(0, 0);
this.background3.draw(this.posX2 + x - 200, 0);
this.background2.draw(this.posX + x - 200, 0);

this.parent();

// regular draw code here

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