//Multiple toggle effects and mouse click events 
//so game could be buggy
//Buggy on Brave Browser, use Chrome

//***********Sword Object - Mouse Button Up Event************//
if ($this.isTouching(ninja)) { 
    $this.remove(); // remove the original sword 
    star.toggleDraggable(); // make the star draggable 
    swordIcon.toggleVisible(); // makes the sword icon visible 
} else { 
    // otherwise, return sword to pile. 
    $this.x(672); $this.y(314); 
}

//********Star Object - Mouse Button Up Event***************//
if ($this.isTouching(ninja)) { 
    $this.remove(); // remove the original star 
    staff.toggleDraggable(); // make the star draggable 
    starIcon.toggleVisible(); // make the star icon visible 
} else { 
    // otherwise, return the star to the pile 
    $this.x(492); $this.y(372); 
}

//**********Staff Object - Mouse Button Up Event************//
if ($this.isTouching(ninja)) { 
    $this.remove(); // remove the original staff 
    staff.toggleDraggable(); // make the staff dragable 
    staffIcon.toggleVisible(); // makes the staff icon visible 
} else { 
    // otherwise, return the staff to the pile 
    $this.x(650); $this.y(346); 
}