From 9cef5e64ddd1ef20369b25cc19b1980084ebaefe Mon Sep 17 00:00:00 2001 From: Andy Belle-Isle Date: Mon, 7 Oct 2019 15:06:24 -0400 Subject: Added image based hitbox detection --- src/world.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/world.cpp') diff --git a/src/world.cpp b/src/world.cpp index 8c15ccc..a3923fa 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -128,11 +128,12 @@ double World::getHeight(double x, double y, double z) int h = 0.0; for (auto b : l.hitbox[wx]) { - if (b) + if (b == true) Y = h; h++; } - return Y; + std::cout << l.drawLayer << "," << wx << "," << Y << std::endl; + return (Y/unitSize); } } return 0; -- cgit v1.2.3