Skip to content

Commit

Permalink
Improve flipper visualisation
Browse files Browse the repository at this point in the history
  • Loading branch information
Finchiedev committed Jul 4, 2019
1 parent fb1512c commit ffbdb50
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions App/JS/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,15 @@ function lineToAngle(ctx, x1, y1, length, angle, colour) {
}

function drawFlipperLines(ctx) {
context.beginPath()
context.font = '30px sans-serif'
context.fillText('Up', 0, 175)
context.fillText('Down', 250, 175)
context.closePath()
lineToAngle(ctx, 100, 100, 50, 180 * (lastVals[6]/100) + 90, 'Green')
lineToAngle(ctx, 200, 100, 50, -180 * (lastVals[8]/100) + 90, 'Green')
lineToAngle(ctx, 100, 200, 50, 180 * (lastVals[5]/100) + 90, 'Red')
lineToAngle(ctx, 200, 200, 50, -180 * (lastVals[7]/100) + 90, 'Red')
lineToAngle(ctx, 100, 250, 50, 180 * (lastVals[5]/100) + 90, 'Red')
lineToAngle(ctx, 200, 250, 50, -180 * (lastVals[7]/100) + 90, 'Red')
}

var flipperCanvas = document.getElementById('flippers')
Expand Down

0 comments on commit ffbdb50

Please sign in to comment.