Home Game Development c++ – Player Camera and Map Scrolling not working as supposed

c++ – Player Camera and Map Scrolling not working as supposed

0
c++ – Player Camera and Map Scrolling not working as supposed

[ad_1]

I’m making a top-down 2D rpg recreation in c++, and I can not seem to wrap my head across the idea of map scrolling.

My digicam system is centered on the participant each time my participant strikes, (cameraPos = playerPos – display attributes/2), and the whole lot else within the recreation is offset by the cameraPos within the render stage.

But then each time my participant strikes, it finally ends up “transferring” twice, as soon as from me urgent the motion key, and the second time from the digicam system worth offsetting each tile within the recreation.

gif to motion with out digicam

gif to motion with digicam

What am I doing unsuitable? Any perception or suggestions is tremendously appreciated, thanks!

[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here