From adaa9edc5e5a3c483fe2833b504f6a9dc7fe918d Mon Sep 17 00:00:00 2001 From: Colin McMillen Date: Sun, 15 Dec 2019 23:01:19 -0500 Subject: [PATCH] add some refs on line rasterization GitOrigin-RevId: 728b18264f1414b9bb3d8fb773331b69eca340d4 --- Jumpy.Shared/Player.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Jumpy.Shared/Player.cs b/Jumpy.Shared/Player.cs index c03b8fc..241ea99 100644 --- a/Jumpy.Shared/Player.cs +++ b/Jumpy.Shared/Player.cs @@ -38,6 +38,8 @@ namespace Jumpy { Rectangle oldBbox = new Rectangle(oldPosition.X - spriteWidth, oldPosition.Y - 7, spriteWidth * 2, 26); Rectangle playerBbox = new Rectangle(position.X - spriteWidth, position.Y - 7, spriteWidth * 2, 26); bool standingOnGround = false; + // TODO: implement https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm + // e.g. http://members.chello.at/~easyfilter/bresenham.html foreach (var rect in collisionTargets) { playerBbox = new Rectangle(position.X - spriteWidth, position.Y - 7, spriteWidth * 2, 26);