gitdefence / game-off-2012

Build networks, destroy bugs
http://www.justinmcgirr.com/gitdefence/master/game/
5 stars 1 forks source link

Mouseover should only be fired once. #29

Closed crazy2be closed 11 years ago

crazy2be commented 11 years ago

We should mirror the definition of mouseover used by the normal DOM. Right now, it fires whenever the mouse is over an element- this behaviour should be called 'mousemove', not 'mouseover'. http://www.quirksmode.org/dom/events/mouseover.html

yeerkkiller1 commented 11 years ago

For now towers can just handle this themselves. If you find you are doing it a lot you can add a component to yourself that will tell you if the mouseover is the first event.

yeerkkiller1 commented 11 years ago

Mouseover should be renamed mousemove, there is no mouseover implemented yet. Whoever needs any mouse events they are going to want to look at inputHandler.js.

All events that it subscribes to are in this.events, it any event in there is subscribed to automatically (to the event of the same name in the, by the screen system).

All the events set variables in the handler, which are then checked and set to -1 in handleMouseEvents. Handle mouse events generates and raises the mouse events to the required engine.

crazy2be commented 11 years ago

Renamed mouseover -> mousemove to make the semantics clearer. It would probably be nice to have a mouseover event, but we can add that later if we want to.