Closed DubThink closed 7 years ago
Updated to load images into individuals and use those, rather than have the button load them each time. I performed some time trials on the new stage creation code (all the code inside the if buttonResponse:
statement in Controller.gameLoop() (line 59 currently)
Before: .45s After: .075s
(Note: moved next stage code into controller.nextStage()
profiled time of controller.nextStage(). The 2 functions of note are elf.stageView = stageView.StageView(self.stageModel, 100, 50, DISPLAYSURFACE)
With 72ms +/- 1ms and self.stageView.clearDisplay()
with 0.6ms +/- 0.1ms
I believe the majority of the time spent creating the stageview is generating the cards' buttons. This is probably due to image loading. Perhaps we can load images in to the individuals, and then just use the preloaded images.