PR formatting review
This commit is contained in:
parent
d8b8c0f3fc
commit
ce8d7042c6
2 changed files with 15 additions and 19 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue