Jump to content
Search Community

BennyTuner

Members
  • Posts

    19
  • Joined

  • Last visited

Community Answers

  1. BennyTuner's post in does anyone know how to get the overlap property? was marked as the answer   
    thanks Zach and Point C for your advice
    I did try to refactor the code to be less verbose but you have to offer up the hitTest every time you test it so switch didn't work
    The other thing to remember is that you are testing for the minimum coverage so you must test for the largest values first - if you tested for the smallest percentage first it would always break there - so unless anyone has a better suggestion I came up with this...
    if (this.hitTest(droppables[i], "100%")) { console.log("100"); } else if (this.hitTest(droppables[i], "90%")) { console.log("90"); } else if (this.hitTest(droppables[i], "80%")) { console.log("80"); } else if (this.hitTest(droppables[i], "70%")) { console.log("70"); } else if (this.hitTest(droppables[i], "60%")) { console.log("60"); } else if (this.hitTest(droppables[i], "50%")) { console.log("50"); } else if (this.hitTest(droppables[i], "40%")) { console.log("40"); } else if (this.hitTest(droppables[i], "30%")) { console.log("30"); } else if (this.hitTest(droppables[i], "20%")) { console.log("20"); } else if (this.hitTest(droppables[i], "10%")) { console.log("10"); }  
×
×
  • Create New...