Skip to content
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

A bunch of additions #4

Closed
wants to merge 17 commits into from
Closed

Conversation

russplaysguitar
Copy link

Changes:

  • Separate high score boards
  • Mac compatibility
  • Different wall styles
  • Added sound when firing
  • Added "How to play" menu

@dhatch
Copy link
Owner

dhatch commented Jul 15, 2011

Looks like some really nice additions thanks guys, just checking them out now. Could you just explain why you made the changes in 3e5d24f, e744586 and 94ef21b?

@dhatch
Copy link
Owner

dhatch commented Jul 15, 2011

Also curious, what version of python are you running this in? I'm on OSX and generally run in pygame 1.9.1 with python2.6 but i'm trying to build 1.9.1 for 2.7.2 and am having issues

@russplaysguitar
Copy link
Author

Thanks for checking out the revisions! I built it successfully in Python 2.7.1 + pygame 1.9.1 on Linux. I'll try to get jbttn to comment on those commits you're wondering about. You might be able to get it to build without those commits.

@jbttn
Copy link

jbttn commented Jul 16, 2011

I used python 2.6.1 I believe, whatever comes with 10.6 with the latest stable version of pygame (1.9.1)

94ef21b was an error, 3e5d24f fixes the error russ made and inserts the line I intended to be there. The reason for the changes was that in the original code I was getting some sort of infinite recursion which happened whenever your custom WorkingSingle function was called, increasing pythons maximum recursion limit didn't help at all so I had to figure something else out. Googling around I found this thread on the GroupSingle memory leak problem:

http://groups.google.com/group/pygame-mirror-on-google-groups/browse_thread/thread/941b7faa4fe24677/75f31dc827bbd35e

I took a look at the code the poster provided in the "pygame_memleak2.py" file and applied the same technique on this projects code. Instead of using GroupSingle I used Group and used the empty() call where necessary which you can see in 10da8f7, this fixed the crash issue I was experiencing. It seemed to work on other platforms as well so we just got rid of the WorkingSingle function.

@dhatch
Copy link
Owner

dhatch commented Jul 16, 2011

ok, sounds good; WorkingSingle has seemed to be working fine for me though how did you detect the recursion? I'll have to work on getting pygame installed, I have python 2.7 installed with homebrew but still have 2.6. Trying to build it by hand for 2.7 didn't work at all so I'll just use the installer.

@jbttn
Copy link

jbttn commented Jul 18, 2011

The game crashed with the error whenever trying to play on OSX 10.6.7, it was weird becuase it only happened on this platform but worked with everything else, heres a snip of the error:

Traceback (most recent call last):
File "pyrunner.py", line 1336, in
mainMenu()
File "pyrunner.py", line 1273, in mainMenu
gameInit()
File "pyrunner.py", line 775, in gameInit
effectsGroup = WorkingSingle() #group to store effects in
File "/Library/Python/2.6/site-packages/pygame/sprite.py", line 552, in init
self.add(_sprites)
File "pyrunner.py", line 522, in add
pygame.sprite.Group.add(self,spriteAdd)
File "/Library/Python/2.6/site-packages/pygame/sprite.py", line 365, in add
self.add(_sprite)
File "pyrunner.py", line 522, in add
pygame.sprite.Group.add(self,spriteAdd)
File "/Library/Python/2.6/site-packages/pygame/sprite.py", line 365, in add
self.add(*sprite)

[The pygame.sprite.Group.add() call would then repeat for a long while]

File "pyrunner.py", line 522, in add
pygame.sprite.Group.add(self,spriteAdd)
File "/Library/Python/2.6/site-packages/pygame/sprite.py", line 365, in add
self.add(*sprite)
File "pyrunner.py", line 516, in add
if self.sprites():
File "/Library/Python/2.6/site-packages/pygame/sprite.py", line 314, in sprites
return list(self.spritedict)
RuntimeError: maximum recursion depth exceeded while calling a Python object

@dhatch
Copy link
Owner

dhatch commented Jul 18, 2011

Hm odd used to work fine for me on 10.6. Ok, let me get pygame reinstalled and take a look at this

@dhatch
Copy link
Owner

dhatch commented Jul 18, 2011

Looks like I have to install 1.9.2 on my system unless I can get a build to work, 1.9.1 installer wouldn't work

@dhatch
Copy link
Owner

dhatch commented Jul 18, 2011

Ok I can confirm I'm having the recursion error as well

@dhatch
Copy link
Owner

dhatch commented Jul 18, 2011

Really like the new laser sound though

@dhatch
Copy link
Owner

dhatch commented Jul 18, 2011

I pulled into the 1.2pre branch and removed the block size changes. I also changed your fix for the workingsingle class. See commit f582405 and 882bb4d. Reverted your changes in this area as well.

@dhatch dhatch closed this Jul 18, 2011
@dhatch
Copy link
Owner

dhatch commented Jul 18, 2011

perhaps you guys could check this issue out that needs fixing: #5

@russplaysguitar
Copy link
Author

Thanks for pulling in our changes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants