LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 07-26-2006, 10:22 PM   #1
vharishankar
Senior Member
 
Registered: Dec 2003
Posts: 3,142
Blog Entries: 4

Rep: Reputation: 121Reputation: 121
Anybody used pygame before? How easy is it to use?


I'm talking about fairly serious game programming using pygame. How easy/difficult is it to create a full fledged game using this kit and what are the strategies you would adopt in building a game skeleton/engine which can be used for serious game development?

What are the advantages and disadvantages of using pygame?
 
Old 07-27-2006, 01:21 PM   #2
CroMagnon
Member
 
Registered: Sep 2004
Location: New Zealand
Distribution: Debian
Posts: 900

Rep: Reputation: 33
I wrote up a clone of Tetris in about an hour using PyGame, and I'd never used it before, so I'd say it is pretty easy! I'm not sure what you mean by "serious" game development, but I'd say the most likely issue would be performance. If you take advantage of enough non-Python libraries where speed is important (e.g Ogre for 3D), and make use of Psyco, you should be able to do anything with reasonable performance requirements... what were you thinking of?

For game development strategies, I think this is probably not the best forum for such a question. There are sites devoted to game development that would probably give you more accurate and relevant information.
 
Old 07-28-2006, 07:38 AM   #3
vharishankar
Senior Member
 
Registered: Dec 2003
Posts: 3,142
Blog Entries: 4

Original Poster
Rep: Reputation: 121Reputation: 121
By "serious" I meant graphic-intensive and action-oriented games.

I tried using pygame and somehow I can never get used to python's object orientedness as opposed to C++. Maybe I'm too much into C++, but I find C++ classes far easier and more logical to use than python classes. Maybe it's the syntax.

Mind you, python looks very, very powerful and promising, but it's syntax to me is always a bit odd. I'm always ending my lines with a semicolon. And I'm not comfortable with how functions are called like this - for instance pygame.Class1.function(). To me I always feel that it's the object which should call the function and not the class.

Anyway, I guess if I do game programming on Linux, I'd choose SDL and C++. The only big problem is getting a good core engine for SDL in C++ going. Right now I'm hoping for any higher level game development library in C++/Linux which uses SDL (2d is ok, I am not looking for a 3d engine).
 
Old 07-28-2006, 10:39 AM   #4
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: ubuntu
Posts: 2,530

Rep: Reputation: 108Reputation: 108
Quote:
Originally Posted by Harishankar
And I'm not comfortable with how functions are called like this - for instance pygame.Class1.function(). To me I always feel that it's the object which should call the function and not the class.
I think that is not really different in python than it is in C++.

In python you normally call a method (or "member function") on an object, not a class. It is however possible to call to do "Class1.function()". But this concept of a "class function" also exists in C++.

IIRC, the equivalent call for python's "Class1.function()" in C++ is: "Class1::function()".
 
Old 07-28-2006, 04:05 PM   #5
CroMagnon
Member
 
Registered: Sep 2004
Location: New Zealand
Distribution: Debian
Posts: 900

Rep: Reputation: 33
Quote:
And I'm not comfortable with how functions are called like this - for instance pygame.Class1.function(). To me I always feel that it's the object which should call the function and not the class.
I'm not sure where you got the idea that this was having to use classes to call methods... it is subdivision of namespaces, like C# uses (System, System.Windows, System.Windows.Forms...). For example, the display functions are in a submodule of the overall pygame module. If you want to access the functions after only importing pygame, you have to do this:
pygame.display.set_mode(res)
because set_mode is in a file called display.py (or .pyd) under the pygame directory.

If this bothers you, you could do this instead:

from pygame import display

and then call display functions directly:

display.init()
display.set_mode(res)
 
Old 07-29-2006, 01:46 AM   #6
vharishankar
Senior Member
 
Registered: Dec 2003
Posts: 3,142
Blog Entries: 4

Original Poster
Rep: Reputation: 121Reputation: 121
Ah ok. Thanks for that info. Maybe the dot confused me. I know we can call static member functions or functions in namespaces like Class1::method1() in C++. But the usage is different and we don't use the same separator. Using the dot for everything something does confuse.
 
Old 07-29-2006, 09:17 AM   #7
vharishankar
Senior Member
 
Registered: Dec 2003
Posts: 3,142
Blog Entries: 4

Original Poster
Rep: Reputation: 121Reputation: 121
I'm going back to SDL C/C++ at the moment. Not that I can do a lot with that either. I'm just learning SDL but I don't want to confuse the pygame aspects of SDL with the SDL API itself.

SDL itself seems far far easier to learn than the monster DirectX, so I guess using its logical structure building a basic game using it should be fairly easy.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
pygame-1.6/is a tar file/need help master Slackware 1 11-26-2004 01:20 PM
Linux4RegularGuys - EASY FTP setup using vsftpd - READ THIS FOR EASY HELP DropHit Linux - Networking 4 11-25-2004 03:44 PM
Help installing pygame Mike2001 Linux - Software 1 09-11-2004 07:12 PM
Install pygame davholla Linux - Software 0 04-02-2004 06:37 AM
pygame kierwind Linux - Software 5 05-21-2003 05:19 AM


All times are GMT -5. The time now is 01:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration