Ir al contenido principal

Ralsina.Me — El sitio web de Roberto Alsina

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.

PyWeek progress: the 4 hour mark

Sud­den­ly I was hav­ing a calm day at work, and Rosario is tak­ing care of the baby, so I spent a few hours on the Py­Week projec­t.

I have in­te­grat­ed Chip­munk with QGraph­ic­sS­cene.

What does it mean? That I can now...

  • Cre­ate a scene

  • Cre­ate a view on­­to that scene

  • Cre­ate bal­l­s, walls and poly­­gons as scene items

  • Watch said bal­l­s/wal­l­s/poly­­gons bounce around hap­pi­­ly un­der Chip­­munk di­rec­­tion.

For ex­am­ple, here's enough code to cre­ate a few balls a box and a stair­case:

self.scene=ChipScene()
self.ui.view.setScene(self.scene)

for x in range (0, 10):
    self.scene.addBall(x*50.0+10, 50.0, 10.)
    self.scene.addBall(x*50.0+20, 20.0, 10.)
self.scene.addWall(0., 0., 0., 500.)
self.scene.addWall(0., 500., 500., 500.)
self.scene.addWall(500., 500., 500., 0.)
self.scene.addWall(500., 0., 0., 0.)
for i in range (0, 20):
    self.scene.addWall(i*20, 200+i*20, i*20+20, 200+i*20)
    self.scene.addWall(i*20+20, 200+i*20, i*20+20, 200+i*20+20)

self.scene.addPoly([[0, 50], [0, 100], [100, 100], [100, 50], [0, 50]])

I de­clare that nifty.

PyWeek5

Well, it seems I am in trou­ble for Py­Week.

Why? Be­cause it's wednes­day and I have done noth­ing. Noth­ing! It's be­cause I have been work­ing a lot, re­al­ly, and I have a 4 month baby, too.

So, I am up­ping the ante.

I will do a Py­Day.

I am tak­ing to­mor­row off (yeah, right!) and I'm do­ing the game in one day. Maybe I will scrounge a few hours on sun­day, too.

It will prob­a­bly not be fit for the con­test be­cause:

  • I will use PyQt

  • I won't test it in any plat­­form oth­­er than my Lin­ux box

But here's the game con­cept (BTW: Twist­ed sucks as a theme. It sucks re­al­ly, re­al­ly, re­al­ly hard!):

Ac­cord­ing to the dic­tio­nary, Twist­ed al­so means per­vert­ed. So, this game, Twist­ed Lit­tle Boy is about a bad boy. A re­al­ly bad boy. But a clever one. He cre­ates ma­chines us­ing ran­dom equip­ment he finds to do evil, re­al­ly mean things.

I will prob­a­bly do a live-blog thing like those tu­to­ri­als I wrote years ago about PyQt.

There's a Google code project (ob­vi­ous­ly emp­ty): http://­code.­google.­com/p/twist­edlit­tle­boy/

See you all to­mor­row.


Contents © 2000-2020 Roberto Alsina