<div>Hey There Everyone,</div> <div> </div> <div>I'm following an example in a book and I can't find the error that's preventing this program from running. It's just an example of how to get a sprite moving. The images are all in the right folder. I can run the program and get a stationary sprite to appear. The trouble seems to come up when I add "dx" and "dy" Here's the code.</div> <div> </div> <div> </div> <div>from livewires import games</div> <div> </div> <div>SCREEN_WIDTH = 640<BR>SCREEN_HEIGHT = 480</div> <div> </div> <div>class Pizza(games.Sprite):<BR> """A falling pizza."""<BR> def __init__(self, screen, x, y, image, dx, dy):<BR> """Initialize pizza object."""<BR> self.init_sprite(screen = screen, x = x, y = y, image =
image,<BR> dx = dx, dy = dy)</div> <div> </div> <div>#main<BR>my_screen = games.Screen(SCREEN_WIDTH, SCREEN_HEIGHT)</div> <div>wall_image = games.load_image("skywall.png", transparent = False)<BR>my_screen.set_background(wall_image)</div> <div>pizza_image = games.load_image("pizza.png")<BR>Pizza(screen = my_screen, x = SCREEN_WIDTH/2, y = SCREEN_HEIGHT/2,<BR> image = pizza_image, dx = 0, dy = 1)</div> <div> </div> <div>my_screen.mainloop()</div> <div> </div> <div>___________</div> <div> </div> <div> </div> <div>Here's the error message:</div> <div><BR> </div> <div>Traceback (most recent call last):<BR> File "C:/Python25/Chapter 11/movingsprite.py", line 25, in <module><BR> image =
pizza_image, dx = 0, dy =1)<BR> File "C:/Python25/Chapter 11/movingsprite.py", line 15, in __init__<BR> dx = dx, dy = dy)<BR>TypeError: init_sprite() got an unexpected keyword argument 'dx'</div> <div> </div> <div> </div> <div>Thanks in advance for any help you can give me. :-)</div><p> 
<hr size=1>Never miss a thing. <a href="http://us.rd.yahoo.com/evt=51438/*http://www.yahoo.com/r/hs"> Make Yahoo your homepage.</a>