Re: [pygame] Directional collision detection.

2009-02-22 Thread B W
I did the following, which adequately fit my needs. Unfortunately there is some ambiguity to overcome. For example, if one rect is moving at speed 5,5 and the other at -5,-5 their corners will collide. In this case two sides are in contact and you must quantify it in program code to decide which wa

Re: [pygame] Directional collision detection.

2009-02-22 Thread B W
t before. > > cu, > > On Mon, Feb 23, 2009 at 8:53 AM, B W wrote: >> I did the following, which adequately fit my needs. Unfortunately >> there is some ambiguity to overcome. For example, if one rect is >> moving at speed 5,5 and the other at -5,-5 their corners will col

[pygame] Announcing Gummworld, the swampy 2d scrolling engine

2009-04-23 Thread B W
Click if you dare. http://www.pygame.org/project/1107/ Gumm

Re: [pygame] draw text and rectangle with pygame

2009-05-04 Thread B W
Wouldn't you rather puzzle it out yourself? :) Here's a generic technique without spoiling your fun. 1. Create your drawing surface. (Check PyGame tutorials for tips.) 2. Figure out how much space your text needs. (Hint: Font.size.) 3. Render your text. (Hint: Font.render.) 4. Copy your rendered

Re: [pygame] Scrolling

2009-08-04 Thread B W
Yes. This is what I did in Gummworld and the automagic render clipping was very efficient. However, I learned I needed to apply additional test-scope optimizations. For example, if you have many impassable objects on a large map, without inventing optimizations you will spend much time in calculat

[pygame] pymike!

2009-09-02 Thread B W
What happened to the pymike tags on the pygame.org project pages? When I click the pymike tag it only results in one entry. pymike is proliferous!! He had at least 30--no, 50--bazillion entries. His code is instructional and fun to read. Any way we can get the tags put back? (Sorry, pymike, if this

Re: [pygame] pymike!

2009-09-04 Thread B W
Thanks for the replies. I didn't know you were also forgetful, pymike. j/k. Sorta... :) Missing from your web site: Retro Game Library Pixelman 3 (the one I was looking for and couldn't remember the name--cool code tricks in this one!) I know I am missing a whole bunch more. My vote is: They ar

Re: [pygame] Python IDE for windoz

2009-10-10 Thread B W
For Windows: Pyscripter http://www.mmm-experts.com/Products.aspx?ProductId=4 Gumm On Tue, Oct 6, 2009 at 5:04 PM, pierrelafran...@sympatico.ca < pierrelafran...@sympatico.ca> wrote: > Hi > I have administrator rights on a computor in a lab at work, until > tomorrow. I would like install IDE fo

Re: [pygame] Fill a Rect object with color?

2009-11-07 Thread B W
On Sat, Nov 7, 2009 at 10:34 AM, Yanom Mobis wrote: > This is kind of embarrasing but I forgot how to fill a rect object with a > certain color. > > Here's everything so you can see the full context. import pygame from pygame.locals import * pygame.init() pygame.display.set_mode((800,600)) s = p

Re: [pygame] Events of joypad

2009-11-28 Thread B W
for joy_id in range(pygame.joystick.get_count()): joystick = pygame.joystick.Joystick(joy_id) joystick.init() joysticks[joy_id] = joystick Then you should start getting events for all the joystick devices. I didn't have luck with my gamepad so I gave up and boug

Re: [pygame] Re: Announce: PygWeb2.0rc

2009-12-06 Thread B W
Hi, jug. I like the aesthetics of your redesign, and the layout is very friendly. I'm curious to see if your conversion will fix HTML-wrapping issues like this: http://www.pygame.org/wiki/2DVectorClass. And whether project screenshots will be ported and the default N/A images will be replaced. On

[pygame] pygame.org project editing docs?

2009-12-18 Thread B W
Hey yous. Editing my projects, looking for basic editing so I get get something a little more elegant than a run-on paragraph. Can't find anything on pygame.org that looks like docs for the markup. Would some helpful person provide a link, please? Thanks in advance. bw

Re: [pygame] pygame.org project editing docs?

2009-12-18 Thread B W
Ha. Life just got good. Thanks. bw On Fri, Dec 18, 2009 at 7:17 AM, Timothy Baldock wrote: > It's just HTML :)

Re: [pygame] Masks?

