🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

How to implement Enter the Gungeon camera

Started by
1 comment, last by fleabay 2 years, 3 months ago

I'm making a top-down 2D game. I want the camera to follow the player, but I also want it to move slightly in the direction of the cursor, just the same as in Enter the Gungeon.

At first it seemed easy, just take the vector from the player to the cursor, multiply it by something like 0.2 and place the camera in there. But after testing, it looked really weird. Trying to make it better I multiplyed the the vector by it's own magnitude to make it smooth it when the mouse is close to the character. I was better but still weird when the cursor if far from the player.

Right now I really don't know how to make it feel better, I actually opened enter the gungeon and made a couple of measurement with a ruler over the screen.

distance from center of the screen to cursor — distance from center of the screen to character — percentage along the vector. (not very accurate)

4cm — 0cm — 0%

5cm — 0.2cm — 4%

10cm — 1cm — 10%

18cm — 3.5cm — 19%

26cm — 5.3cm — 20%

I would be great if someone could give me some ideas on how to get closer to this results

Advertisement

Ignore that it says Side Scroller. It has useful techniques/ideas for lots of different game types.

🙂🙂🙂🙂🙂<←The tone posse, ready for action.

This topic is closed to new replies.

Advertisement