Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Wall Detection #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/scripts/core/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export class Utils
{
tSecondCorner = firstCorners[tI + 1];
}
if (Utils.linePolygonIntersect(tFirstCorner.x, tFirstCorner.y,tSecondCorner.x, tSecondCorner.y, secondCorners))
if (Utils.linePolygonIntersect(new Vector2(tFirstCorner.x, tFirstCorner.y), new Vector2(tSecondCorner.x, tSecondCorner.y), secondCorners))
{
return true;
}
Expand Down Expand Up @@ -305,7 +305,8 @@ export class Utils
tSecondCorner = corners[tI + 1];
}

if (Utils.lineLineIntersect(start, point, tFirstCorner.x, tFirstCorner.y, tSecondCorner.x, tSecondCorner.y))
if (Utils.lineLineIntersect(start, point,
new Vector2(tFirstCorner.x, tFirstCorner.y), new Vector2(tSecondCorner.x, tSecondCorner.y)))
{
tIntersects++;
}
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/items/floor_item.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ export class FloorItem extends Item
{
//We do not want to check if the object is in room or not
//It is upto the user to place it anywhere he/she wants however
// return false;
return true;
return false;
// return true;
}

// check if we are outside all other objects
Expand Down