2009-12-18 Thread B W
Try http://www.pygame.org/wiki/FastPixelPerfect?parent=CookBook Use the utilities to generate a mask that corresponds to each image (frame). When you swap an image into the sprite object, also swap in its mask. Then when you test the collision your masks will be used. Gumm On Tue, Dec 15, 2009 a

[pygame] HTML editor woes on pygame.org/wiki

2009-12-19 Thread B W
Greetings, pygamers. When I click the [edit] link on the Pygame wiki all the existing, nicely pre-formatted Python code is joined onto a single line. It just comes out of the page like that--would be a lot of work to manually reformat. Even if I switch to HTML mode and enter HTML it doesn't keep t

Re: [pygame] HTML editor woes on pygame.org/wiki

2009-12-19 Thread B W
> However code can still be messed up by the rich text editor.  You can fix it > by using pre and code tags. > > > Then the rich text editor does not mess up the code formatting. > > I've also updated http://www.pygame.org/wiki/syntax and the CookBook page to > mention using pre tags along with th

Re: [pygame] making game distribution easier, part 1.

2009-12-20 Thread B W
This is such a great idea. I love it. Thinking it through some has hurt my brain, though. But not as much as manually resolving dependencies. I think obviously the biggest challenge is going to be the dependencies. I lost count of how many times I gave up on trying out someone's cool project when

[pygame] Trolls Outta Luckland - new release

2009-12-20 Thread B W
Ahoy, pygamers. v0.0.3 is posted. http://www.pygame.org/project-Trolls+Outta+Luckland-1358-2402.html Ain't this like the third space shooter out this month? Sorry... promise, we did not conspire to flood you with shooters! :) Anyway, I'd been wanting to do a shooter for a very long time so here

Re: [pygame] Trolls Outta Luckland - new release

2009-12-20 Thread B W
On Sun, Dec 20, 2009 at 10:39 PM, Bryce Schroeder wrote: My, that was quick. > Control scheme interesting and somewhat novel but a little difficult > (probably to at least in part to unfamiliarity); there is potential > there but it needs refinement. I think I would like mouse to aim, keys > to

Re: [pygame] Trolls Outta Luckland - new release

2009-12-21 Thread B W
On Mon, Dec 21, 2009 at 9:33 AM, Michael George wrote: > I, for one, liked the mouse interface after playing a couple of games.  I'm > of two minds about showing the cursor.  On the one hand it makes it clear > what's going on in terms of the limited speed movement.  On the other, it's > kinda di

Re: [pygame] Trolls Outta Luckland - new release

2009-12-22 Thread B W
On Tue, Dec 22, 2009 at 6:14 AM, Michael George wrote: > B W wrote: >> >> On Mon, Dec 21, 2009 at 9:33 AM, Michael George >> wrote: >> >> Nevertheless, because there's a lot of hand-eye involved in wielding >> an invisible mouse there probably needs t

Re: [pygame] Trolls Outta Luckland - new release

2009-12-22 Thread B W
On Tue, Dec 22, 2009 at 8:59 PM, Michael George wrote: > B W wrote: >> >> I'm not sure what you mean. >> >> > > If I move the mouse east, the cursor moves east.  If I then start moving the > mouse west, the cursor immediately jumps to the west of the s

[pygame] Trolls Outta Luckland - 0.0.4

2010-01-02 Thread B W
For those of you who yawned at v0.0.3... :) http://www.pygame.org/project-Trolls+Outta+Luckland-1358-2419.html# Many thanks to Michael George and Bryce Schroeder for the first round of discussions, which I found very helpful. Looking forward to more. Gumm

Re: [pygame] Trolls Outta Luckland - 0.0.4

2010-01-02 Thread B W
On Sat, Jan 2, 2010 at 8:27 AM, Michael George wrote: > In 0.0.4: > > ImportError: Bad magic number in lib/game_globals.pyc > in file > "/home/mdgeorge/tmp/trolls_outta_luckland/Trolls_Outta_Luckland.py" > Traceback (most recent call last): > File "Trolls_Outta_Luckland.py", line 1012, in >

Re: [pygame] Trolls Outta Luckland - 0.0.4

