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 wrondon

Hi,

I am trying to make a game in which the character needs to be always at the bottom of the screen and the camera focus will never change. Something like this:
http://flockdraw.com/gallery/view/1946093

Is there a way to do this? (including multiple screens)

Thank you,
Rondon

1 decade ago by Joncom

I'm not sure exactly what you're asking, because it's not very clear (even with the picture), but I have a feeling the answer is yes regardless. You can have the camera go or stay wherever you want. You can have the player go or be wherever you want. And you can place the collision layer however you want.

1 decade ago by wrondon

Sorry Joncom. I will try to explain a little better.

I need to place the floor row precisely at the bottom of the screen. (It cant be above or under the bottom of the screen, it needs to be precisely in the bottom of the screen).

That's why I need it:

It would be strange to see something like this:
http://flockdraw.com/gallery/view/1946185

or like this:
http://flockdraw.com/gallery/view/1946186

This would be the perfect world:
http://flockdraw.com/gallery/view/1946093

But I know we have different devices with different screen sizes. So a position X,Y could match the point the I need in one device but not in an another.

I hope I have explained this as best I can. :)

Thank you again.

1 decade ago by Joncom

After your level is loaded, running this once should do the trick:
ig.game.screen.y = ig.game.collisionMap.pxHeight - ig.system.height;

ig.game.screen.y is the camera y-coordinate.
ig.game.collision.pxHeight is the height of the collision map.
ig.system.height is the height of the canvas.

1 decade ago by wrondon

Joncom, thank you very much. I'll try it.

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