Jun-17-2024, 10:42 PM
For the level resetting issue, it does sound like it might be related to how the game state is being managed. Separating the main game loop into its function or class can help keep things organized. Still, you'll want to make sure that the state (like level data and player position) is properly reset when you restart or move to the next level. Double-check how you're loading and initializing level data for the platforms shifting and other elements not behaving correctly. Ensure that all necessary variables are reset and that your level loading logic is correctly placing objects based on that data. As for the player interaction and enemies not shooting, this could be related to event handling or the update logic for those entities. Make sure that the main game loop (or the relevant functions) is correctly calling the update methods for all game objects. Lastly, for the background not scrolling, verify that your background scrolling logic is being called every frame and that it's dependent on the player's position or another relevant factor. Adding detailed logging can help pinpoint where things go wrong if you haven't already.