0

In games like agar.io/slither.io/diep.io, the player is only shown a small section of the canvas. When they move, the player stays on the centre of the screen and instead the section of the canvas shown moves.

My question is: how did the developers of these games achieve this?

I thought it might have something to do with zooming in/out on the screen but then figured that can't be the case because you can manually zoom in/out.

Para Wing
  • 1
  • 1
  • pretty sure the whole *canvas* is shown, it's more a case of what part of the games *map* is rendered on the canvas – Jaromanda X Jul 02 '17 at 23:41
  • There's a **very** detailed answer (including a live demo) [**here**](https://stackoverflow.com/a/16926273/2341603). – Obsidian Age Jul 02 '17 at 23:43
  • Ah, thank you very much! @Obsidian Age (sorry I am new to this website, should I edit my post to say solved?) – Para Wing Jul 02 '17 at 23:45
  • @ParaWing -- It's already been marked as a duplicate, so there's no need to take further action. However, StackOverflow expects you to [**try to solve your own problem**](http://meta.stackoverflow.com/questions/261592) before asking for help, and part of doing that is [**searching**](http://stackoverflow.com/search) for similar questions. For further information, please refer to the help article regarding [**how to ask good questions**](http://stackoverflow.com/help/how-to-ask), and take the [**tour of the site**](http://stackoverflow.com/tour) :) – Obsidian Age Jul 02 '17 at 23:51

0 Answers0