Skip to content

Commit

Permalink
Update Dist
Browse files Browse the repository at this point in the history
  • Loading branch information
m-abdulhak committed Dec 1, 2023
1 parent 996b772 commit 46570f5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
18 changes: 12 additions & 6 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -90138,7 +90138,7 @@ var usedSensors = _objectSpread(_objectSpread({}, _common__WEBPACK_IMPORTED_MODU
y: 5
}
}],
sensedTypes: ['pucks']
sensedTypes: ['pucks', 'robots']
}]
}
})
Expand Down Expand Up @@ -90285,11 +90285,12 @@ function controller(robot, params, onLoop, onInit) {
}

return function (sensors) {
var leftPucks = sensors.polygons.left.reading.pucks;
var angularSpeed = leftPucks > 0 ? -CONST.maxAngularSpeed : CONST.maxAngularSpeed;
var pucksDetected = sensors.polygons.left.reading.pucks;
var forwardSpeed = 1;
var angularSpeed = pucksDetected > 0 ? -1 : 1;
return {
linearVel: CONST.maxForwardSpeed * robot.velocityScale,
angularVel: angularSpeed * robot.velocityScale,
linearVel: forwardSpeed * CONST.maxForwardSpeed * robot.velocityScale,
angularVel: angularSpeed * CONST.maxAngularSpeed * robot.velocityScale,
type: robot.SPEED_TYPES.RELATIVE
};
};
Expand Down Expand Up @@ -90397,7 +90398,12 @@ var sensorsRenderables = [{
stroke: 'none'
},
dynamicAttrs: {
fill: 'rgb(0, 0, 255, 0.15)',
fill: {
prop: 'sensors.polygons.left.reading',
modifier: function modifier(val) {
return val.robots ? 'rgba(255,255,0,0.5)' : val.pucks ? 'rgba(255,0,0,0.5)' : 'rgba(200,200,200,0.5)';
}
},
points: {
prop: 'sensors.polygons.left.vertices'
}
Expand Down
2 changes: 1 addition & 1 deletion main.js.map

Large diffs are not rendered by default.

0 comments on commit 46570f5

Please sign in to comment.