Skip to content

Commit

Permalink
Update robotDraw.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Vif15 authored Nov 25, 2024
1 parent 60af385 commit 9032d62
Showing 1 changed file with 35 additions and 21 deletions.
56 changes: 35 additions & 21 deletions javascript/robotDraw.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,42 @@
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");

ctx.lineWidth = 5;
ctx.strokeStyle = "#FFD700";
//tri + arc
ctx.lineWidth = 5;
ctx.strokeStyle = "#FFD700";

ctx.moveTo(500, 500);
ctx.lineTo(800, 500);
ctx.stroke();
ctx.moveTo(500, 500);
ctx.lineTo(800, 500);
ctx.stroke();

ctx.moveTo(800, 500);
ctx.lineTo(650, 241);
ctx.stroke();
ctx.moveTo(800, 500);
ctx.lineTo(650, 241);
ctx.stroke();

ctx.moveTo(650, 241);
ctx.lineTo(500, 500);
ctx.stroke();
ctx.moveTo(650, 241);
ctx.lineTo(500, 500);
ctx.stroke();

ctx.beginPath();
ctx.arc(650, 414, 173, 0, 2 * Math.PI);
ctx.stroke();
ctx.beginPath();
ctx.arc(650, 414, 173, 0, 2 * Math.PI);
ctx.stroke();

var main = document.getElementById("myCanvas");
var render = main.getContext("2d");
main.style.left = "400px";
main.style.top = "25px";
main.style.position = "absolute";
//red wheel

var r = c.getContext("2d");
r.lineWidth = 5;
r.strokeStyle = "#FF0000";

r.moveTo(650, 241);
r.lineTo(700, 241);
r.stroke();




var main = document.getElementById("myCanvas");
var render = main.getContext("2d");
main.style.left = "400px";
main.style.top = "25px";
main.style.position = "absolute";

0 comments on commit 9032d62

Please sign in to comment.