Hello ! I'm currently making a custom engine in JavaScript (canvas).
I already did sprites, particles, events (touch, keyboard, mouse) and a basic script to render tilemaps (no scrolling yet)
I want to code the scrolling, camera and world system. If I create a game with a world of 30,000 pixels width and 15,000 pixels height, and my camera is in 800x and 800y for exemple; should I:
-Call render and update functions for every element in the world (even if they are outside the canvas)
-Get elements who are in the camera to update and render them.
- Should I do something else ? What is the best thing to do ?
Thanks