2010-01-02 Thread B W
On Sat, Jan 2, 2010 at 8:58 AM, B W wrote: > On Sat, Jan 2, 2010 at 8:27 AM, Michael George wrote: > >> In 0.0.4: >> >> ImportError: Bad magic number in lib/game_globals.pyc >> > > $ cd /home/mdgeorge/tmp/trolls_outta_luckland > $ ./Trolls_Outta_Luckland

Re: [pygame] Trolls Outta Luckland - 0.0.4

2010-01-02 Thread B W
the way you are > (i.e. in python) has huge overheads. > > --Mike > > B W wrote: > >> >> >> On Sat, Jan 2, 2010 at 8:58 AM, B W > stabbingfin...@gmail.com>> wrote: >> >>On Sat, Jan 2, 2010 at 8:27 AM, Michael George >>mailto:mdgeo.

Re: [pygame] Trolls Outta Luckland - 0.0.4

2010-01-02 Thread B W
Thanks for the assist, Michael. For now, I uploaded a light bundle to SourceForge, sans music, so folks don't have to re-download the music to get a bug fix. In the process of uploading a music pack. Gumm On Sat, Jan 2, 2010 at 10:21 AM, B W wrote: > Brilliant. RTWFM. :) > > ..

[pygame] Trolls Outta Luckland v0.0.7-beta is up

2010-01-17 Thread B W
http://www.pygame.org/project-Trolls+Outta+Luckland-1358-2441.html Phew. Now I will take a short break and check out the recent activity on pygame.org. Hope you enjoy. Please leave a note. Gumm

[pygame] Pygext and Opioid2D?

2010-01-18 Thread B W
I am intrigued by these two projects. But the home and source links are dead, and there have been no updates in nearly two years. Anyone know what happened to them or their author? http://www.pygame.org/project-pygext-103-.html http://www.pygame.org/project-Opioid2D-459-.html Gumm

Re: [pygame] Rotation Performance

2010-01-20 Thread B W
It could just be the Atom. http://www.trustedreviews.com/cpu-memory/review/2008/08/14/VIA-Nano-vs-Intel-Atom/p3 Gumm

[pygame] OpenGL textures flipped

2010-01-23 Thread B W
Hey, all. An OpenGL noob problem. Loading a texture from an image, let's say some.png, is oriented upside-down and backwards when displayed. I've noticed this in two cases, I'll present the simplest. I was looking at this nice module http://www.pygame.org/wiki/SimpleOpenGL2dClasses?parent=CookBoo

Re: [pygame] OpenGL textures flipped

2010-01-23 Thread B W
I could not have asked for a better explanation, Brian. Thanks so much. bw

Re: [pygame] why is sometimes so much time between 2 frames ? (400 milliseconds instead of 30)

2010-01-24 Thread B W
Yes, your collision checking is wasteful and garbage is piling up. :) You can see easiest this if you simply "import gc" and then "gc.collect()" at the end of your main loop. As you make more penguins you will notice your green meter grows a lot. It was killing my dual-core at around 20 penguins.

Re: [pygame] BUG : self-made pygame events don't work under Windows XP

2010-01-25 Thread B W
Hi, Amaury. The docs recommend that event.type stay between NOEVENT and NUMEVENTS. So you are restricted to that range. Not sure if this is the cause of the inconsistencies you're seeing, but Pygame can be expected to work on any support platform if you follow the rules. Even though your choice o

[pygame] write sound to file for fast loading?

2010-02-01 Thread B W
Howdy, folks. I have a problem I've been studying a while and I can't figure out a solution. Pygame or SDL--not sure which--is pretty slow at loading sounds. For large sounds, like songs, this means significant pauses in your game; or very long loading times at startup if you have a few of them to

Re: [pygame] write sound to file for fast loading?

2010-02-02 Thread B W
These are .ogg loading from disk using pygame.mixer.Sound('filename.ogg'), the largest of which is 7 MB. I can't believe I overlooked pygame.mixer.music. Pardon me while I flog myself. This does exactly what I want. Thanks, Brian and Olof, for suggesting it! Works like a charm. Gumm

Re: [pygame] write sound to file for fast loading?

2010-02-04 Thread B W
On Wed, Feb 3, 2010 at 2:28 PM, Shadd wrote: > I think it would be easier to simply use a loading screen before a part of > the game (f.e. entering an area) and there load any sounds that might come > in use into that part. It surely would be nicer to see than lag during the > gameplay. > Of cour

