Skip to content

How does the camera work? #11

Answered by VectorSatyr
Feli0TheWriter asked this question in Q&A
Discussion options

You must be logged in to vote

"What's the chain of events that links the camera to the PlayableCharacter [... ?]"

An instance of PlayerCamera is created by the PlayableCharacter in the Create Event:

// other values
camera = instance_create_layer(x, y, "general", PlayerCamera);
camera.owner = id;

User Event 0 of PlayerCamera handles connecting the camera to a view camera, while User Event 1 handles disconnecting it; these are called by game_pc_camera_connect and game_pc_camera_disconnect, respectively.

"[...] what are these look_x_distance and look_y_distance variables? Are they what determines the distance away from sonic?"

They are indeed used that way. For example, in player_is_looking_up, the camera's behavior …

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Feli0TheWriter
Comment options

@VectorSatyr
Comment options

Answer selected by Feli0TheWriter
@Feli0TheWriter
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants