Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: python games

  1. #1
    New Coder
    Join Date
    Jan 2010
    Posts
    76
    Thanks
    3
    Thanked 0 Times in 0 Posts

    python games

    i started reading up on python as my 1st programming language, but im interested in making some simple 2D games. should i learn a different programming language instead of python? i know its capable of making games but is it really what that language is intended for? im looking for a simple programming language thatll handle making pretty decent 2D games.

  • #2
    Regular Coder
    Join Date
    Dec 2007
    Posts
    137
    Thanks
    1
    Thanked 21 Times in 21 Posts
    Python is a nice language, easy to learn and it's multi-purpose. I enjoy it a lot. As for your question, I don't think it's a matter of if a language is intended for game making, but whether a language has a good game library or game framework available for the language.

    Python has a number of game libraries like:

    PyGame
    PyGlet
    PyCap
    ika
    Cocos2d - As a sidenote about Cocos2d, it was also later ported to Apple iOS/Objective-C as Cocos2d for iPhone and has become real popular with iPhone/iPad developers, which I've used too (but you'll have to know Objective-C obviously if doing iPhone apps).
    RenPy - you can make some nice graphic adventure games aka. Visual Novels with this game engine.

    Galcon, a popular game, was made with Python using PyGame
    http://aigamedev.com/open/interviews...con-python-ai/

    Several commercial games use Python as a scripting language, like Civilization (IV, I think?).

    But to answer your question about which language to use, it depends on your goals. If you are just trying to learn programming and want something to program, in your case a 2d game, then Python is more than fine.

    If you need a GUI in Python you can use Tkinter or probably more preferably, wxPython.

    Having said that, if you are on a Windows machine, and you are more serious about game making, then you may want to consider learning C# and the Microsoft Dot Net framework by using Visual Studio 2010 IDE with the XNA Game Studio. Microsoft has some really nice development tools for game making, both 2d and 3d, and you can make games for Windows, Windows 7 phone and even XBOX 360.

    They have a free development kit that includes Visual Studio 2010 Express and XNA Game Studio 4.0 available here:
    http://create.msdn.com/en-us/home/getting_started

    C# is a really nice language and is similar to Java, but with some improvements since C# has been continually evolving and is now at version 4.0. Visual Studio, the coding/development editor, is a really nice IDE and the XNA Game Studio will provide you with a professional level gaming framework.

    Of course there are gaming libraries/frameworks for other languages, like Java and C++, as well, but probably not as slick as Microsoft's unless you pay for it.

    So in short to answer your question, Python is perfectly fine for making 2D games with using various game libraries. If you wanted to do something more robust, then consider C# with Microsoft's development stack.

  • #3
    New Coder
    Join Date
    Jan 2010
    Posts
    76
    Thanks
    3
    Thanked 0 Times in 0 Posts
    well right now ive been having a problem with pygame source files.
    i tried downloading some games off of pygame.org to see what the games r like that i could possibly make and i cant get them to run. i keep getting this error from all the games i try.

    Code:
    Traceback (most recent call last):
      File "I:\Python25\run_game.py", line 1, in <module>
        import lib
      File "I:\Python25\lib\__init__.py", line 8, in <module>
        import factories
    ImportError: No module named factories
    i have everything in lib, i tried in cmd, pygame is installed right and i have the right versions of python and pygame. i put in print pygame.ver and get the version number back so it has to be installed right. i dont know waht else to try =/

  • #4
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    8
    Thanks
    3
    Thanked 0 Times in 0 Posts
    what version of python are you using? python 3?

  • #5
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    8
    Thanks
    3
    Thanked 0 Times in 0 Posts
    I think you want to say:

    Code:
    from lib import *
    and:

    Code:
    from factories import *
    when you type:

    Code:
    import lib
    or:

    Code:
    import factories
    that is more like java. In order to import your libraries or other python files, its a different syntax.


  • #6
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by favelam View Post
    what version of python are you using? python 3?
    if is not a installation mess i guess is 2.5 ?

    Edit:
    welcome to cf,
    - the thread is old
    - the path to factories or missing __init__.py somewhere could also be a problem
    - importing everything * is usualy not a good idea

    best regards
    Last edited by oesxyl; 02-15-2011 at 03:13 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •