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 Xaan

Hi,
I'm pretty new to Impact and I want, as an exercise to get more familiar with Impact, to make it so that the screen moves with the player until the edge of the level itself is in sight, and then the "camera" would stop moving, and instead the player would move until it collides with the edge of the screen.

I've done it before with just straight-up canvas, but I'm just not so familiar with Impact where things are a little bit more structures. I guess what I need the most is to get the position of the player in comparison to the level itself. How would you suggest to do that? I'm not even sure where to get the width and height of the level itself from?

Thanks,
Xaan

1 decade ago by monkeyArms

I use a modified version of Dominic's camera class (the one he used in BioLab Disaster).

I had to tweak it quite a bit for my needs, but it works very well:

http://impactjs.com/forums/help/screen-scrolling#post1978

1 decade ago by Xaan

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