Computer Science Canada School Alpha Program *NEED HELP* |
Author: | matt4521 [ Tue Sep 18, 2012 9:35 am ] | ||||
Post subject: | School Alpha Program *NEED HELP* | ||||
Me and my partner have been working on this error for hours.... when calling the allsprites update function it gives us a argument error. If someone could point us in the right direction or even just boldly tell us where we are going wrong that will greatly be appreciated!! ********************************************************************* Traceback (most recent call last): File "F:\Alpha\alpha program.py", line 137, in <module> allsprites.update() File "C:\Python32\lib\site-packages\pygame\sprite.py", line 462, in update s.update(*args) TypeError: update() takes exactly 2 arguments (1 given) import pygame,sys,os, time from pygame.locals import * *********************************************************************
Mod Edit: Pleas wrap you code in either of the following in order to preserve whitespace to highlight the syntax.
|
Author: | Zren [ Wed Sep 19, 2012 8:12 pm ] |
Post subject: | Re: School Alpha Program *NEED HELP* |
I'm going to guess that pygame.sprite.RenderPlain is a sprite group. http://www.pygame.org/docs/ref/sprite.html#Group.update I'm also going to guess that redcircle.update([0, 10]), which requires 2 arguments (self, move) are not being supplied when you call allsprites.update(). Suggestion: your input section shouldn't call update() but instead a new method called move(x, y) which will call whatever movement code. You can improve on this design a velocity variable. Improve on that with acceleration, and so on until you've a amateur physics engine. |
Author: | matt4521 [ Thu Sep 20, 2012 9:47 am ] | ||
Post subject: | Re: School Alpha Program *NEED HELP* | ||
OK so we have made a few changes and things have started to work... but now were attempting to print Text to the screen and we can't seem to get it working.... this is our updated code to date...
|
Author: | Zren [ Thu Sep 20, 2012 7:41 pm ] | ||
Post subject: | RE:School Alpha Program *NEED HELP* | ||
Traceback <module> C:\Users\Admin\Desktop\New folder (3)\module1.py 168 update C:\Users\Admin\Desktop\New folder (3)\module1.py 59 AttributeError: 'tuple' object has no attribute 'get_rect' Error on this line: text = pygame.font.render = ("Collision:", self.collide) There's also another error here.
There's also another error after that... Seriously... =.=' |