Jump to content

Start game with sprite at mouse X,Y?


jhagg
 Share

Recommended Posts

Hi there I'm trying to build a game where flies attack a piece of floating poo. Mature, I know

 

I want the poo body to always be underneath the mouse, and if I start the game with my mouse already moving it will be underneath it, but if I load the page and then put my mouse into the viewport it will move the poo body relative to the cursor. Is there a common pattern for having something follow the mouse exactly?

 

https://jsfiddle.net/obzm5jzf/

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...