var dx = this.ppx - this.tx2;
        var dy = this.ppy - this.ty2;
        var d2 = Math.sqrt(dx*dx+dy*dy);

        var dxnorm = dx/d2;
        var dynorm = dy/d2;
        var speed = 0.001;
        this.tx2 += speed * dxnorm;
        this.ty2 += speed * dynorm;

        // compute reward
        var r = -d1; // want to go close to green
        if(d2 < this.BADRAD) {
          // but if we're too close to red that's bad
          r += 2*(d2 - this.BADRAD)/this.BADRAD;
        }
        
        //if(a ==