From 83214e1766949e50fe2b812458eb3a0097e67dc0 Mon Sep 17 00:00:00 2001 From: dsc Date: Sun, 5 Dec 2010 17:49:12 -0800 Subject: [PATCH] Hooray! Refactor complete! It seems things work! --- src/tanks/config.cjs | 2 +- src/tanks/map/pathmap.cjs | 1 + src/tanks/thing/bullet.cjs | 13 +++++++------ src/tanks/thing/tank.cjs | 6 +++--- tags.html | 2 ++ 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/tanks/config.cjs b/src/tanks/config.cjs index 953ca74..89a2464 100644 --- a/src/tanks/config.cjs +++ b/src/tanks/config.cjs @@ -5,7 +5,7 @@ var Y = require('Y').Y exports.defaults = { ui : { showGridCoords : false, - showCountdown : true + showCountdown : false }, pathing : { overlayAIPaths : false, diff --git a/src/tanks/map/pathmap.cjs b/src/tanks/map/pathmap.cjs index 9b002d9..90bb5ba 100644 --- a/src/tanks/map/pathmap.cjs +++ b/src/tanks/map/pathmap.cjs @@ -3,6 +3,7 @@ var Y = require('Y').Y , Vec = require('ezl/math/vec').Vec , QuadTree = require('ezl/util/tree/quadtree').QuadTree , Bullet = require('tanks/thing/bullet').Bullet +, astar = require('ezl/util/astar') , PathMap = diff --git a/src/tanks/thing/bullet.cjs b/src/tanks/thing/bullet.cjs index 89d2a89..f09acc8 100644 --- a/src/tanks/thing/bullet.cjs +++ b/src/tanks/thing/bullet.cjs @@ -1,10 +1,11 @@ // -*- mode: JavaScript; tab-width: 4; indent-tabs-mode: nil; -*- -var Y = require('Y').Y -, shape = require('ezl/shape') -, Wall = require('tanks/map/wall').Wall -, Thing = require('tanks/thing/thing').Thing -, Line = shape.Line -, Circle = shape.Circle +var Y = require('Y').Y +, shape = require('ezl/shape') +, Wall = require('tanks/map/wall').Wall +, Thing = require('tanks/thing/thing').Thing +, Trajectory = require('tanks/map/trajectory').Trajectory +, Line = shape.Line +, Circle = shape.Circle , Bullet = diff --git a/src/tanks/thing/tank.cjs b/src/tanks/thing/tank.cjs index 8e43118..10e2112 100644 --- a/src/tanks/thing/tank.cjs +++ b/src/tanks/thing/tank.cjs @@ -164,7 +164,7 @@ Thing.subclass('Tank', { if ( !(agents && agents.size()) ) return null; - var manhattan = math.Vec.manhattan + var manhattan = Vec.manhattan , bb = this.boundingBox, mid = this.midpoint ; agents.sort(function(a,b){ @@ -315,7 +315,7 @@ Thing.subclass('Tank', { // VVV We only really need this code if we're going to recalculate before we reach the currentMove // we may need to move closer to start if we occupy multiple grid-squares - // var tosq = pm.vec2Square(to), manhattan = math.Vec.manhattan + // var tosq = pm.vec2Square(to), manhattan = Vec.manhattan // , bb = this.boundingBox // , tl = pm.vec2Square(bb.x1,bb.y1), tr = pm.vec2Square(bb.x2,bb.y1) // , bl = pm.vec2Square(bb.x1,bb.y2), br = pm.vec2Square(bb.x2,bb.y2) @@ -353,7 +353,7 @@ Thing.subclass('Tank', { , y = mid.y + len*sin ; // console.log('getTurretLoc()', 'loc:', loc, 'bbb.(x2,y2):', [bbb.x2,bbb.y2], '(x,y):', [x,y]); - return new math.Vec(x,y); + return new Vec(x,y); }, diff --git a/tags.html b/tags.html index 550439e..66120b7 100644 --- a/tags.html +++ b/tags.html @@ -42,6 +42,8 @@ + + -- 1.7.0.4