I’m not sure why the note will not disappear from one if statement to another when we press the letter ‘d’ then ‘r’? Anyone know if it is something with the sprite.visible or the draw function I don’t know? any help would be great. Thank you.
//Instruments
var drums = createSprite(100,200);
drums.setAnimation(“drum_set_1”);
drums.scale = 0.7;
var strings = createSprite(300,275);
strings.setAnimation(“electric_guitar_1”);
strings.scale = 0.7;
//Notes
var note1 = createSprite(50,50);
note1.setAnimation(“eighth_note_1”);
note1.scale = 0.3;
note1.visible = false;
//Loop
function draw(){
if (keyDown(“d”)){
note1.visible = true;
playSound(“sound://category_instrumental/digital_drum_repeating.mp3”);
}
if (keyDown(“r”)){
note1.visible = false;
playSound(“sound://category_instrumental/trumpet.mp3”);
}
drawSprites();
}