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 crowbar_of_irony

I am creating a game where it has to fit 1024x768, and when I use a layer for a background image, the file size is around 1.6mb each,

Is there anyway to reduce the file size of levels? Tried playing with the size of tiles, but no luck with that.

1 decade ago by dominic

The level editor is meant to build tiled background maps. Subdividing an image into pixel sized tiles doesn't make much sense.

If you just want to draw a 1024x768 background image, you probably shouldn&039;t create a map at all. Just load an #ig.Image and draw it in your Game&039;s #draw() method.

MyGame = ig.Game.extend({
	clearColor: null, // disable screen clear
	background: new ig.Image( 'media/background.png' ),
	
	// (... )
	
	draw: function() {
		// Draw the background
		this.background.draw( 0, 0 );
		
		// Draw all entities
		this.parent();
	}
});

1 decade ago by crowbar_of_irony

Thanks. How can I go about reducing the size of the collision layer? I'm only using a small portion of it.

1 decade ago by RichardC

Dominic,

What if I have multiple backgrounds to choose from but levels use different ones and sometimes multiple ones for a layered background effect along with using parallax?

Any way to get the background to tile using this method rather than mapping? Seems like this would create better performance.

1 decade ago by Joncom

Quote from RichardC
What if I have multiple backgrounds to choose from but levels use different ones and sometimes multiple ones for a layered background effect along with using parallax?
Dominic's answer was probably not intended to be used in your situation. If you're trying for a parallax effect, then most likely doing so in Weltmeister is the way to go.

Seems like this would create better performance.
Maybe, maybe not. Building your own parallax code to pursue this is up to you. However the performance of the methods that already exist are probably more than sufficient for your needs.

1 decade ago by tungvn261

I guess I would create entities called BackgroundEntity, then we can do whatever on earth we want with it :). If you need a static background then just leave it there, if you need a moving one just add a velocity of update it in every iteration.
Not sure if I get the questions right, sorry for my bad English.

1 decade ago by CVGate

I didn't try this in Impact but you can compress up to 70% percent your PNGs with this tool: http://tinypng.org/
Page 1 of 1
« first « previous next › last »