Python Forum
[PyGame] adding mouse control to game
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyGame] adding mouse control to game
#5
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.
Reply


Messages In This Thread
adding mouse control to game - by flash77 - Apr-06-2024, 06:39 PM
RE: adding mouse control to game - by deanhystad - Apr-06-2024, 09:24 PM
RE: adding mouse control to game - by flash77 - Apr-08-2024, 06:52 PM
RE: adding mouse control to game - by flash77 - May-13-2024, 07:03 PM
RE: adding mouse control to game - by deanhystad - May-13-2024, 08:37 PM
RE: adding mouse control to game - by flash77 - May-14-2024, 04:51 PM
RE: adding mouse control to game - by flash77 - May-20-2024, 08:29 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Adding an inventory and a combat system to a text based adventure game detkitten 2 7,064 Dec-17-2019, 03:40 AM
Last Post: detkitten
  Adding persistent multiple levels to game michael1789 2 2,504 Nov-16-2019, 01:15 AM
Last Post: michael1789
  Adding a single player mode to my wxOthello game keames 29 12,469 May-01-2019, 02:56 AM
Last Post: SheeppOSU

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020