Re: [pygame] frame independant movement

2010-02-04 Thread B W
This is kind of a caveman method that might waste a few precious FPS, but I used it successfully (I think--I mean, nobody complained my game runs like crap. :)) Run a frame-flipping benchmark for a second or two as part of your program's startup, in which you blit the whole screen each frame and r

[pygame] Trolls Outta Luckland v1.0.0 final

2010-02-06 Thread B W
The space shooter enthusiasts' release. Have fun. http://www.pygame.org/project-Trolls+Outta+Luckland-1358-2493.html# Gumm

[pygame] Problem with simultaneous key presses

2010-02-08 Thread B W
Howdy, folks. The following small program demonstrates a problem with key presses. http://trollsouttaluckland.googlecode.com/files/test.py The program accepts cursor keys and space key to simulate moving and firing, respectively. It accumulates keydown and keyup events, translating combinations

Re: [pygame] Problem with simultaneous key presses

2010-02-09 Thread B W
Well crap. I was hoping that it was not woven into the fabric of space-time. Thanks for the article, René. An explanation is the next best thing to a solution. :) Gumm On Mon, Feb 8, 2010 at 11:23 PM, René Dudfield wrote: > hi, > > keyboards are evil: > http://www.sjbaker.org/wiki/index.php?ti

Re: [pygame] Problem with simultaneous key presses

2010-02-10 Thread B W
I just tried Control key, it works great. Thanks for the suggestion. Gumm On Wed, Feb 10, 2010 at 10:09 AM, Jason M. Marshall wrote: > For your default keys, I suggest Up, Down, Left, Right and left Ctrl. The > modifier keys (Alt, Ctrl and Shift) are less prone to blocking than Space. > > Jason

Re: [pygame] Regarding two Pygame-related events

2010-02-12 Thread B W
Me too! (How did I overlook this?:)) Gumm

[pygame] DMs, what are you doing?!

2010-02-14 Thread B W
I'm curious. :) Is anybody out there working on a dungeon crawler? My interests travel specifically along this line: - RP with a storyline and character building - PVE - real-time combat and movement (not turn-based) - melee-range-magic - not too deep in stats or skills - plans

Re: [pygame] DMs, what are you doing?!

2010-02-19 Thread B W
Thanks for the replies, all. I confess I was fishing. :) As I am wrapping up Trolls Outta Luckland I found myself looking for the next challenge. And reflecting. For such a narrow game, many aspects of TOL gave me quite a challenge. I had quite a lot of passive help in the form of docs, papers, ex

Re: [pygame] DMs, what are you doing?!

2010-02-19 Thread B W
I been checking out your Shining Sea demo, Kris. I like it. We will have to see in what direction the project goes. I'll certainly keep your modules in mind. Thanks. :) Gumm On Fri, Feb 19, 2010 at 9:22 PM, Kris Schnee wrote: > On 2/19/2010 6:33 PM, Henrique Nakashima wrote: > >> The library I'

Re: [pygame] DMs, what are you doing?!

2010-02-19 Thread B W
beta testers? I must learn the secret. =) Gumm On Fri, Feb 19, 2010 at 3:08 PM, B W wrote: > > look at Ardentryst (search pygame.org), a project that had many invested > contributors. And it shows. I don't think there is one element of >

[pygame] pygame.mixer.init(frequency=?)

2010-02-25 Thread B W
Howdy. I can't seem to find any clear info on my problem. I'm hoping someone here has dealt with this. I have two songs. One has a bitrate of 48000, the other 44100. If I allow Pygame (SDL mixer) to use the default frequency, the playback speed of the songs is distorted. If I explicitly set the m

Re: [pygame] pygame.mixer.init(frequency=?)

2010-02-25 Thread B W
On Thu, Feb 25, 2010 at 1:43 PM, Marius Gedminas wrote: > On Thu, Feb 25, 2010 at 10:37:36AM -0800, James Paige wrote: > > On Thu, Feb 25, 2010 at 10:31:12AM -0800, B W wrote: > > >I have two songs. One has a bitrate of 48000, the other 44100. If I > allow > > >

Re: [pygame] Unprintable characters

