On Tue, Jul 19, 2011 at 2:50 AM, Jonathan Hartley <[email protected]>wrote:

>
> I may be wrong but I think these ideas of pickling Sprites are totally
> swimming against the current. It is much easier and more useful to only
> pickle simple value-type objects (e.g. integers and strings), and
> re-construct any required Sprites by calling the Sprite constructor as usual
> when you restart the application.
>
> A little gem I picked up a while ago: when serialising, you almost always
want to serialise the absolute minimum amount of data required to
reconstruct your current program state.

In other words, anything that your program has loaded from somewhere, can be
loaded again - no need to serialise it. Particularly for resources like
sprites, if your program has loaded the sprites in the first place, it
plainly knows how to load them again. Serialising sprites is just going to
duplicate your existing loading functionality, while bloating your save
files.
-- 
Tristam MacDonald
System Administrator, Suffolk University Math & CS Department
http://swiftcoder.wordpress.com/

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en.

Reply via email to