Hi,
I would like to be able to select different circle A and B with a createCheckbox()
What I want is when the A is selected then we select the B, the circle A should disappear and the checkbox A must be unchecked
Right now when I check the A then I check the B the A remain checked
What is wrong with my code?
Thank you for your help
Here is the exemple :
var checkbox_a, checkbox_b;
var checkbox_a_go, checkbox_b_go;
function setup() {
createCanvas(400, 400);
checkbox_a = createCheckbox(“A”, false);
checkbox_a.position(20, height + 20);
checkbox_a.changed(aaa);
checkbox_b = createCheckbox(“B”, false);
checkbox_b.position(60, height + 20);
checkbox_b.changed(bbb);
}
aaa = function(){
checkbox_a_go = !checkbox_a_go;
if(this.checked()){
//checkbox_b_go = false;
//checkbox_c_go = false;
}}
bbb = function(){
checkbox_b_go = !checkbox_b_go;
if(this.checked()){
//checkbox_a_go = false;
// checkbox_c_go = false;
}}
function draw() {
background(220);
if(checkbox_a_go === true){
ellipse(50,50,100,100)
}
if(checkbox_b_go === true){
ellipse(200,200,200,200)
}
}