2010-03-02 Thread B W
Assuming these are UTF8 characters, the encoding is backwards compatible with ASCII. Therefore, you should be able to use the ASCII chart to classify non-printable character codes (0-31 and 127). Gumm On Tue, Mar 2, 2010 at 1:43 AM, Greg Ewing wrote: > René Dudfield wrote: > >> Hi, >> >> I guess

Re: [pygame] Unprintable characters

2010-03-02 Thread B W
On Tue, Mar 2, 2010 at 2:54 PM, Greg Ewing wrote: > B W wrote: > >> Assuming these are UTF8 characters, the encoding is backwards compatible >> with ASCII. Therefore, you should be able to use the ASCII chart to classify >> non-printable character codes (0-31 and 127). &g

Re: [pygame] Unprintable characters

2010-03-03 Thread B W
Clean slate. UniCode does not seem to be completely functional in SDL. As this thread from 2006 suggests ( http://old.nabble.com/Arrow-Keys,-and-keysym.unicode,-SDL-1.2.10-td5030718.html) you may need to do some platform-specific special handling of certain keyboard events. The SDL version used in

Re: [pygame] Optimising a tile map renderer

2010-03-05 Thread B W
Here are a few OpenGL libraries I've got my eye on. They all look usable, though some may be dunner (more mature) than others. OpenGL rendering pretty much makes drawing sprites the least expensive operation in your program, and these libraries make OpenGL 2D programming a breeze. They all support

Re: [pygame] super surface... a surface made up of many smaller surfaces

2010-03-07 Thread B W
On Sat, Mar 6, 2010 at 11:44 AM, Kris Schnee wrote: > On 3/5/2010 10:40 AM, René Dudfield wrote: > >> However, sometimes we would like to operate on a whole bunch of >> smaller surfaces stuck together. >> > > I've done several projects using a full-screen scrolling tilemap. That is, > sprites wal

[pygame] Python 2.5.4 or 2.6

2010-03-25 Thread B W
Howdy. Pygame download page claims "python2.5.4 is the best python on windows at the moment". This has been the status since I began with Python and Pygame about 1.5 years ago. While I appreciate suggestions that save me time and agony, it is my nature to always ask why. If the doc says take this

Re: [pygame] blit speedup

2010-03-29 Thread B W
On Sun, Mar 28, 2010 at 3:29 PM, Wakefield, Robert wrote: > Do you have any recommendation for the best way to get an OpenGL engine > running, especially going Pygame surface to OpenGL texture? I'd like to > preserve platform-independent .py files or executables if possible. > > glLib (and upcomi

Re: [pygame] Source rect for sprites in a RenderUpdate group

2010-04-16 Thread B W
Without knowing details, one can only conjecture. You might use Group.update(*args) to get info to each sprite. The sprite group in turn calls Sprite.update(*args). You can pass anything, such as a source rect to use in computing relative offsets, a list or dict of rects, or a callback function. G

Re: [pygame] Source rect for sprites in a RenderUpdate group

2010-04-16 Thread B W
I failed to mention that if you truly want to leverage MVC you might simply send data to the View in a message attribute. Gumm

Re: [pygame] Source rect for sprites in a RenderUpdate group

2010-04-16 Thread B W
Sounds to me like you'd want to create a subsurface of your larger image each game tick before calling group.draw() or sprite.draw(). Reference pygame.surface.Subsurface(). self.image = pygame.surface.Subsurface(self.full_image, self.source_rect) Gumm

Re: [pygame] Source rect for sprites in a RenderUpdate group

2010-04-16 Thread B W
I had difficulty following the explanation. Sorry If I misunderstand what you're trying to accomplish, Vincent. On the drive home I was thinking about this. The following little demo might suit your purpose? http://trollsouttaluckland.googlecode.com/files/subsurf_as_viewport.py It assumes you wa

Re: [pygame] Running Python 2.5 alongside 2.6

2010-04-28 Thread B W
Very recent discussion on the Python 2.5 vs 2.6 topic: http://www.mail-archive.com/pygame-users@seul.org/msg13877.html If you want to run two Python versions, you can do so by managing some environment variables. Here's what I do in Cygwin: PATH="append search path for Python executables and scri

Re: [pygame] pygame.image.save(...)

2010-04-28 Thread B W
On Wed, Apr 28, 2010 at 1:31 AM, René Dudfield wrote: > On Wed, Apr 28, 2010 at 5:26 AM, Ian Mallett wrote: > > > several hundred files every time it tries to save. Oh well, user error. > > > hehe. > > A place I worked at in the 90's would call an 'user error' an UBD error ;) > > Luckily no

Re: [pygame] Running Python 2.5 alongside 2.6

2010-04-28 Thread B W
Actually, the outcome I got from that previous thread is that for a few significant reasons 2.5.4 is still the "best" choice for Windows: 1. MSVC++ runtime availability on target systems, and library distribution constraints. 2. Packaging readiness (although I've been able to use pygame.org's py2e

Re: [pygame] informal poll on Windows python version

2010-04-28 Thread B W
Welcome to "me too" hell... =) WinXP Pro SP 2 WinXP Home SP 2 Python 2.6 (and side-by 2.5.4, in case someone forces me to use it some day) Pygame 1.9.1 Gumm

Re: [pygame] Move sprite and stop it.

2010-04-28 Thread B W
There are no stupid questions. Unless you work at my company where they seem to abound. :) You need to control all the details of sprite position in a loop with increments and conditions. There's no move_to in Pygame, though many of us have coded our own move_to functions we might be willing to sh

