JirkaDellOro / Prima

Repository for the module "Prototyping interactive media-applications and games" at Furtwangen University
https://jirkadelloro.github.io/Prima
10 stars 17 forks source link

Problem with sprite display in animation #70

Open larafra99 opened 1 year ago

larafra99 commented 1 year ago

I noticed that my sprite animation only works smoothly with 5 or 15 fps, any other fps- setting makes my sprite looks like it is played continuous even though it is discrete. Any help would be appreciated.

Link to my app: https://larafra99.github.io/Prima/Runner/index Link to code: https://github.com/larafra99/Prima/tree/main/Runner

I figured out that the15 fps it runs smoothly on is the fps declared in die FUDGE editor, if I change the fps there it runs smoothly on the new declared number, but stops working on 15 fps, if I increase the fps in the code. Why the animation runs on the 5 fps smoothly I am not sure.

JirkaDellOro commented 1 year ago

I think, the problem is a different view on how fps is handled or what it means. The Animation is a resource and the fps is used to construct the animation defining the frames. It is not the playback rate. Actually, it shouldn't be manipulated at runtime, I found a hint in the code for that.

The ComponentAnimator controls the actual playback speed, for each animated node individually. Check the scale property.