Thankyou for rounding help
you guys all said pretty much the same thing, use a .0 and the end or float() and they all worked. Thankyou so much Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ -- http://mail.python.org/mailman/listinfo/python-list
ROUNDING???
in python im doing the problem 255/494 it keeps giving me 0 instead of .51 what am i doing wrong? please help me I have been looking for hours Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs -- http://mail.python.org/mailman/listinfo/python-list
Multiple Bullets
In my game there are planes and I could make multiple bullets fired by the plane by keeping track of each bullets x and y coordinates. I was wondering if there is an easier way without keeping track of a 150 bullet coordinates. Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs-- http://mail.python.org/mailman/listinfo/python-list
Multiple keys?
while repeat: for event in pygame.event.get(): if event.type == (QUIT): pygame.quit() if (event.type == KEYDOWN): if (event.key == K_ESCAPE): pygame.quit() if (event.key == K_UP): Refresh() when I make an event with keys I use that model above. I have no idea how to do multiple keys at a time. I would like to make it so if i hold down and left the character moves down in left. Does anyone have any idea how to do that? Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs-- http://mail.python.org/mailman/listinfo/python-list
OMG please help
Here is the program I just started, The problem i am having is I'm trying to get it to load the image file Sand1 with eval(loader) = pygame.image.load(loader) because Loader is euqual to "Sand1" but It wont load it. If I set it as loader = pygame.image.load(loader) then it sets the image to the variable loader. So I'm basically trying to set a string equal to a surface variable. I dont want to have to go Sand1 = pygame.image.load("Sand1.bmp") for every image because I'm expecting there to be a lot of them when I am done. So hard to explain if you don't understand what I'm trying to get from it please let me know. import pygame from pygame.locals import * pygame.init() screen = pygame.display.set_mode( (150,150) ) background = pygame.Surface( screen.get_size() ) pygame.display.set_caption("Empire Strategy") pygame.key.set_repeat(1, 1) def LoadMaterial(): loader = loading + "1" eval(loader) = pygame.image.load(loader) loader = loading + "2" eval(loader) = pygame.image.load(loader) loader = loading + "3" eval(loader) = pygame.image.load(loader) loader = loading + "4" eval(loader) = pygame.image.load(loader) loader = loading + "R" eval(loader) = pygame.image.load(loader) loader = loading + "L" eval(loader) = pygame.image.load(loader) loader = loading + "T" eval(loader) = pygame.image.load(loader) loader = loading + "D" eval(loader) = pygame.image.load(loader) loader = loading + "TR" eval(loader) = pygame.image.load(loader) loader = loading + "TL" eval(loader) = pygame.image.load(loader) loader = loading + "BR" eval(loader) = pygame.image.load(loader) loader = loading + "BL" eval(loader) = pygame.image.load(loader) loading = "Sand" LoadMaterial() pygame.display.update() repeat = True while repeat: for event in pygame.event.get(): if event.type == (QUIT): pygame.quit() if (event.type == KEYDOWN): if (event.key == K_ESCAPE): pygame.quit() if event.type == MOUSEBUTTONDOWN: if event.button == 1: position = pygame.mouse.get_pos() Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping -- http://mail.python.org/mailman/listinfo/python-list
Seperate Files
I'm attempting to create a game and right now the game has 6000 lines of code and is confusing me. I have seen it done but have no idea how to do it, but I would like to use seperate files and incorporate them together. One for my units, one for the map maker, one for the playing part. Any ideas on how to do that? Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs-- http://mail.python.org/mailman/listinfo/python-list
Rounding
if i have a number 6.345 and i wanted it to be 6 without subtracting .345 because it won't always be .345 what do i do? how do i round to the nearest whole number. Or in this case round down. Is there an easy way to round down to the nearest whole number? Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs -- http://mail.python.org/mailman/listinfo/python-list
what the heck does this mean?
Traceback (most recent call last): File "C:\Python25\empire\Empire Strategy.pyw", line 322 Maty = Searched(number) TypeError: 'list' object is not callable My list is NewMap1 =[0,0,0,0,0,0,2,0,2,2,3,2,0,0,0,0] so Maty Searched(number is supposed to give me 0 when Search = "NewMap" number = 0 bignum = 1 bignumer = repr(bignum) Searching = Search+bignumer Searched = eval(Searching) Maty = Searched[number] instead i get that error whats up? i thought it is suppose to give me NewMap1(0).when I print it it works fine and gives me the result 0 but when I go to save the number as Maty-(randomletters) it keeps giving me the stupid error. please help Ps: rather than doing in your head making a test prgram to run exactly that might be better Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping-- http://mail.python.org/mailman/listinfo/python-list
[no subject]
I tried googling and yahooing to find the answer and there was to many conflicting results so i just decided to ask to simple question here. How do i could the number of letters in a string no a single letter all of them. ex. 'Count this String' should turn into an integer saying 17 Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs-- http://mail.python.org/mailman/listinfo/python-list
[no subject]
Nevermind I always seem to find the answer on my own after i post the topic. i used len(string) and it counted the letters in string... why do I always do this Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ -- http://mail.python.org/mailman/listinfo/python-list
Fw:
WAHHH! for all of you who helped thankyou all of your ideas worked perfectly. I found what was causing the error and corrected. thankyou for the replies. Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs-- http://mail.python.org/mailman/listinfo/python-list-- http://mail.python.org/mailman/listinfo/python-list
Fw:
I'm sorry this is the error Traceback (most recent call last): File "C:\Python25\empire\Empire Strategy.pyw", line 1788, in eval(NewMap1, {}, {}) File "", line 1 Tropical Islands ^ SyntaxError: invalid syntax - Forwarded Message From: katie smith <[EMAIL PROTECTED]> To: python-list@python.org Sent: Tuesday, December 11, 2007 5:55:46 PM Subject: I tried your suggestions and all that came up was the error Traceback (most recent call last): File "C:\Python25\empire\Empire Strategy.pyw", line 1788, in NewMap1= eval (NewMap1, {}, {}) File "", line 1 Tropical Islands ^ SyntaxError: invalid syntax And what is this about trusting your source? The string is taken exactly from another part in the program so I know for sure it is correct if that is what that means. Never miss a thing. Make Yahoo your homepage. Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping-- http://mail.python.org/mailman/listinfo/python-list
[no subject]
I tried your suggestions and all that came up was the error Traceback (most recent call last): File "C:\Python25\empire\Empire Strategy.pyw", line 1788, in NewMap1= eval (NewMap1, {}, {}) File "", line 1 Tropical Islands ^ SyntaxError: invalid syntax And what is this about trusting your source? The string is taken exactly from another part in the program so I know for sure it is correct if that is what that means. Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping-- http://mail.python.org/mailman/listinfo/python-list
[no subject]
How on earth do I convert strings to lists. I have a string with a list it in it and I'm trying to convert it into a list. Please help me. Ex."[16, 16, 2, 16, 2, 16, 8, 16]"-string to [16, 16, 2, 16, 2, 16, 8, 16] -list Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping-- http://mail.python.org/mailman/listinfo/python-list
Screen Shots?
UGH so frustrating. In my game there is a minimap. On top of the minimap is a window showing the part of the map your viewing. The minimap is composed of other little pictures piled of top of eachother. I want to know how to basically take a picture from ex.((50,50),to (150,150)) and blit the mini window image on top of it. hard to explain but everytime I move the window box I don't want to redo the window with its couple hundred compiled image. I need to copy picture and make it into a surface??.. I dont even know. Any help would be greatly appreciated Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how. http://overview.mail.yahoo.com/-- http://mail.python.org/mailman/listinfo/python-list