Lesson 3.6.6 - Strange behavior

I’m playing with the hawk and sparrow app and the behavior is strange.

  • If I click on a bird, then move my mouse off the app, then click on a bird again, it always works.
  • If I click on the same bird over and over, without taking my mouse off the app, it always works.
  • If I click on both birds, without taking my mouse off the app, the mouseover function for the wrong bird is called frequently.
    Is these just a quirky deal of some kind, or am I missing someting?
  • Carol

Hi @carol.ramsey,

Can you clarify but what you mean when you say “it always works”?

If the app behaves the way you describe, that’s definitely strange since it looks like clicking shouldn’t even matter - just mousing over should cause the birds to move to a somewhat random position, according to the code.

One thing to remember is that this code is running slowly so students can follow the highlighted code line by line to see what events are being triggered by certain actions. If you click or move the mouse too fast, that can have unexpected results as the code is trying to “catch up” to your inputs. I’d suggest moving the speed slider all the way to the rabbit to see if the issues you reported are still happening.

In addition to running slow the code uses mouseover instead of click. You don’t need to click it.