Tag Info

New answers tagged


Developed these modules that implement Pygame functionality: PyJ2D runs in JVM with Jython permitting easy distribution to systems with JVM; Pyjsdl runs in the Web browser after compiling to JavaScript with Pyjs. The Python script needs some modification to run in the ported environments and for unimplemented Pygame methods, usually minor for PyJ2D and a ...


You could look at Skulpt.org which provides a completely brower-based implementation of PyGame. However I do not know what external APIs PyGame uses and which are supported by Skulpt. Edit: it seems Skulpt also has WebGL bindings so this should be very possible!


If you really, truly, absolutely want access a sprite by index, you can do this: third_sprite = mygroup.sprites()[2] So your function would be: def getSpriteByPosition(position,group): return group.sprites()[position] Which throws IndexError if the index is not found. If you want to return None in that case, simply enclose the line with a try ...


According to the (yet-in) complete guide to Soya 3D, the only supported model formats are .blend files or its own custom format. I've found a couple places that said you can import .obj files by placing them in a certain directory, but there was no proof or confirmation. At any rate, I can say that if importing .obj files directly is possible, it's not in ...


Move along X axis only, test for colision, if true invert X movement. Repeat for Y.


The problem is in your pygame usage: you're re-creating the circle on every frame. Pygame works best if you create every image only once, on its own Surface (think of it as a virtual canvas), and then in each frame you blit that surface's image onto the screen (which is also a surface). Think of blit as an ultra-fast copy from surface to surface. Here's an ...


The official pygame docs say: http://www.pygame.org/docs/ref/surface.html#pygame.Surface.convert It is a good idea to convert all Surfaces before they are blitted many times. The converted Surface will have no pixel alphas. They will be stripped if the original had them So, as far as I can tell you should always .convert() them when you are going ...

Top 50 recent answers are included