May-13-2024, 08:37 PM
Quote:Actually, I just want to pass paddle.pos[0] to paddle.move().How about pass spaceship.xpos as the starting position for paddel when you change into the breakout game and paddle.xpos to spaceship.move when transitioning back to space invaders mode.
When you switch back from breakout to space invadors you don't properly initialize space invaders. The code in lines 531 to 540 has to execute each time you start a new space invaders game.
I think your code would be easier to work with if you wrote a function to play space invaders and another to play breakout. Mixing the two as you have makes everything a mess.