Skip to main content

Ralsina.Me — Roberto Alsina's website

Posts about programming (old posts, page 26)

Everything is still around

For a project I am do­ing for one of my cus­tomer­s, I need­ed a mail­ing list ar­chive. I looked, and it seems the nicer one is Lurk­er.

Sad­ly, there are no RPM pack­ages, so I had to build it man­u­al­ly... and ran in­to mimelib. Which, look­ing closer, is the same mimelib from Doug Saud­er I used in KRN back in the late 90s.

And which I had a hand in GPLing, too. And it's still in use. One of the things I al­ways liked about FLOSS: noth­ing ev­er re­al­ly gets thrown away.

New library: ChipScene

This is the re­al out­come of my Py­Week fail­ure: a neat li­brary.

Take Chip­munk and Qt mash them up, and what do you get?

A OpenGL-ac­cel­er­at­ed, mul­ti­plat­for­m, easy-­to-use play­ground!

But watch the sil­ly video that shows no in­ter­est­ing fea­tures in­stead:

You can't see it but there are 29 bal­loon­s, num­bered, that bounce around hap­pi­ly.

Per­for­mance in the video sucks be­cause I had to dis­able OpenGL in or­der to cap­ture it cor­rect­ly (and video record­ing kills my note­book,any­way). That de­mo nor­mal­ly runs in 3 sec­ond­s, not 57.

Here's the non-boil­er­plate code for that de­mo:

def fillWorld(scene):
  items=[]
  for x in range(1, 29):
      b=cs.CPBodyItem(bpos=[0+13*random.randint(0,25), -50-30*random.randint(0,10)],m=10)
      s=cs.CPCircleShapeItem(10, b, e=.5, offset=[0, 0])
      t=QtGui.QGraphicsSimpleTextItem(str(x), s)
      t.setPos(-5, -5)
      items.append(b)
  items.append(cs.CPSegmentShapeItem([0, 50], [500, 450], 1, None, e=.7))
  items.append(cs.CPSegmentShapeItem([0, 450], [500, 50], 1, None, e=.7))

  for i in items:
      scene.addItem(i)

Neat, is­n't it?

You can get it at the Chip­Scene google code project in­clud­ing, of course, the source.

What I learned at PyWeek

  1. I don't have the time for this kind of dead­­­lines any­­more. Not even one al­l-nighter? I did noth­ing on Sat­ur­­day ex­­cept re­al work and fam­i­­ly re­u­nion?

  2. It's re­al­­ly easy to write games with Python. It's most­­ly just a mat­ter of hav­ing a good game con­­cep­t. The cod­ing is the easy part.

  3. Chip­­munk is cool. Qt's graph­ic scene stuff is cool. My Chip­­munkScene is coolest ;-) I should re­­think the API but the con­­cept is killer stuff. With a lit­­tle work this thing is like LEGO!

  4. I will try again in Py­Week6.

A little further on TLB

A bit of pro­gress, al­though not much time to work on it any­more so I will prob­a­bly not make it.

Ob­jects now can do things when they are hit by oth­er kinds of things.

Ex­am­ple: If a ball hits the bot­tom of the cat­a­pult cup, the cat­a­pult shoot­s. If some­thing hits the tar­get ob­jec­t, you win the lev­el.

First pic of TLB

Not a game yet, but the en­gine is start­ing to look good.

tlb1

The ball drop­s, fol­lows both ramp­s, bounces down the stairs, hits the domi­noes, the last one falls on the piv­ot­ing ram­p, slides down and to the left, falls stand­ing and leans left, then hits the rest of the domi­noes.


Contents © 2000-2023 Roberto Alsina