The Ur-Quan Masters Home Page Welcome, Guest. Please login or register.
Did you miss your activation email?
August 15, 2022, 01:50:41 am
Home Help Search Login Register
News: Paul & Fred have reached a settlement with Stardock!

+  The Ur-Quan Masters Discussion Forum
|-+  The Ur-Quan Masters Re-Release
| |-+  Starbase Café (Moderator: Death 999)
| | |-+  Python/Pygame
« previous next »
Pages: [1] Print
Author Topic: Python/Pygame  (Read 1568 times)
countchocula86
*Smell* controller
****
Offline Offline

Gender: Male
Posts: 345


Culture 20!


View Profile
Python/Pygame
« on: February 08, 2007, 08:22:28 pm »

I was just curious if anyone here had a good a knowledge of python/pygame or knows a good tutorial. I've never coded in anything before lol, but I'm curious (I kinda wanna make some shmups) and I was told python was the best combination of powerful/easy-to-learn.
I find, though, I'm having trouble with the 'module' concept, like how to import modules from pygame...and what the modules even do, etc.
Logged

I like to think you killed a man. It's the romantic in me.
youBastrd
Frungy champion
**
Offline Offline

Gender: Male
Posts: 67


It's real velour, just let yourself go.


View Profile WWW
Re: Python/Pygame
« Reply #1 on: February 09, 2007, 09:25:56 pm »

Python with PyGame is a pretty powerful combination.  It might be a little sharp of a learning curve to start with it right away.  Try it first, you might pick it up and love it.  If not, you might prefer something visual like Torque or Flash for your first language. 

The module concept is common to most programming languages.  The idea is that whenever possible, you should choose to reuse existing, tested, working, elegant code.  Some code is designed and written specifically for this purpose: those are called modules, or libraries.  Every language will have its own built in libraries, and most modern languages have large numbers of capable libraries.  The big idea from a programmer's point of view when using this libraries is that you can do everything you want much faster.  You don't have to, say, write software to examine a PC's video card, choose a operating system level driver, etc.  Instead, you just say "import PyGame" and it'll handle all that for you.  I'm not explaining this very well, just check out the 'pedia entry. Smiley


So here are some examples of such modules:
PyOpenGL (3D graphics)
PyGame (lots of gaming stuff wrapped together in a neat little package)
SDL (2D Graphics + input routines and lots more), SDL_mixer (sound effects etc)
PyODE (an open source physics engine)
There's probably ones for Ogg support and just about everything else you might need.  Dig around a little. Smiley

In Python, it's much easier to get started with these modules than other languages.  The idea is that you install the modules once on your PC via a setup.exe-type thing, then you only have to say "import pygame" to get access to all the functions and data structures from pygame.  Python "knows" where to find the library and what to do with it once it has been installed on your PC.  This is a much simpler process than in other languages.  That alone empowers you to do things quickly.  Python insulates you from a lot of the details like compiling libraries, and linking to them, and including headers and must be done in C or C++. 

Best of luck, hope that made a little sense at least  Smiley
Logged

Pages: [1] Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!