tags:

views:

209

answers:

2

Ever played the game Monopoly Tycoon? I think it's great. I would love to remake it. Unfortunately, I have no experience when it comes to 3D programming. I imagine there's a relatively steep learning curve when it comes to openGL stuff, figuring out what is being clicked on and so on...

If you were to undertake this task, what libraries would you need?

+6  A: 

pyGame seems quite mature and builds on top of the proven SDL library.

Skurmedel
+1 Pygame is very mature, and built on top of clibraries, so its relatively fast for what it is.
windfinder
+4  A: 

I'd use pyglet. It's all opengl from the start, doesn't build on top of ugly SDL library and has better interfaces than what I've seen on other python's multimedia libraries.

import pyglet
from pyglet.gl import *

class Application(object):
    def __init__(self):
        self.window = window = pyglet.window.Window()
        window.push_handlers(self)

    def on_draw(self):
        self.window.clear()
        glBegin(GL_TRIANGLES)
        glVertex2f(0,0)
        glVertex2f(200,0)
        glVertex2f(200,200)
        glEnd()

if __name__=='__main__':
    app = Application()
    pyglet.app.run()

I wrote this from scratch to show you a reference. You can pretty much start from that.

There's couple of useful things in the library like vertex lists, textures, scheduling, unicode fonts, a little bit of UI components, event dispatching, audio. The library itself is messy inside and I didn't like it too much. But then this is my opinion from every library that has widespread and that I've looked into.

Myself I'm dissatisfied to the opengl namespacing. It'd be better with non-C namespace in the front. This'd leave you in some flexibility:

from pyglet.gl import Begin, Vertex2f, TRIANGLES, End

...
    Begin(TRIANGLES)
    Vertex2f(0,0)
    Vertex2f(200,0)
    Vertex2f(200,200)
    End()
Cheery
pyglet is actually what i was planning on using... i just wanted to make sure there wasn't anything better. i guess i'll stick with it.
carrier
Mind telling us why SDL is ugly?
Skurmedel
Mind telling us why SDL is not ugly?!
Daz
That is not a very constructive remark is it?
Skurmedel
The 'ugly' mention about SDL is not point of this post, just my opinion. SDL has some little design errors, like messing up badly with multiple windows and their events, providing that ridiculously poor joystick support is also just numb payload, as well as that otherwise useless function for getting keystates when you have the event pool (lowest-common-denominator libraries shouldn't have anything you could remove without dropping much functionality).
Cheery
Okay. Thanks for clarifying.
Skurmedel