views:

83

answers:

1

I was wondering how exactly cameras are programmed in a 2D platform game. How is it programmed only to render whats in the view of the camera without rendering the whole map? Also, whats the proper way to do this?

A: 

There is no secret about that, you can simple check which tiles and which sprites are inside the rectangle that defines the screen and only draw those.

Another trick is to make the cameras always follows the player, but when it gets to the corner of the scenario you stop moving the camera, so you do not show the scenario borders.

bcsanches