Re: [pygame] Move sprite and stop it.

2010-04-29 Thread B W
I think I understand your move_to problem now. I had to invent that wheel for myself a while ago and the math was not trivial for me. I had to get my son to teach me new tricks. :) Even though they may not be the most elegant math solutions, they are reliable. I uploaded this very basic demo: http

Re: [pygame] question about Rect objects

2010-05-18 Thread B W
Hi, Alex. Welcome to a fun world. 1. Resizing. See the docs for Transform. You will need to get the new re-sized rect from the image afterward. 2. Keyboard. The docs for Event describe how to handle events. Pygame makes it extremely easy. The docs don't seem to adequately explain how to check mod

Re: [pygame] question about Rect objects

2010-05-19 Thread B W
Hi, Alex. On Tue, May 18, 2010 at 6:12 PM, Alex Hall wrote: > In the meantime, > do you have a place where I can find an example of drawing a grid of > Rects? I searched for a little bit and could not find any tutorials, or projects or demos that highlighted a grid as a feature. While there ar

Re: [pygame] Working with maps

2010-05-19 Thread B W
Food for thought. I've had very good results with FastPixelPerfect collision detection. With this, however, your challenge will change to: how do I break up the territories neatly, make them into images (sprites), and then puzzle their bounding rects together just as neatly. http://www.pygame.org/

Re: [pygame] Has anyone made an internet game?

2010-05-19 Thread B W
I challenge... oh noes! The service is down! =) Gumm On Tue, May 18, 2010 at 10:35 PM, Ian Mallett wrote: > Hello, > > I humbly present my networking library, > Mastermind. > It works out-of-the-box, and provides a simple progr

Re: [pygame] question about Rect objects

2010-05-24 Thread B W
On Mon, May 24, 2010 at 1:14 PM, Alex Hall wrote: > > Thanks. I am a student, but this is not an assignment, it is a summer > project I basically decided to do a couple weeks ago. > There I go, jumping to conclusions. :) On the upside, I am now liberated to post the grid done in sprites. If you'

Re: [pygame] google's native client

2010-05-26 Thread B W
Aaaa run away! Security. :) Gumm

Re: [pygame] google's native client

2010-05-27 Thread B W
extremely impressed. Thanks for the links! And sorry, I did not mean to derail the thread. Please continue. :) Gumm On Thu, May 27, 2010 at 2:35 AM, machinimist machinimist < machinim...@gmail.com> wrote: > > > On Thu, May 27, 2010 at 4:52 AM, B W wrote: > >> Aaaa run away!

Re: [pygame] google's native client

2010-05-28 Thread B W
It reads that way, yes. The author mentions DOM. What is that? Gumm On Wed, May 26, 2010 at 8:28 AM, machinimist machinimist < machinim...@gmail.com> wrote: > http://mail.python.org/pipermail/python-dev/2009-June/090038.html > > maybe i am misunderstanding something but didn't he get full python

Re: [pygame] Writing a simple GUI

2010-06-02 Thread B W
In my mind, the player has to select which unit to perform an action on. That target would be stored as state info in your game engine. Then your attack() callback simply chooses the attack action, and the game engine has the info it needs to execute the turn: player->attacking->target. Gumm

