|
|
@ -1,6 +1,8 @@ |
|
|
|
using Microsoft.Xna.Framework; |
|
|
|
using System; |
|
|
|
|
|
|
|
// Good background reading, eventually:
|
|
|
|
// https://gamasutra.com/blogs/ItayKeren/20150511/243083/Scroll_Back_The_Theory_and_Practice_of_Cameras_in_SideScrollers.php
|
|
|
|
namespace Jumpy { |
|
|
|
class Camera { |
|
|
|
private Rectangle bbox = new Rectangle(0, 0, 1920 / 6, 1080 / 6); |
|
|
@ -18,7 +20,7 @@ namespace Jumpy { |
|
|
|
if (bbox.Left < 0) { |
|
|
|
bbox.Offset(-bbox.Left, 0); |
|
|
|
} |
|
|
|
Debug.Toast($"p: {player.X} c: {bbox.Center.X}"); |
|
|
|
// Debug.Toast($"p: {player.X} c: {bbox.Center.X}");
|
|
|
|
} |
|
|
|
} |
|
|
|
} |