poo
This commit is contained in:
@@ -6,9 +6,35 @@ canvas.width = canvas.clientWidth;
|
||||
|
||||
let ctx = canvas.getContext("2d");
|
||||
|
||||
|
||||
// function mafunction(){
|
||||
// }
|
||||
|
||||
// let mafunction = function(){}
|
||||
|
||||
// let mafonction = () => {}
|
||||
|
||||
// la taille de nos carres
|
||||
let cote = 5;
|
||||
|
||||
|
||||
|
||||
let changerCote = () => {
|
||||
cote = 10 + Math.random() * 20;
|
||||
console.log("changerCote, cote", cote);
|
||||
}
|
||||
|
||||
let onMouseMove = (event) => {
|
||||
console.log(event);
|
||||
if(event.keyCode == 32){
|
||||
changerCote();
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener("keydown", onMouseMove);
|
||||
|
||||
|
||||
|
||||
// Je crée ma liste (tableau) de point
|
||||
let mespoints = [];
|
||||
// j'utilise une boucle pour créer N points
|
||||
|
||||
Reference in New Issue
Block a user