|
|
|
@ -121,8 +121,8 @@ class Object{ |
|
|
|
|
Move({0,move.y}); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
if (move.x>0) { |
|
|
|
|
|
|
|
|
|
if (move.x!=0) { |
|
|
|
|
for (int i=0;i<wiggleRoom;i++) { //Search Up.
|
|
|
|
|
if (!Collision({originPos.x+move.x,originPos.y-i})) { |
|
|
|
|
//There is potentially to move up-right here, so we will do so.
|
|
|
|
@ -152,7 +152,7 @@ class Object{ |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (move.y>0) { |
|
|
|
|
if (move.y!=0) { |
|
|
|
|
for (int i=0;i<wiggleRoom;i++) { //Search Left.
|
|
|
|
|
if (!Collision({originPos.x-i,originPos.y+move.y})) { |
|
|
|
|
//There is potentially to move down-left here, so we will do so.
|
|
|
|
@ -167,22 +167,6 @@ class Object{ |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else |
|
|
|
|
if (move.y<0) { |
|
|
|
|
for (int i=0;i<wiggleRoom;i++) { //Search Left.
|
|
|
|
|
if (!Collision({originPos.x-i,originPos.y+move.y})) { |
|
|
|
|
//There is potentially to move up-left here, so we will do so.
|
|
|
|
|
Move({-1,0}); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
for (int i=0;i<wiggleRoom;i++) { //Search Right.
|
|
|
|
|
if (!Collision({originPos.x+i,originPos.y+move.y})) { |
|
|
|
|
//There is potentially to move up-right here, so we will do so.
|
|
|
|
|
Move({1,0}); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|