Class: Camera

Carrot.Camera(game)

Carrot.Camera

Constructor

new Camera(game)

The camera presents the game to the player. It is managed automatically by Carrot.Game.
Parameters:
Name Type Description
game Carrot.Game The core game object.
Source:

Methods

follow(target)

Let the camera follow a sprite.
Parameters:
Name Type Description
target Carrot.Sprite The sprite the camera shall follow.
Source:

setBoundsToGame()

Sets the size (bounds) of the camera to the size of the game container.
Source:

setBoundsToWorld()

Sets the size (bounds) of the camera to size of the game world.
Source:

unfollow()

Let the camera stop following any entity.
Source: