1

I am counting click time on circles.When this count was equal 3,then alert function show message with this content "You must avoid clicking" but when click on environment of circle this too counting. I want avoid counting from environment clicking.I want counting for clicking on circles. How Can I do this?

This is link of question and source code: fiddle

<div id="ways" style="width:1000px;margin:0 auto;height:100%;">
    <canvas id="canvas" width="1000" height="1000"></canvas>
</div>
Ghost
  • 85
  • 2
  • 9

1 Answers1

1

I'm not clear on what you're asking, but you could move turnclicking++ inside your isPointInPath test so that turnclicking would increase only when the user clicks inside a circle.

markE
  • 102,905
  • 11
  • 164
  • 176
  • Yes, removing `turnclicking++` from where it is and putting it inside your `isPointInPath` will change `turnclicking` only when a circle is clicked and not when the user clicks outside a circle ;-) – markE Mar 04 '15 at 17:56