I am trying to create a game using livewires in which there are multiple levels. In each level, the screen will need to be a different size, so either I can create a new screen, or I can resize it. When I tried a new screen, like this (mcve):
from livewires import games
games.init(screen_width = 500, screen_height=100, fps = 50)
#dosomething
games.screen.quit()
games.init(screen_width = 100, screen_height=500, fps = 50)
games.screen.mainloop()
I get the error:
Traceback (most recent call last):
File "C:\Users\Fred\Desktop\game\main.py", line 6, in <module>
games.screen.mainloop()
File "C:\Users\Fred\Desktop\game\livewires\games.py", line 308, in mainloop
object._tick()
File "C:\Users\Fred\Desktop\game\livewires\games.py", line 503, in _tick
self.tick()
File "C:\Users\Fred\Desktop\game\livewires\games.py", line 776, in tick
self._after_death()
File "C:\Users\Fred\Desktop\game\main.py", line 5, in <module>
games.init(screen_width = 100, screen_height=500, fps = 50)
File "C:\Users\Fred\Desktop\game\livewires\games.py", line 884, in init
screen = Screen(screen_width, screen_height, fps)
File "C:\Users\Fred\Desktop\game\livewires\games.py", line 159, in __init__
raise GamesError("Cannot have more than on Screen object")
livewires.games.GamesError: Cannot have more than on Screen object
games.screen.width
and height
cannot be set (you can only get them), so I cannot do it like that, and when I change add line in livewires.games to reset the screen count to 0, I get an error in pygame instead.
Does anyone know of a way to resize, or else destroy and recreate the screen in livewires?
Note: I'm using Michael Dawsons edited version. Download for pygame and livewires used.