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

Re: [pygame] Advice on Game Engine



Daniel Dornhardt wrote:
So, for a Mario type game (example), you'll load one texture 'brick',

It might be fun (and a good exercise) to do a Robotron clone. Maybe I'll try it. (Hmm, an armed Buddhist saving humans by blasting their worldly desires? A raccoon rescuing lab animals from monsters?)


Ok, i'm babbling, but i just think that OpenGL is GREAT for 2d stuff, and you could always extend your 2d stuff with little 3d effects, think of stuff zooming into / out of the game, particle effects, lightning effects etc.

What about the GUI? Is there a way to draw my 2D landscape in fancy tilted 3D, then draw the menu at exactly certain pixel coordinates? Otherwise I have to draw a quad some distance into the background, texture it with the menu, and calculate where the user clicked just to do buttons.


I remember having thought 'there really should be an event mechanism implemented in python', either in the language or as an easy - to - use - extension. Has anyone advice on keeping python event driven programming simple and clear?

Have you heard of the "Model/View/Controller" system?
<http://cristobal.baray.com/indiana/projects/mvc.html>
It's one way to organize input and output. Another thing I've tried is keeping some of the event-processing code inside widgets. For instance I once built a Button class that knew its own coordinates. In the main input loop I said, "If mouse was clicked, go through the list of buttons and ask each one if coordinates (X,Y) are in them. If so, run button.Click()."


Kris