mirror of
https://github.com/raysan5/raylib.git
synced 2026-01-31 03:09:17 -05:00
PR formatting review
This commit is contained in:
@ -54,14 +54,10 @@ int main(void)
|
|||||||
{
|
{
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
if (IsKeyDown(KEY_RIGHT))
|
|
||||||
{
|
// Player movement
|
||||||
player.x += 2; // Player movement
|
if (IsKeyDown(KEY_RIGHT)) player.x += 2;
|
||||||
}
|
else if (IsKeyDown(KEY_LEFT)) player.x -= 2;
|
||||||
else if (IsKeyDown(KEY_LEFT))
|
|
||||||
{
|
|
||||||
player.x -= 2; // Player movement
|
|
||||||
}
|
|
||||||
|
|
||||||
// Camera target follows player
|
// Camera target follows player
|
||||||
camera.target = (Vector2){ player.x + 20, player.y + 20 };
|
camera.target = (Vector2){ player.x + 20, player.y + 20 };
|
||||||
|
|||||||
@ -1259,7 +1259,7 @@ void BeginMode2D(Camera2D camera)
|
|||||||
// 3. Move it by (-offset);
|
// 3. Move it by (-offset);
|
||||||
// Offset defines target transform relative to screen, but since we're effectively "moving" screen (camera)
|
// Offset defines target transform relative to screen, but since we're effectively "moving" screen (camera)
|
||||||
// we need to do it into opposite direction (inverse transform)
|
// we need to do it into opposite direction (inverse transform)
|
||||||
//
|
|
||||||
// Having camera transform in world-space, inverse of it gives the modelview transform.
|
// Having camera transform in world-space, inverse of it gives the modelview transform.
|
||||||
// Since (A*B*C)' = C'*B'*A', the modelview is
|
// Since (A*B*C)' = C'*B'*A', the modelview is
|
||||||
// 1. Move to offset
|
// 1. Move to offset
|
||||||
|
|||||||
Reference in New Issue
Block a user