Re: [pygame] Questions about IDE and inflate()

2010-06-15 Thread B W
Hi, Hokan. Try DrPython for editing and running. I've tried many and I keep coming back to this one. It does not run via cmd. Hope it works for you. You'll also need wxPython. I suspect pygame.Rect.inflate() won't do what you want. Why do you want the rect to be smaller than the cloud image; what

Re: [pygame] Questions about IDE and inflate()

2010-06-15 Thread B W
On Tue, Jun 15, 2010 at 9:53 PM, Hokan LUNDBERG wrote: > Gumm: > > Why do you want the rect to be smaller than the cloud image; what are you > trying to accomplish? > > I want to avoid that the plane is hit by a cloud just by being close to it. > The rect of the cloud-sprite is bigger than the cl

Re: [pygame] [Pygame] Fading Between Two Songs

2010-07-06 Thread B W
Greetings, Urtling. There's a few ways, I think, and maybe more. 1. When you fade the song that's playing, also queue the next song at that time: pygame.mixer.music.queue(). No fuss. The next song will start playing immediately. 2. Tell Pygame to send an event when a song stops playing: pygame.mi

Re: [pygame] Re: [Pygame] Fading Between Two Songs

2010-07-08 Thread B W
I'm not aware of a convenient mechanism. I've just created logic to detect when the song or sound ended (is_playing()) and started a new one. Setting an event seems the most convenient way to manage it, though. If anyone knows a better way I'd love to learn of it too. :) bw On Thu, Jul 8, 2010 a

Re: [pygame] are individual midi instruments sounds copyrighted

2010-07-18 Thread B W
Call the company and ask if your intended use case is allowed, or if there's any loops you can jump through to get authorization. Gumm

Re: [pygame] are individual midi instruments sounds copyrighted

2010-07-21 Thread B W
Relocating the furniture voids the warranty. If you need to move the furniture under warranty to a new location, you'll either need to contract an authorized, insured mover, or get the furniture re-certified by an authorized representative of the manufacturer at the new location. These expensive se

Re: [pygame] 127.5

2010-07-30 Thread B W
Use a data set for your computational values and convert them to display values as needed. I do this for sprites whenever I want micro speed adjustments, which in essence lets them move fractions of pixels per frame. Gumm

[pygame] pygame.sndarray.array = ValueError: string size must be a multiple of element size

2010-08-03 Thread B W
Howdy, folks. Seeking enlightenment. Anyone seen this before, and how do I rassle it into submission? Docs and web have been unhelpful so far. I'm using pre-built software packages; been using these for months without any issues. This problem occurs with all ogg and wav files. I see that Numpy is

Re: [pygame] Spam on Tutorials page

2010-08-05 Thread B W
Nuke and ban some accounts. Like "Steve", who put hairstylesx back after I corrected freesound.org links. (I sure am glad I found that link, though. I now have a new hairstyle *and* some cool new sounds! =)) Seriously, nuke the bastard. I don't recall how easy it was to sign up. Maybe there's an o

Re: [pygame] pygame.sndarray.array = ValueError: string size must be a multiple of element size

2010-08-05 Thread B W
sound. Either remove pygame.init, place it after >> pygame.mixer.init or set the SDL_AUDIODRIVER environment variable to >> 'waveout'. >> >> Lenard Lindstrom >> >> On 03/08/10 11:03 AM, B W wrote: >> >>> Howdy, folks. >>> >>> Seekin

Re: [pygame] pygame.sndarray.array = ValueError: string size must be a multiple of element size

2010-08-06 Thread B W
; I don't know. Try the sndarray example: > > python -m pygame.examples.sound_array_demos > > Otherwise there is something different about your sound files. Without an > example that causes the problem there is nothing I can do. > > Lenard > > > On 05/08/10 03:45 PM

Re: [pygame] Re: Keeping a sprite on screen with rect.clamp

2010-08-18 Thread B W
I found this implementation of Bresenham's Line algorithm efficient enough for real-time: http://en.literateprograms.org/Bresenham's_line_algorithm_(Python)?oldid=16281 Gumm On Mon, Aug 16, 2010 at 7:43 PM, Mark Reed wrote: > I want to calculate a straight path of points between two points and

Re: [pygame] Re: Keeping a sprite on screen with rect.clamp

