That didn't go as well as I'd hoped
This commit is contained in:
@@ -47,12 +47,18 @@ bool LocalCharacter::ProcessCollisionGrid(std::list<BoundingBox> boxList, Uint8*
|
||||
bool ret = false;
|
||||
|
||||
for(auto& box : boxList) {
|
||||
if (box.CheckOverlap(origin + bounds)) {
|
||||
if (box.CheckCollision(origin + bounds)) {
|
||||
//push the character to the closest non-contact position
|
||||
//TODO
|
||||
Vector2 shift = box.CalcShift(origin + bounds);
|
||||
origin += shift;
|
||||
|
||||
//set any motion in that direction to zero
|
||||
//TODO
|
||||
if (shift.x != 0) {
|
||||
newMotion.x = 0;
|
||||
}
|
||||
if (shift.y != 0) {
|
||||
newMotion.y = 0;
|
||||
}
|
||||
ret = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ void LobbyMenu::MouseButtonUp(SDL_MouseButtonEvent const& button) {
|
||||
//has the user selected a server on the list?
|
||||
BoundingBox tmpBox = listBox;
|
||||
tmpBox.h *= serverInfo.size();
|
||||
if (tmpBox.CheckOverlap({button.x, button.y})) {
|
||||
if (tmpBox.CheckCollision({button.x, button.y, 0, 0})) {
|
||||
selection = &serverInfo[(button.y - listBox.y)/listBox.h];
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user