Skip to content
Snippets Groups Projects
Commit 7bad801f authored by Manuel Herrmann's avatar Manuel Herrmann
Browse files

fixed pathfinding again, once and for all, this time for sure i guess

parent 06d3fa02
No related branches found
No related tags found
No related merge requests found
......@@ -19,7 +19,7 @@ class Game1SignupMethod extends SignupMethod {
}
public function getJSDependencies() {
return ['../../js/jquery-1.11.1.min.js', 'jslib/d3.min.js', 'jslib/priority-queue.min.js', 'jslib/checkLineIntersection.js',
return ['../../js/jquery-1.11.1.min.js', '../../js/jquery-ui.min.js', 'jslib/d3.min.js', 'jslib/priority-queue.min.js', 'jslib/checkLineIntersection.js',
'js/events.js', 'js/achievements.js', 'js/svgUtils.js', 'js/pathFinder.js', 'js/vector.js', 'js/character.js', 'js/camera.js',
'js/environment.js', 'js/game.js'];
}
......
......@@ -137,6 +137,11 @@ Char.prototype.physics = function() {
}
stuckFixer += 0.5;
if (stuckFixer >= 4.0) {
this.setMoveTarget(this.translation[0], this.translation[1]);
return;
}
var nextPosition = (d < g_smallValue) ? this.moveTarget[0] : Vec.add(this.translation, v);
} while (!this.pathFinder.canWalkOn(nextPosition[0], nextPosition[1]));
......
......@@ -4,6 +4,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link href="ui.css" rel="stylesheet"/>
<script src="../../js/jquery-1.11.1.min.js" type="text/javascript"></script>
<script src="../../js/jquery-ui.min.js" type="text/javascript"></script>
<script src="jslib/d3.min.js" type="text/javascript"></script>
<script src="jslib/priority-queue.min.js" type="text/javascript"></script>
<script src="jslib/checkLineIntersection.js" type="text/javascript"></script>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment