20 February 2008

This is Why I Like Bazaar



Bazaar has been a great productivity booster for me lately. It enables me to work on several concurrent major refactoring tasks, and painlessly merge between them. You can imagine what it would be like to do several merges daily with SVN or (*shudder*) CVS.

The biggest new thing I'm currently working on is the Box2D integration. I'd estimate I'm about 40% done now, and the biggest obstacle has been (once again) having enough time to code, but I hope to have the main functionality + a simple demo working next weekend or next week.

6 Comments:

Blogger Hugo Wetterberg said...

Great news! I really like the style and ease of use of Opioid. How is it going with the line and circle-drawing stuff? Or is already there (patch 3)? I may have missed it.

21 February, 2008 09:28  
Blogger Zorbicon Heptis said...

This comment has been removed by the author.

21 February, 2008 10:09  
Blogger Zorbicon Heptis said...

These are two functions I wrote for circles and rects (using pygame):

def getDrawRect(size = (0,0), color=(220,220,220), bgr=None, border=1, clrkey=None):
tmpSurf = pygame.Surface(size)
tmpSurf = tmpSurf.convert_alpha()
tmpSurf.fill((0,0,0,0))
if bgr:
pygame.draw.rect(tmpSurf, bgr, [0,0,size[0],size[1]], 0)
pygame.draw.rect(tmpSurf, color, [0,0,size[0],size[1]], border)
if clrkey:
tmpSurf.set_colorkey(clrkey)
return tmpSurf


def getDrawCircle(radius, color=(220,220,220), bgr=None, border=1, clrkey=(0,0,0)):
tmpSurf = pygame.Surface((radius*2, radius*2))
tmpSurf = tmpSurf.convert_alpha()
tmpSurf.fill((0,0,0,0))
tmpPos = (radius, radius)
if bgr:
pygame.draw.circle(tmpSurf, bgr, tmpPos, radius, 0)
pygame.draw.circle(tmpSurf, color, tmpPos, radius, border)
if clrkey:
tmpSurf.set_colorkey(clrkey)
return tmpSurf

You can easily change them to use the pygame.draw.aalines, or whatever.

Pass the returned surface to a Sprite object as its 'image' attribute.

21 February, 2008 10:11  
Blogger shang said...

hugo: The line drawing etc. stuff is on hold currently as I'm working on the physics stuff, but I'll get back to it soon.

21 February, 2008 10:37  
Blogger sunspider said...

I am trying to get started with opioid2d. Managed to get the repo and run the .sh and install. When I try to run any of the examples, it complains that it can't find _copioid2d module. Please advise...

I am new to swig. In truth, I'm new to linux, python, and bazaar as well. But I'm excited to learn and I've been a game programmer for a decade so I'm not totally inept...

I am working on a DELL Inspiron 9100 running kubuntu

11 March, 2008 09:40  
Blogger Zorbicon Heptis said...

How's the box2d implementation coming, shang?

25 March, 2008 07:28  

Post a Comment

<< Home