Saturday, March 29, 2008

hi, what is it? oh pygame 1.8 is released.

Dear you,

I was walking down the street the other day and pygame 1.8 was
accidentally released.

oops.

Well anyway. Have a nice day. http://pygame.org/whatsnew.shtml
http://pygame.org/


* pygame.mask for pixel perfect collision detection
* pygame.scrap for clipboard support
* new and improved sprite groups, including layers, automatically
selecting fastest update mode(full screen or dirty rect updates), and blend modes...
* blending support for filling and blitting surfaces. ADD, SUB, MULT, DIV etc.
* saving surfaces as jpeg and png
* buffer access for Surface and Sound objects
* numpy, and numeric support for pygame.surfarray and pygame.pixelarray
* PixelArray, which can be used instead of numpy - without the dependency.
* smooth scale function written in mmx assembly with C fallback.
* More functions release the GIL for multithreaded use.
* lots of speed ups to many functions via better python wrapping.
* color thresholding, bounding box finding for images, and surface averaging.
* massive documentation updates (which have been available on the website for a while already).
* pygame.time.Clock.tick() is more cpu friendly.
* updates to example programs.
* new windows, and mac installers.
* hardware acceleration updates for overlays and opengl.
* porting work to different platforms.
* heaps of bug fixes including SRCALPHA blitting fixes, 64bit fixes, sound system fixes.

Plus there have been lots of changes to SDL itself since the last pygame release. http://www.libsdl.org/release/changes-1.2.html.

* lots of stuff really... but those are some of the nice things. Read the what's new page for full details http://pygame.org/whatsnew.shtml

chairs,


ps. Balloons and robots are cool.
pps. see readme for credits. Thanks to all the people who helped out :) Time for much beer drinking now I think.

Monday, March 03, 2008

py3k Decimal?

From the Cobra language, comes the idea of using Decimal numbers as the default. It's 2008, so let's use decimals by default!

This is an error that python has... Add 0.1 together ten times, and you do not get 1.0.

>>> 1.0 == 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1
False


Maybe py3k should use Decimals by default instead? Or is this planned already?

Python float performance is really bad anyway, so we might as well make it a little more accurate right?

Floats are such a cause of errors in code, it'd be nice if math was more accurate by default :) It requires a fair bit of knowledge to understand all the quirks of floats, but less to understand the quirks of decimals.


cu.