Archive for the ‘projects’ Category

Aggregated angst

Sunday, October 5th, 2008

A little python, a lot of angst…  for just 3 hours of work this was definitely worth it :)

Click the image to view it in wordle where you can mess with it.

I love the way that Im is the biggest word, you can really see how egotistical they are on grouphug.

(Cheers to Andy for turning me onto wordle and helping with ideas).

5 Minute python

Tuesday, February 26th, 2008

I’ve recently been learning python and decided to note down the *very basics* that took longer to find out than I would’ve liked.

Without furtherado, heres my 5-minute-python.

Playing a sound in pygame

Sunday, February 24th, 2008

It can be useful to test sounds in your current engine (esp for testing MOD support), so I’ve made a tiny sound player for pygame. The code is just this:

import sys, pygame
from pygame.locals import *

import pygame.mixer

if __name__=="__main__":
    pygame.display.set_mode((120, 120), DOUBLEBUF | HWSURFACE)

    pygame.init()

    try:
        filename = sys.argv[1]
        pygame.mixer.init()
        sound = pygame.mixer.Sound(filename)
        print 'Press ESC to quit, any other key retriggers sound'
        sound.play()

        running = True
        while running:
            for event in pygame.event.get():
                if event.type == KEYDOWN:
                    if event.key == K_ESCAPE:
                        running = False
                    else:
                        sound.play()

    except IndexError:
        print 'Usage tplay.py filename'

The file is attached here: Tiny pygame audio player.

Ball breaker update

Monday, November 19th, 2007

Reached a small milestone in my bat and ball game (BallBreaker), the fonts are implemented as bitmap fonts, meaning that everything on the rendered on the game screen is original material.

The current font system is based on tiles, so it should be easy to implement animation and cool stuff next, it definately feels like the project is about 1/2 way to releasable.

Switching to Cairo is starting to seem attractive, especially when making bitmapped versions of the fonts.

For the moment I won’t switch to Cairo as I’m very curious to see what happens to performance when pygame 1.8 comes out.

Another reason I haven’t switched yet is a bit of lazyness - the pycairo msi doesn’t install the cairo dll… and of course the learning that goes with the new API :)

Retro font

Monday, October 8th, 2007

I’ve just finished the initial version of the font that’ll go into my game ball breaker (”Ball Breaker Caps”)… Some of the characters need more work, but it has the retro-future look I’m going for.

This means that I can feel happy about putting in the high score table and scrolling messages and they’ll have the look I’m going for.

Ball Breaker!

Friday, October 5th, 2007

I’ve recently started learning python in earnest, to this end I’ve been writing a bat and ball game. I’m quite suprised at how much you get for your LOC in python… so far it’s about 1,000 LOC and has multiple powerups and bats, plus sound fx by ne7.

Title screen of ball breaker,

Graphics are made in inkscape and the GIMP - ingame screenshot after the cut.  (more…)