LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 05-14-2004, 11:23 PM   #1
r3dhatter
Member
 
Registered: Dec 2003
Distribution: Debian (testing)
Posts: 210

Rep: Reputation: 30
Best python tutorial for programming games.


I have learned the basics of C++, but that language is taking up too much time that I do not have to put into learning all of it yet. So, I figured I will just learn python and pygame to make games.



I have no expierence with python and very very little with C++ (only learned basics like variables, if statements, operators, cout, for, etc...just the small stuff)



I looked for tutorials on python, but I have not found too many good ones yet. Anyone have a recommended tutorial for python and pygame for programming games? Preferably printable.


I really want to start making simple games soon, so the plan is to learn python, then pygame, and start making games.

Thanks
 
Old 05-15-2004, 12:37 AM   #2
Axion
Member
 
Registered: Jan 2003
Location: Albany, NY
Distribution: Slackware 9.1, Gentoo 2004.1
Posts: 153

Rep: Reputation: 30
I'm learning Python too...start with this if you aren't familiar with the language at all it will get you ready to understand the tutorials on python's homepage, or any gaming tutorials.

Non Programmers Tutorial for Python
 
Old 05-15-2004, 07:38 AM   #3
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Once you know about python, I'd recommend this tutorial to leran about moving graphics around the screen:

http://kai.vm.bytemark.co.uk/~piman/...tutorial.shtml
 
Old 05-15-2004, 09:35 AM   #4
r3dhatter
Member
 
Registered: Dec 2003
Distribution: Debian (testing)
Posts: 210

Original Poster
Rep: Reputation: 30
Thanks, now as far as environment for developing games with python. Could I just use anjuta or a simple text editor and python shell? Or is there better stuff out there.

Also, how do you compile a python program?
 
Old 05-15-2004, 10:38 AM   #5
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Quote:
Also, how do you compile a python program?
You don't.
 
Old 05-15-2004, 11:14 AM   #6
r3dhatter
Member
 
Registered: Dec 2003
Distribution: Debian (testing)
Posts: 210

Original Poster
Rep: Reputation: 30
I am confused then. Say I write out a game in python. Then what do I do with it to put it together and play it?
 
Old 05-15-2004, 11:49 AM   #7
tigerflag
Member
 
Registered: Aug 2002
Location: Phoenix, AZ
Distribution: PCLinuxOS 2012.08
Posts: 430

Rep: Reputation: 30
Here's a GREAT book!

"Python Programming for the Absolute Beginner" by Michael Dawson

Michael Dawson is a games programmer. Each chapter is a project of writing a game in order to learn Python. Loopy strings, lists, functions... he has a new game to write in each chapter in order to learn these things. It a fun book!

I got mine from www.bookpool.com

Siri Amrit
 
Old 05-15-2004, 11:53 AM   #8
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
I this respect, python is like perl: It's basically a scripting language, so you just run your program with "python your_prog.py" and it will be compiled (as far as compiling is actually involved) and the resulting byte-code is cached for the next run. All automatically.

Or put this as the first line of your python script:

#!/usr/bin/env python

..and make it executable with: "chmod +x your_prog.py"

Read the tutorial(s), and you'll learn this.
 
Old 05-16-2004, 09:33 PM   #9
r3dhatter
Member
 
Registered: Dec 2003
Distribution: Debian (testing)
Posts: 210

Original Poster
Rep: Reputation: 30
Just have a couple quick questions.

num = input("enter first number :")
num2 = input("enter second number :")
#is this supposed to be str or just function?
str funtion = raw_input("enter the function you want: *, /, -, +: ")
if str function = *:
print num "*" num2 "=",num*num2

And why won't it say:
enter first number : user inputs num
enter second number: user inputs num2
enter function you want: user inputs function


Then it gives me a syntax error on my if statement...I know this is simple, but I am not sure why I can't do this.


Then for a second question:
There is a program for the palm called pippy 0.7 which has python 1.5.2, my home computer has 2.3. Will I be able to use them and they will still be compatible? (ie: type code on home, port to palm and still work?)

Thanks
 
Old 05-17-2004, 04:43 AM   #10
davholla
Member
 
Registered: Jun 2003
Location: London
Distribution: Linux Mint 13 Maya
Posts: 729

Rep: Reputation: 32
Re: Here's a GREAT book!

Quote:
Originally posted by tigerflag
"Python Programming for the Absolute Beginner" by Michael Dawson

Michael Dawson is a games programmer. Each chapter is a project of writing a game in order to learn Python. Loopy strings, lists, functions... he has a new game to write in each chapter in order to learn these things. It a fun book!

I got mine from www.bookpool.com

Siri Amrit
I agree with the above post although you probably will need another book to learn python as well. However buy this one it is good.
 
  


Reply



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
Programming in C Tutorial Mercurius Programming 22 05-08-2006 05:01 PM
Cedega/Wine games Installation tutorial Struck Linux - Games 2 10-26-2005 08:48 AM
Python Tutorial Zuggy Programming 2 11-18-2004 06:02 AM
Good tutorial on AnyGui in Python... indian Linux - Software 0 09-24-2004 02:29 AM
looking for X programming tutorial (C or C++) qwijibow Programming 1 02-02-2004 08:33 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:09 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
Open Source Consulting | Domain Registration