Hello,
I started to test a lot the new alpha “events functions”, and i’m quite enthousiast with it. I already use a lot of tiny functions to avoid copy/paste of lot of events. This features is really awesome !
I started this topic because i’m facing an issuie didn’t succeed to solve. I’ve written a function to make a progressive color change on sprite, using global color effect. To compare to well known animation, it’s a bit like JQuery animate background-color effect.
Everything (or almost) works well, you can set the desired colors as functions parameters, and the speed of the animation. If i trigger the action at scene beginning for each object i want to animate, it works without troubles.
Things become “touchy” if i manually trigger the action on multiple objects in a short laps of time : for example on “mouse release”, if i click one by one all the sprites objects, the animation will work fine on the first object, but all other animation triggered on other objects while the animation of the first one is playing will turn the sprite on black, wich is not the desired color…
i can’t figure out what make this… It’s supposed to work, it’s pretty simple… It’s like if some events or subevents of the action event function don’t execute while they should.
I attach an example, composed of two scenes :
- on the first scene, to reproduce the problem, just click fast on all Gdevelop logo, you’ll see 2nd logo clicked and next turning black. On contrary, it you take your time, and wait for an animation to finish, then click another one, it will will work.
- On the second scene, i just trigger random color/speed on all objects on “For Each” at the scene beginning, and surprise, it works fine…
A little “debugger” is included : on mouse over on the logo, you’ll be able to check the value of the objects variables used by the function.
KinkCF-troubles.zip (43.2 KB)
Help appreciated, i plan to release a little “library” of event function for animation purpose in the future.