Quillraven / Fleks

Fast, lightweight, multi-platform entity component system in Kotlin
MIT License
174 stars 19 forks source link

Be more Kotlin-y and also work with durations. #152

Closed RefuX closed 2 weeks ago

RefuX commented 3 weeks ago

I was going though my code and removing System timing functions and using the kotlin.time functions instead. Though it would be nice for Fleks to support the kotlin.time.Duration value type.

Quillraven commented 3 weeks ago

I don't have a problem with that but please add a test to verify that it behaves the same as the float version.

Also, I think delta time in LibGDX is in milliseconds but you use nanoseconds here? Maybe Kotlin has a built in extension function for the conversion that you are doing?

Anyway, I want to release a new version by end of this week. We can add this feature to the release, if everything is ready.

RefuX commented 2 weeks ago

Never used LibGDX, but I'll take your word for it :)

Updated as requested, let me know if you need anything else, don't want to miss the release train. Choo! Choo! 🚂

Quillraven commented 2 weeks ago

@RefuX: I just checked and the delta time in LibGDX is actually in seconds. It is the time between last and current frame in seconds. I will adjust it in the master later and update the documentation of the methods to make it clearer.

Quillraven commented 2 weeks ago

@RefuX : I just pushed the change. Please let me know if this is still fine for you.

edit: I broke something. Need to have a look tomorrow, sorry.