Welcome to pygbag Discussions! #1
Replies: 5 comments 15 replies
-
Pygbag newbie here. Here's a main() that establishes socket connection to a server at localhost, port=2222. |
Beta Was this translation helpful? Give feedback.
-
Sorry, I don't understand what to do with 'example connecting to irc...'. |
Beta Was this translation helpful? Give feedback.
-
I was very happy to find pygbag, although I think I might need to do a lot of refactoring of my PyGame code. Getting rid of yaml, numpy, etc. imports is doable. But I have a main game loop with functions that are occasionally called, which run in their own nested game loops. These self-contained loops, which correspond to different rooms, run several steps until the loop is exited, at which point they pop back up to the main game loop level. Is there a way to insert async-and-await code across my game files which contain these nested game loop functions and still get pygbag to work? Or will I need to extract the logic in these nested game loop functions and put it all on the top game loop level (no nested loops) to get pygbag to work? Thanks! |
Beta Was this translation helpful? Give feedback.
-
Second question, while I'm here :) ... memory management... Are there optimization techniques I should use to avoid the memory error I get when I load a lot of pngs at the start of my game? Perhaps if I load this data right before I need it, and then clear it from memory afterwards using something like "with open()", I will be ok? |
Beta Was this translation helpful? Give feedback.
-
To allow multiple and more clear threads, please use https://github.com/pygame-web/pygbag/discussions/new/choose to create new subjects from now on |
Beta Was this translation helpful? Give feedback.
-
Local rules :
Beta Was this translation helpful? Give feedback.
All reactions