# Multiplayer camera follow?

**URL:** <https://discourse.processing.org/t/multiplayer-camera-follow/12170>\
**Category:** Coding Questions\
**Created:** [June 18, 2019, 7:48pm UTC](https://discourse.processing.org/t/multiplayer-camera-follow/12170 "2019-06-18T19:48:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pan](https://avatars.discourse-cdn.com/v4/letter/p/b5e925/32.png) [@Pan](https://discourse.processing.org/u/Pan)\
**Post date:** [June 18, 2019, 7:48pm UTC](https://discourse.processing.org/t/multiplayer-camera-follow/12170/1 "2019-06-18T19:48:39Z")

</div>

Does anyone know of any method to make the camera follow several players in the Lemming Ball Z style?  
Thanks you for reading.

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [June 19, 2019, 2:56pm UTC](https://discourse.processing.org/t/multiplayer-camera-follow/12170/2 "2019-06-19T14:56:52Z")

</div>

Do you program this in 2D or 3D ?

---

<div class="post-metadata">

**Author:** ![Pan](https://avatars.discourse-cdn.com/v4/letter/p/b5e925/32.png) [@Pan](https://discourse.processing.org/u/Pan)\
**Post date:** [June 19, 2019, 10:14pm UTC](https://discourse.processing.org/t/multiplayer-camera-follow/12170/3 "2019-06-19T22:14:58Z")

</div>

in 2D, look this [https://www.youtube.com/watch?v=ooC45Tvx3Bk](https://www.youtube.com/watch?v=ooC45Tvx3Bk)

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [June 20, 2019, 8:41am UTC](https://discourse.processing.org/t/multiplayer-camera-follow/12170/4 "2019-06-20T08:41:30Z")

</div>

Continued in his other thread

> [@How can I center an object on my screen that moves?](https://discourse.processing.org/t/how-can-i-center-an-object-on-my-screen-that-moves/12196):
>
> I’m trying to make the screen follow my two spaceships and I’m trying to center the middle of the two ships to my screen The coordinates of the point between the two ships are fx and fy. Here the code: boolean pause; int game = 1, dg; float tx, ty, fx, fy; //PImage pausei; void setup(){ size(900, 600, P2D); Players.add(new Player(100, 600/2-30/2, false, 'g', 'f', false, 1)); Players.add(new Player(800, 600/2-30/2, true, 'm', 'n', true, 2)); //pausei = loadImage("pause.png"); //pausei.re…

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [July 1, 2019, 12:56am UTC](https://discourse.processing.org/t/multiplayer-camera-follow/12170/5 "2019-07-01T00:56:03Z")

</div>

For a demo of a “Lemming Ball Z”-style camera, see mode 2 TRACK\_ZOOM in this example sketch:

> [@How can I center an object on my screen that moves?](https://discourse.processing.org/t/how-can-i-center-an-object-on-my-screen-that-moves/12196/4):
>
> Understanding the relationship between translate, scale, and the idea of a 2D “camera” can sometimes be a bit tricky. It is worth reviewing the coordinate system and 2D transformations tutorials: [https://processing.org/tutorials/drawing/](https://processing.org/tutorials/drawing/)[https://processing.org/tutorials/transform2d/](https://processing.org/tutorials/transform2d/) However, in the end, there are three key transformations: translate to the center of the screen optionally scale the view, e.g. based on player speed or inter-player distance translate again to recenter the came…