2010-08-18 Thread B W
If you're trying to plot curved paths in real-time... This forward differencing algorithm is the fastest I've found to date: http://www.niksula.cs.hut.fi/~hkankaan/Homepages/bezierfast.html. Though it is only suitable for purposes where the curve does not have to touch all the control points. And

Re: [pygame] frame independant movement

2010-08-27 Thread B W
Howdy, Reviving this old thread. The comments by Patrick and Brian really intrigued me, so I pursued the topic. Found a few interesting articles and one great article. My study has resulted in a recipe for those of us continually nagged by the question, "how can I get constant game speed independe

Re: [pygame] frame independant movement

2010-08-28 Thread B W
Alan, With the GameClock recipe it'd just be a matter of decreasing ticks_per_second (e.g. clock.ticks_per_second /= 5). Though if you're using interpolation/prediction to smooth out your frames you may really notice things like collision artifacts, as a wider separation of ticks versus frames res

Re: [pygame] moving a filled circle from top to bottom

2010-09-27 Thread B W
Changing the order might help with procedural images. Then you can make the rect's attributes work for you. self.rect = pygame.Rect(0,0,50,50) self.image = pygame.surface.Surface(self.rect.size) pygame.draw.circle(self.image, pygame.Color(0, 0, 255), self.rect.center, self.

Re: [pygame] moving a filled circle from top to bottom

2010-09-29 Thread B W
ps. Gumm On Wed, Sep 29, 2010 at 8:43 PM, kevin hayes wrote: > Hey...my apologies for taking so long to get back to you, I was staying at > a friend's house for a couple of days. I honestly don't understand your > email. Maybe you could give me a small example...if you wish. >

[pygame] Orbiting bodies in pymunk

2010-10-01 Thread B W
Howdy, folks. I made a small pymunk demo in which a Pygame sprite orbits the mouse pointer. I'm trying to figure out a way to get an elliptical orbiting body. Body.impulse is the only thing that appears to behave how I want, but after many hours of experimentation there remain gross eccentricities

Re: [pygame] circles

2010-10-02 Thread B W
I like Ian's earlier suggestion, Kevin, which he only hinted at. But I sense you're really struggling with how to extend your Circle class, and could use an example to go with the explanations. Note that every time you create a circle object with the Circle class, you're executing the constructor

Re: [pygame] frame independant movement

2010-10-04 Thread B W
This is for folks who may have a continuing interest in the topic. While trying to use GameClock I discovered a bug. While I was in there a-squashing, I added a couple methods. Then I decided to take the prediction demo to the next level and solve the screen-edge rebound problem, with plenty of he

Re: [pygame] more circles

2010-10-06 Thread B W
You have to resize the rect *and* the image. You can use pygame functions Rect.inflate* and transform.scale, respectively, or you can do-it-yerself (hint: move some of the constructor code to a resize method and call that from in constructor, as well as the main loop). Also, the += and -= in the e

Re: [pygame] more circles

2010-10-07 Thread B W
We are a supportive bunch, Kevin. From time to time even old-timers need help. Unless you are brand spanking new to computers and programming, or really struggling to master the basics, I would expect you probably won't need a tutor. You just need a few good resources. Chances are someone has alr

Re: [pygame] more circles

2010-10-09 Thread B W
m in > constructor, as well as the main) By constructor you mean the first > __init__( variable, variable...) ? This stuff doesn't come naturally to me, > but I find it fascinating. If you could just show me (more explicitly) how > to do this, that would help. > Thanks for the

Re: [pygame] Surface blitting not effective

2010-10-09 Thread B W
Your blits were copying the source to positions outside the target surface. I always suspect this if I can't see my graphics. You can insert statements like "dlgsurface.get_rect().collidepoint(choicerect.topleft)" or "print dlgsurface.get_rect().colliderect(choicerect)" to tell whether the source r

Re: [pygame] peer-to-peer networked games

2010-11-09 Thread B W
If you can work with OpenGL, might keep your eye on PySoy. http://www.pysoy.org/ Gumm On Sat, Nov 6, 2010 at 2:48 AM, Miriam English wrote: > Wow! Thanks Kris. > > I hadn't heard of this one. Croquet sounds very interesting. I didn't > understand it all in my first quick read-through, but I'll

  1   2   >