New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
initial pyscroll rendering #280
Conversation
Looks great, but when I try testing it out, I get a traceback as soon as it tries to switch to the world state: Traceback (most recent call last):
File "./tuxemon.py", line 60, in <module>
main()
File "/tmp/Tuxemon/tuxemon/core/main.py", line 109, in main
control.main()
File "/tmp/Tuxemon/tuxemon/core/control.py", line 542, in main
self.main_loop()
File "/tmp/Tuxemon/tuxemon/core/control.py", line 592, in main_loop
self.key_events = list(events)
File "/tmp/Tuxemon/tuxemon/core/control.py", line 303, in process_events
game_event = self._send_event(game_event)
File "/tmp/Tuxemon/tuxemon/core/control.py", line 323, in _send_event
game_event = state.process_event(game_event)
File "/tmp/Tuxemon/tuxemon/core/components/menu/menu.py", line 411, in process_event
self.on_menu_selection(self.get_selected_item())
File "/tmp/Tuxemon/tuxemon/core/states/persistance/load_menu.py", line 44, in on_menu_selection
self.game.push_state("WorldState")
File "/tmp/Tuxemon/tuxemon/core/state.py", line 405, in push_state
instance.startup(**kwargs)
File "/tmp/Tuxemon/tuxemon/core/states/world/worldstate.py", line 104, in startup
self.change_map(map_name)
File "/tmp/Tuxemon/tuxemon/core/states/world/worldstate.py", line 669, in change_map
map_data = self.load_map(map_name)
File "/tmp/Tuxemon/tuxemon/core/states/world/worldstate.py", line 704, in load_map
map_data["data"] = map.Map(map_name)
File "/tmp/Tuxemon/tuxemon/core/components/map.py", line 88, in __init__
self.load(filename)
File "/tmp/Tuxemon/tuxemon/core/components/map.py", line 168, in load
self.initialize_renderer()
File "/tmp/Tuxemon/tuxemon/core/components/map.py", line 202, in initialize_renderer
visual_data.convert_surfaces(self.renderer._buffer, True)
AttributeError: 'TiledMapData' object has no attribute 'convert_surfaces' |
Pyscroll needs to be up-to-date. Should be version 2.16.12 |
Thanks for the detailed reports! Fixed screen clearing by modifying pyscroll. I implemented a couple features just for Tuxemon, so I don't see a problem with a workaround in pyscroll to accommodate Tuxemon. Technically, it is an issue what should be solved in Tuxemon, in the future sometime. |
Pyscroll will need to be updated to fix the screen clearing bug. Its on pip. |
Did some testing and everything else looks good! We'll need to open another GitHub issue to make sure we later address the animations playing over the player. Other than that, I don't see any other regressions switching over to Pyscroll. Thanks @bitcraft ! |
Just a minor note, the bug that causes the "M" sign to stop moving when the player moves under it has been fixed in pyscroll. Needs version 2.16.14 |
@bitcraft That's great to hear! Although I'm afraid the fix only introduces a crash for me; I updated my clone of Pyscroll Git, and now when I exit the house and go outside Tuxemon closes down upon map load. Here is the console crash log:
|
you will need to update pytmx as well. i used a rarely-tested pytmx feature, which is buggy. new pytmx will fix it. |
Oh... my bad. That fixed the crash, and I can confirm the scrolling sign works perfectly when standing behind it now. |
Using pyscroll for map rendering. Improvements include much faster map loading (still room for improvement...), and more synchronized map animations (water tiles). There is one bug in the pyscroll library affecting Tuxemon that we may wait to be fixed, or just wait. Map animations that cover sprites will not be animated. For example, the moving "M" sign will not animate if the player is behind it.
Also, there is some linting done for pep8 and docstrings added. Some sections of code have been commented out to hold them as a reference for a while until any/all visual bugs are worked out.