[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Pygame
Richard Jones wrote:
I'm not sure what you're referring to with "efficiency". You first paragraph
refers to unrealscript being OO. Python's OO too. Everything you state in
that paragraph can apply in Python (ie. everything in Python is an object).
the one thing unrealscript has is it's state machine and latent
funcitons built into the language. i've never seen or heard anything
else like it. in a clumsy way it could perhaps be emulated with
generators or iterators or something in python.
the latent functions are like 'blocking functions' that don't actually
block the game. so in your monster class if you say 'sleep(5)' the
character will sleep for 5 ticks, but the game doesn't hang up. more
importantly than sleep you can do things like 'waitfordoortofinishopening()'
states aren't too different from regular classes in python. each unreal
game object must have a current state. the methods in the state override
any methods of the base object it belongs to. the states have code in
themselves which runs repeatedly until a new state is switched to.
the code in the states has labels/markers so you can jump into specific
points in a state. i believe this allows you to more easily to
entry/exit code, but i'm not sure.
there's plenty of info about all this online. i've never used it, just
glancingly gone through information about it.
http://wiki.beyondunreal.com/wiki/UnrealScript_Language_Reference/States
--
"Neither will I tell you by what authority I do these things"
pete*shinners.org