[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] namedtuples are useful little things
So in my little Phantasy Star 2 clone I'm working on, I'm finding that
I'm not using Sprites very often... by which I mean not at all.
Instead, I'm using a namedtuple with image and rect attributes like
so:
from collections import namedtuple
savebutton = namedtuple('savebutton','image, rect')
which is basically a very lightweight Sprite.
Anybody else using namedtuples much?
And on a completely unrelated note... is there any sort of gaming
library for Ruby? Like a pygame for ruby? I have been interested to
see what the ruby fuss is about but so far haven't had a reason to try
it when I can use frameworks like pygame and Django for all my
happiness needs... but still I'm curious.
Cheers!!
--
A musician must make music, an artist must paint, a poet must write,
if he is to be ultimately at peace with himself.
- Abraham Maslow