Closed graefjk closed 9 months ago
I chose to implement this here instead of in the playfield drawer since drawEntities
executes this.getAllEntities()
every time it is called and this.getAllEntities()
takes longer the more entities there are.
Looks good now. (But I did not run the code myself, so merge at your own risk.)
I cannot merge any pull request as i am not a maintainer of this project
It looks like I don't have the rights to make you a project maintainer. You should ensure that you have at least 1-2 active maintainers with the correct access rights (@neumantm should be able to help with that). If you want me to merge just leave me a thumbs up. (but I may not be available for emergency merges on a short notice)
This change limits the between individual calls of
drawEntities()
. This waydrawEntities()
is not called every time a new Entity is created. This can reduce Lag when multible entities are added to the PlayingField at the same time. The time betweendrawEntities()
calls can be changed with thesetTimeBetweenDraws
method which accepts the time in milliseconds. The time is initially set as 32ms between draw calls, which equates to a maximum of 31.75 Draws/Second. This implements #194.