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 adanijel

Hi,
how do I make my view to follow mouse movement?
I have 2 layers - background layer little bigger than canvas size and a layer in front of it which I would like to have fixed position according to a viewer. When I move mouse, background layer follows mouse movement and scrolls while front layer stays fixed on center of the screen. In that way I want make it look like a 3D.
A much simpler version of this: http://www.spacegoo.com/slotMachine/

Thanks,
Danijel

1 decade ago by StuartTresadern

Search the forums for a camera class if you do not have one setup already. For quick results create a simple player entity and move your player entity to match the mouse position override the player draw code so that the player does not get drawn.You can also then use the player entity to do your collision checks / limits.

For your front layer search for HUD examples or the dynamic map plugin I posted either way it should show you how to create a static forground layer.
Page 1 of 1
« first « previous next › last »