From 5aaf6dcad517e5d45d074fe02672a3a46810cecc Mon Sep 17 00:00:00 2001 From: Olougouna Axel Date: Wed, 30 Nov 2022 13:33:31 +0100 Subject: [PATCH] creation du canvas et de quelques fonctions --- canvas.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 canvas.js diff --git a/canvas.js b/canvas.js new file mode 100644 index 0000000..a23c029 --- /dev/null +++ b/canvas.js @@ -0,0 +1,28 @@ +const ctx = canvas.getcontext('canvas'); + +//fonction pour dessiner un cube de bois du jeu +function DrawGameCub(x, y){ + const a = 10; + ctx.fillStyle="brown"; + ctx.fillRect(x, y, a, a); + ctx.save(); +} + +//fonction pour dessiner des cercles du jeu +function Drawcircle(x, y){ + //let context=canvas.getContext("2d"); + ctx.beginPath(); + ctx.lineWidth="2" + ctx.arc(x,y,5, 0, 2*Math.PI); + ctx.fillStyle="grey"; + ctx.stroke(); + ctx.save(); +} + +//fonction pour dessiner un cube du labyrinthe +function DrawLabCub(){ + const a = 10; + ctx.fillStyle="black"; + ctx.fillRect(x, y, a, a); + ctx.save(); +} \ No newline at end of file