[Solved] Text appear and move up while fading [closed]


My first piece of advice would be to open up the main.js cookie clicker file and poke around in there. Find the Game.ClickCookie method and find where he updates particles.

He uses a click event to create the particle. Every tick of game time (done using setTimeout) he updates any particles. In this case, he slides it up a little bit and decreases the transparency until it’s invisible.

Depending on your situation, to get the mouse coordinates you could track the mouse coordinates at all times using a mousemove event (example in the cookie clicker code), or you can use the clientx and clienty attributes on the event parameter of your click handler.

myelement.onclick = function(event){
  var mousex = event.clientX;
  var mousey = event.clientY;
}

solved Text appear and move up while fading [closed]