[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Is it safe to subclass Pygame Channels and Sound classes?



That's normal. I usually subclass Sprites every time I use them. They even have methods set up that you are expected to override.

Paul Vincent Craven

On Mon, Jan 5, 2015 at 4:10 PM, Brian Madden <brian@xxxxxxxxxxxxxxxxxx> wrote:
Hi Everyone!

In my app I'm making heavy use of Pygame mixer's Channels and Sound objects. In both cases I need to add additional methods and attributes to them. Is my code is now, I have my own classes of each which reference related Pygame classes. (In other words, my "Channel" class has a bunch of things like the name, the priority of the sound that's currently playing, a reference to the Pygame Channel object, etc.)

My question is whether it's ok to subclass the actual Pygame mixer Channel and Sound classes for my use? I've never subclassed anything from an external module before, and I guess I'm wondering whether that's ok to do or whether that's frowned upon?

Thanks in advance!
Brian

--
Brian Madden