Re: [pygame] Shining Sea source code
My entry for pyweek was similar in idea to your missions game, but everyone hated the grating marching sound effect... I suppose the base stuff is also more sim* than civilization as well though. We also failed in that you never got a report of what happened on the mission, you just see how many of the team members come back (if at all!). But I've wanted games around this mechanic for a while. You can check it out here: http://media.pyweek.org/dl/4/cent_of_fb/cent_of_fb_0.99.zip It's very alpha and needs some work to be a real game :( A week limit and all... As for shining sea, it's a nice little demo! The music is fun, but looks like it's been stolen :) The island is a bit big and empty, and the objects are not sorted correctly. You need to sort the onscreen objects based on y-value so that when the character is in front or behind something it displays right. I like where your going with this though, I like any game that requires eating, ha ha. Also, as far as I can tell without looking at code, you are generating the tilemap from the minimap, which is very cool.
Re: [pygame] 'Shining Sea' source code
On Wed, May 30, 2007 at 10:02:34PM -, [EMAIL PROTECTED] wrote: The game starts, but I cannot control anything. I believe you mentioned W, A, S, D keys? Nothing happens. When I kill the game, I get this traceback: if pygame.mixer.music.get_busy(): KeyboardInterrupt (BTW there's no sound or music.) ... I made the ZIP file directly from a working set of code and just zipped up the whole directory, with all the music etc.. Is there some reason the code wouldn't be portable? Hmm... the music is in MIDI; does Ubuntu's Pygame support that? That could be it. I'm pretty sure this dinky laptop soundcard doesn't have any MIDI capability of its own, and today's Linux systems don't provide a software synthesizer out of the box (you can get one, but only if you run it manually). *tests* Yes, that was it. I renamed the 'music' directory so the game wouldn't find it, and I had no problems after that. Marius Gedminas -- The death rate on Earth is: (computing) One per person. signature.asc Description: Digital signature
Re: [pygame] Shining Sea source code
I tried this source code, and at first it spat out a pygame.error with the traceback: Traceback (most recent call last): File /Users/samuelmankins/Desktop/070530ShiningSeaSource Folder/Shining Sea.py, line 668, in ? game = Game(screen=screen) File /Users/samuelmankins/Desktop/070530ShiningSeaSource Folder/Shining Sea.py, line 182, in __init__ self.GoToZone((0,0)) File /Users/samuelmankins/Desktop/070530ShiningSeaSource Folder/Shining Sea.py, line 379, in GoToZone self.screen.blit(self.bigpen.render(Now Loading,0,(255,255,255)),(500,560)) pygame.error Then when I commented that line out, it started up, but then just sat there with a blue screen for about a minute and then crashed with another error (Unfortunately I didn't save that traceback). Marius Gedminas wrote: On Wed, May 30, 2007 at 07:01:07PM -, [EMAIL PROTECTED] wrote: A version with source code: http://kschnee.xepher.net/code/070530ShiningSeaSource.zip Thanks! I had to change all font.render() calls to enable anti-aliasing, to sidestep a bug in Ubuntu's pygame (segmentation faults when rendering non-anti-aliased spaces). The game starts, but I cannot control anything. I believe you mentioned W, A, S, D keys? Nothing happens. When I kill the game, I get this traceback: Traceback (most recent call last): File Shining Sea.py, line 687, in module game.Go() File Shining Sea.py, line 634, in Go function_to_call() File Shining Sea.py, line 608, in WanderingScreen Conch.j.PlaySong(island) File /tmp/shining-sea/Conch/conch.py, line 128, in PlaySong if pygame.mixer.music.get_busy(): KeyboardInterrupt (BTW there's no sound or music.) Marius Gedminas
Re: [pygame] Shining Sea source code
On Thursday 31 May 2007 09:21:11 am Samuel Mankins wrote: I tried this source code, and at first it spat out a pygame.error with the traceback: Traceback (most recent call last): File /Users/samuelmankins/Desktop/070530ShiningSeaSource Folder/Shining Sea.py, line 668, in ? game = Game(screen=screen) File /Users/samuelmankins/Desktop/070530ShiningSeaSource Folder/Shining Sea.py, line 182, in __init__ self.GoToZone((0,0)) File /Users/samuelmankins/Desktop/070530ShiningSeaSource Folder/Shining Sea.py, line 379, in GoToZone self.screen.blit(self.bigpen.render(Now Loading,0,(255,255,255)),(500,560)) pygame.error Then when I commented that line out, it started up, but then just sat there with a blue screen for about a minute and then crashed with another error (Unfortunately I didn't save that traceback). You probably need to turn antialiasing on, because your computer doesn't like drawing without antialiasing.
Re: [pygame] Shining Sea source code
On Thursday 31 May 2007 09:27:53 am Samuel Mankins wrote: How do I do that? Charles Joseph Christie II wrote: On Thursday 31 May 2007 09:21:11 am Samuel Mankins wrote: I tried this source code, and at first it spat out a pygame.error with the traceback: Traceback (most recent call last): File /Users/samuelmankins/Desktop/070530ShiningSeaSource Folder/Shining Sea.py, line 668, in ? game = Game(screen=screen) File /Users/samuelmankins/Desktop/070530ShiningSeaSource Folder/Shining Sea.py, line 182, in __init__ self.GoToZone((0,0)) File /Users/samuelmankins/Desktop/070530ShiningSeaSource Folder/Shining Sea.py, line 379, in GoToZone self.screen.blit(self.bigpen.render(Now Loading,0,(255,255,255)),(500,560)) pygame.error Then when I commented that line out, it started up, but then just sat there with a blue screen for about a minute and then crashed with another error (Unfortunately I didn't save that traceback). You probably need to turn antialiasing on, because your computer doesn't like drawing without antialiasing. Change the 0 after Now Loading to a 1, and do this for all of the other renders.
Re: [pygame] Shining Sea source code
How do I do that? Charles Joseph Christie II wrote: On Thursday 31 May 2007 09:21:11 am Samuel Mankins wrote: I tried this source code, and at first it spat out a pygame.error with the traceback: Traceback (most recent call last): File /Users/samuelmankins/Desktop/070530ShiningSeaSource Folder/Shining Sea.py, line 668, in ? game = Game(screen=screen) File /Users/samuelmankins/Desktop/070530ShiningSeaSource Folder/Shining Sea.py, line 182, in __init__ self.GoToZone((0,0)) File /Users/samuelmankins/Desktop/070530ShiningSeaSource Folder/Shining Sea.py, line 379, in GoToZone self.screen.blit(self.bigpen.render(Now Loading,0,(255,255,255)),(500,560)) pygame.error Then when I commented that line out, it started up, but then just sat there with a blue screen for about a minute and then crashed with another error (Unfortunately I didn't save that traceback). You probably need to turn antialiasing on, because your computer doesn't like drawing without antialiasing.
[pygame] Shining Sea source code
A version with source code: http://kschnee.xepher.net/code/070530ShiningSeaSource.zip Regardless of the actual license info in those files, you have my permission to treat the code as GPL, if there's anything in there you actually want. The main worldsim thing (nutshell_basic.py) would be the most useful, if the core of the collision code (the physics of what happens when a collision happens) were improved. Also, at http://kschnee.xepher.net/code/mission.py.txt I put up an experiment with a related idea. What actually works in there is a little game mechanic where characters help each other out with dice rolls.
Re: [pygame] Shining Sea source code
With ubuntu PPC I could sail around in the Sailing Mode as advertised, then I went back to menu I wanted to start New Game, and got this /dev/sequencer error. Loaded module Nutshell (Basic) Loaded module Nutshell: Complex Loaded: Conch Loaded module driftwood Loaded module v2007.5.21 Running test. Returned to main loop. Now switching to: Title Screen Returned to main loop. Now switching to: Sailing Screen Returned to main loop. Now switching to: Title Screen write /dev/sequencer: Bad file descriptor I restarted the game and immediatly clicked New Game and couldn't move. Ah... I never heard sound or music. Hm... the things that worked felt smooth :-) On 5/30/07, Marius Gedminas [EMAIL PROTECTED] wrote: On Wed, May 30, 2007 at 07:01:07PM -, [EMAIL PROTECTED] wrote: A version with source code: http://kschnee.xepher.net/code/070530ShiningSeaSource.zip Thanks! I had to change all font.render() calls to enable anti-aliasing, to sidestep a bug in Ubuntu's pygame (segmentation faults when rendering non-anti-aliased spaces). The game starts, but I cannot control anything. I believe you mentioned W, A, S, D keys? Nothing happens. When I kill the game, I get this traceback: Traceback (most recent call last): File Shining Sea.py, line 687, in module game.Go() File Shining Sea.py, line 634, in Go function_to_call() File Shining Sea.py, line 608, in WanderingScreen Conch.j.PlaySong(island) File /tmp/shining-sea/Conch/conch.py, line 128, in PlaySong if pygame.mixer.music.get_busy(): KeyboardInterrupt (BTW there's no sound or music.) Marius Gedminas -- Voodoo Programming: Things programmers do that they know shouldn't work but they try anyway, and which sometimes actually work, such as recompiling everything. -- Karl Lehenbauer -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFGXd4mkVdEXeem148RAn39AJ0cAAadFBUZ2V5shNiw++hucbw+KQCdGfbD xOkbHtUQjqZTMsSabCqdYJM= =7nEx -END PGP SIGNATURE-
Re: [pygame] 'Shining Sea' source code
I had to change all font.render() calls to enable anti-aliasing, to sidestep a bug in Ubuntu's pygame (segmentation faults when rendering non-anti-aliased spaces). The game starts, but I cannot control anything. I believe you mentioned W, A, S, D keys? Nothing happens. When I kill the game, I get this traceback: if pygame.mixer.music.get_busy(): KeyboardInterrupt (BTW there's no sound or music.) I restarted the game and immediatly clicked New Game and couldn't move. Ah... I never heard sound or music. This is weird! It runs on my machine, on Windows. How about if you insert the line print 'I should be jumping' after line 548 of the main program, Shining Sea.py? That should print a message every time you hit Space to jump. And how about the RightShift and Enter keys; do they do anything? There should be visual and sound effects in all three cases. At the top of the program I've got: CONTROLS_UP = K_w And in the main loop (Game.WanderingScreen) it says (excerpted): done = False while not done: ## Handle physics. self.SimulationStep() ## Handle events. keys_pressed = pygame.key.get_pressed() ## Keys that're down. for event in pygame.event.get(): if event.type == QUIT: done = True elif event.type == KEYDOWN: if event.key == K_ESCAPE: done = True self.game_state = Title Screen elif event.key == CONTROLS_JUMP: self.player.Jump() Conch.j.PlaySound(jump) ## Allow the player to move in 8 directions using the arrow keys. move_x, move_y = 0, 0 if keys_pressed[ CONTROLS_UP ]: move_y = 1 (Etc.) So, in theory, if you're pressing the W key when pygame.key.get_pressed() is called, then keys_pressed[ CONTROLS_UP ] should be True, which should trigger movement. And it does on my machine. I made the ZIP file directly from a working set of code and just zipped up the whole directory, with all the music etc.. Is there some reason the code wouldn't be portable? Hmm... the music is in MIDI; does Ubuntu's Pygame support that? The sound code is in Conch.py, which is included and normally works. I notice I have a copy of it in C:\Python24; could that have something to do with it working on my machine, as little sense as that makes? Another hypothesis: something about the line self.clock.tick(15). If the clock were somehow off, then the worldsim's time_interval variable would be messed up. Movement only happens when game-time passes. Even if no time is passing, there should still be a walking animation when you use WASD.