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 yarco

Maybe this is a simple question, but i didnt find such attributes in docs.
There are player.pos.x and this.screen.x, i need to stop camera following when meet the end of the map...current i just write down the width directly...
// 800 is the width here
		if (player && player.pos.x > ig.system.width / 2 && player.pos.x < 800 - ig.system.width/2) {
			this.screen.x = player.pos.x - ig.system.width / 2;
			// this.screen.y = player.pos.y - ig.system.height / 2;
		}

I think it is not right...

1 decade ago by dominic

All maps have a .width and .height property. This is the size in tiles - to get the size in pixels, just multiply it with the tilesize:
var maxX = this.collisionMap.width * this.collisionMap.tilesize;

Also see this thread.

1 decade ago by yarco

Oh, thanks. Get it...
Page 1 of 1
« first « previous next › last »