<DIV>Whenever i run the game it says:</DIV>
<DIV> script 'A:\game folder\game.py' returned exit code 0</DIV>
<DIV> </DIV>
<DIV>If you want the bitmaps then let me know, i didn't want to send everyone an attachment, thanks again guys.</DIV>
<DIV> </DIV>
<DIV>Maybe some help? Thank you guys...here is the code. --Jeff</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><BR>import os, pygame<BR>from pygame.locals import *</DIV>
<DIV>if not pygame.font:print 'Warning, fonts disabled'</DIV>
<DIV> </DIV>
<DIV>def load_image(name, colorkey=None):<BR> fullname = os.path.join('data', name)<BR> try:<BR> image = pygame.image.load(fullname)<BR> except pygame.error, message:<BR> print 'Cannot load image:', fullname<BR> raise SystemExit, message<BR> image = image.convert()<BR> if colorkey is not None:<BR> if colorkey is -1:<BR> colorkey = image.get_at((0,0))<BR>
image.set_colorkey(colorkey, RLEACCEL)<BR> return image, image.get_rect()</DIV>
<DIV><BR>class Gun(pygame.sprite.Sprite):<BR> def __init__(self):<BR> pygame.sprite.Sprite.__init__(self)<BR> self.image, self.rect = load_image('gun.bmp', -1)<BR> self.punching = 0</DIV>
<DIV> def update(self):<BR> pos = pygame.mouse.get_pos()<BR> self.rect.midtop = pos<BR> if self.punching:<BR> self.rect.move_ip(5, 10)</DIV>
<DIV> def shoot(self, target):<BR> if not self.punching:<BR> self.punching = 1<BR> hitbox = self.rect.inflate(-5,-5)<BR> return hitbox.colliderect(target.rect)</DIV>
<DIV> def unshoot(self):<BR> self.punching = 0</DIV>
<DIV> <BR>class ship(pygame.sprite.Sprite):<BR> def __init__(self):<BR> pygame.sprite.Sprite.__init__(self)<BR> self.image, self.rect = load_image('new.bmp',-1)<BR> screen = pygame.display.get_suface()<BR> self.area = screen.get_rect()<BR> self.rect.topleft = 10, 10<BR> self.move = 9<BR> self.dizzy = 0</DIV>
<DIV> def update(self):<BR> if self.dizzy:<BR> self._spin()<BR> else:<BR> self._walk()</DIV>
<DIV> def _walk(self):<BR> change = self.rect.move((self.move, 0))<BR> if self.rect.left< self.area.left or \<BR> self.rect.right > self.area.right:<BR> self.move = -self.move<BR> change = self.rect.move((self.move, 0))<BR> self.image = pygame.transform.flip(self.image, 1, 0)<BR> self.rect = change </DIV>
<DIV> def _change(self):<BR> center = self.rect.center<BR> self.dizzy = self.dizzy + 12<BR> if self.dizzy >= 360:<BR> self.dizzy = 0<BR> self.image = self.original<BR> else:<BR> rotate = pygame.transform.rotate<BR> self.image = rotate(self.original, slef.dizzy)<BR> self.rect = self.image.get_rect()<BR> self.rect.center = center</DIV>
<DIV> def done(self):<BR> if not self.dizzy:<BR> self.dizzy = 1<BR> self.original = self.image<BR> <BR> def main():<BR>
pygame.init()<BR> screen = pygame.display.set_mode((480, 60))<BR> pygame.display.set_caption('Battleship')<BR> pygame.mouse.set_visible(0)</DIV>
<DIV> backround = pygame.Surface(screen.get_size())<BR> backround = backround.convert()<BR> backround.fill((250, 250, 250))</DIV>
<DIV><BR> screen.blit(backround, (0, 0))<BR> pygame.display.flip()</DIV>
<DIV> clock = pygame.time.Clock()<BR> new = New()<BR> gun = Gun()<BR> allsprites = pygame.sprite.RenderPlain((gun, new))</DIV>
<DIV> while 1:<BR> clock.tick(60)</DIV>
<DIV> for event in pygame.event.get():<BR> if event.type == QUIT:<BR> return<BR> elif event.type == KEYDOWN and event.key == K_ESCAPE:<BR> return<BR> elif event.type == MOUSEBUTTONDOWN:<BR> if
fist.punch(chimp):<BR> chimp.punched()<BR> elif event.type == MOUSEBUTTONUP:<BR> fist.unpunch()</DIV>
<DIV> allsprites.update()</DIV>
<DIV> screen.blit(backround, (0, 0))<BR> allsprites.draw(screen)<BR> pygame.display.flip()</DIV>
<DIV> if __name__ == '__main__':<BR> main()</DIV><p><hr SIZE=1>
Do you Yahoo!?<br>
<a href="http://antispam.yahoo.com/whatsnewfree">Protect your identity with Yahoo! Mail AddressGuard</a>