Forum: Python Jun 18th, 2009 |
| Replies: 3 Views: 311 there's not alot of info about it, but check the pygame website www.pygame.org |
Forum: Python Jun 18th, 2009 |
| Replies: 11 Views: 693 Well, I have a class imported from a file:
from lib.class import *
in the main program, I read a text file which outputs:
Vent( 100,300, 'Vent' )
I assign that string from the text file to a var... |
Forum: Python Jun 17th, 2009 |
| Replies: 11 Views: 693 Hate to bother you, but I have one more question. I have this string:
temp_string = "Vent( Screen, 100, 484, 'Vent' )"
and when I do exec:
exec(temp_string)
python doesn't return anything (like... |
Forum: Python Jun 17th, 2009 |
| Replies: 11 Views: 693 oh I see. lol with the stuff i'm working on, I won't need to worry about that, but thanks for the tip! |
Forum: Python Jun 17th, 2009 |
| Replies: 11 Views: 693 Thanks! but, why is the exec function is a risk? |
Forum: Python Jun 17th, 2009 |
| Replies: 11 Views: 693 I would be getting the string from a text file, but i'll try what you recommended |
Forum: Python Jun 17th, 2009 |
| Replies: 11 Views: 693 Hi all. Is there any way that if I give python a string, it can convert it into code? Example, say I am given this string:
string = "Class( 0,100 )"
Now I want to convert it into code:
Class(... |
Forum: Python Jun 15th, 2009 |
| Replies: 7 Views: 300 Seems like you are transitioning from c++/c to python. ( BTW when you have an if statement, you don't have to have parenthesizes around your expression). When you call a function, there is no need to... |
Forum: Python Jun 15th, 2009 |
| Replies: 13 Views: 921 If you wanted to start 2d games in python, I begin with pygame (a python port of SDL). There are tons of tuts everywhere, just have a look. Try www.pygame.org for more info. |
Forum: Python Apr 25th, 2009 |
| Replies: 4 Views: 668 thanks everyone!
I got it working just fine. all I needed was the __init__.py file and some code clean up! |
Forum: Python Apr 25th, 2009 |
| Replies: 4 Views: 668 hi everyone! I have two files, main.py and sprite_class.py. sprite_class.py is in a separate folder called lib. here's a quick diagram:
------------------------------------
/folder engine/
... |
Forum: Python Mar 28th, 2009 |
| Replies: 2 Views: 288 |
Forum: Python Mar 28th, 2009 |
| Replies: 2 Views: 288 Hi everyone. I'm having a little trouble trying to understand what argument passing really is. I know that it 'passes' arguments, but what does that actually mean and how can you use it to my... |
Forum: Python Mar 6th, 2009 |
| Replies: 4 Views: 534 thats good, but how would I say that each block is, for example, to the right other block + 50 pixels. Also, how would I specify the number of blocks so the program doesn't spawn blocks forever? |
Forum: Python Mar 2nd, 2009 |
| Replies: 4 Views: 534 thanks, but the only problem is that each instance of the object (in this, it would a cube that the player can collide with) needs to have specific code that will determine if it is touching the... |
Forum: Python Mar 1st, 2009 |
| Replies: 4 Views: 534 Hi everyone!
I am currently creating somewhat of a platformer/puzzle game in pygame and ran into a problem with creating levels. I really don't want to take the time to program collisions... |
Forum: Python Feb 12th, 2009 |
| Replies: 1 Views: 264 hey everyone. i am writing a program in python w/ Tkinter and ran into a problem with padding. So, i have a Label object named DataPool_Text. when I run it (side=TOP), it goes to the top middle of... |
Forum: Python Feb 1st, 2009 |
| Replies: 1 Views: 287 oops! sorry. anyways...
i'm a little fuzzy on all this socket server stuff, so try to bear with me. I want to users to be able to connect to each other. the code for my server is:
import... |
Forum: Python Feb 1st, 2009 |
| Replies: 1 Views: 287 Hello all. I'm working with pygame and are trying to implement some type of server. |
Forum: Python Jan 26th, 2009 |
| Replies: 2 Views: 1,492 does anyone know how to shutdown a computer on windows XP (using python of course ;) given the IP address and the computer name (probably don't need it, though)? I don't want to use os commands like... |
Forum: Python Sep 27th, 2008 |
| Replies: 1 Views: 922 hello everyone, just a quick question about pygame rotations.
If i have an image, say "image.bmp", how would I zoom in on that image? Thank in advanced |
Forum: Python Aug 21st, 2008 |
| Replies: 34 Views: 2,686 I'm still working on it, but I am working on including some code that will let you drag the ball around and throw it (hopefully more than just on the Y axis) and a Tk window that will let you change... |
Forum: Python Aug 21st, 2008 |
| Replies: 34 Views: 2,686 Thanks you very much! I understand the code now; I can't do "(ballSpeed[1]/4*3)", but in order for it to work, I must create separate variables for the numbers: "ypos = ypos + int(((velocity +... |
Forum: Python Aug 21st, 2008 |
| Replies: 34 Views: 2,686 thanks so much!
does python have an infinite varible? |
Forum: Python Aug 21st, 2008 |
| Replies: 34 Views: 2,686 I fixed the parenthesis, but it stops at loop 20. |
Forum: Python Aug 20th, 2008 |
| Replies: 34 Views: 2,686 That doesn't work: link. (http://i510.photobucket.com/albums/s342/besktrap/se4.jpg)
I don't see why it wouldn't work. |
Forum: Python Aug 20th, 2008 |
| Replies: 34 Views: 2,686 Sure; I promise to understand it. If I don't, I'll look online or the Pygame documentations for help.
I hate it when I make something, but I don't know how it works. |
Forum: Python Aug 20th, 2008 |
| Replies: 34 Views: 2,686 The first part of your code looks fine, but when you get to the ballSpeed[1]=((-ballSpeed[1]/4*3)) the math still doesn't work right. link: http://i510.photobucket.com/albums/s342/besktrap/-s3.jpg |
Forum: Python Aug 20th, 2008 |
| Replies: 34 Views: 2,686 I'm trying to make it multiply by 3/4 every time the ball hits the bottom of the screen, but it just loops on that if statment. |
Forum: Python Aug 20th, 2008 |
| Replies: 34 Views: 2,686 The first part of the code looks fine, but the math still doesn't work right. Link. (http://i510.photobucket.com/albums/s342/besktrap/-s3.jpg)
I though of just doing the math without... |
Forum: Python Aug 20th, 2008 |
| Replies: 34 Views: 2,686 Read the first page of posts. |
Forum: Python Aug 20th, 2008 |
| Replies: 34 Views: 2,686 I changed my code from "ballSpeed = [0,4]" to "ballSpeed[0.0,4.0]". It works for the first millisecond (changing 4 to -3), but then turns into 2.25, -1.6875, ect. Link to image.... |
Forum: Python Aug 20th, 2008 |
| Replies: 34 Views: 2,686 Ok so I changed the code (I forgot to remove to second pair of parenthesis. I don't think there is a difference between one or two pair of parenthesis):
ballSpeed[1] =... |
Forum: Python Aug 20th, 2008 |
| Replies: 34 Views: 2,686 I everyone! I'm having a little math trouble with a simple physics program I'm writing in python w/ pygame. If you notice in the code where it says: "((-ballSpeed[1]/4*3))", my ball on the screen... |
Forum: Python Aug 15th, 2008 |
| Replies: 2 Views: 1,078 thanks,but I meant actually setting an image for the cursor, life "mouse.bmp" or something like that |
Forum: Python Aug 14th, 2008 |
| Replies: 2 Views: 1,078 Anyone know how I would set an image for the cursor in Pygame? |
Forum: Python Jul 25th, 2008 |
| Replies: 1 Views: 596 how would I tell python (using pygame code) to do an event after a certain amount of time? Would I use pygame.time.Clock()? |
Forum: Python Jul 24th, 2008 |
| Replies: 1 Views: 517 Any one know where I can find the pygame code to create a screen where you can draw simple lines by click and dragging the mouse? I know how to create lines with the pygame.draw.line(screen,... |
Forum: Python Jul 22nd, 2008 |
| Replies: 4 Views: 536 as of right now, the square is just x and y. No rotations. |
Forum: Python Jul 22nd, 2008 |
| Replies: 4 Views: 536 Any idea where I could get some example code for something like this? |