def __init__(self, owner, ammo, filename): self.scale=1 self.posmult = 0.01 self.image = display.loadtex(filename) self.loadimage = display.loadtex("nothing.png") self.owner = owner self.ammo = ammo ammo(0,0,None) self.length = 0.001 self.shooting = False self.timetofire = 0 self.firedelay = 15
def __init__(self, xp,yp,owner): basebomb.__init__(self,owner,xp,yp) #self.xvel+=random.randrange(-10,10) #self.yvel+=random.randrange(-10,10) self.image = display.loadtex("dirtclod.png") self.pix = display.loadpixID("dirtclod.png") self.destalpha = 235
def __init__(self, xp,yp,owner): basebomb.__init__(self) self.owner = owner self.x = float(xp) self.y = float(yp) self.image = display.loadtex("shell.png") self.radius = 50
def __init__(self, xp,yp,owner): basebomb.__init__(self,owner,xp,yp) self.image = display.loadtex("empty.png") self.pix = display.loadpixID("brick.png") self.destalpha = 35 self.radius = 15 self.maxbounces = 5
def __init__(self, xp,yp,owner): basebomb.__init__(self,owner,xp,yp) self.image = display.loadtex("bullet.png") self.radius = 9 self.scale = 1 self.drag = 0.995 self.grav = 0.1 self.maxbounces=2
def __init__(self, xp,yp,owner): basebomb.__init__(self) self.owner = owner self.x = float(xp) self.y = float(yp) self.image = display.loadtex("smoke.png") self.destalpha = 15 self.radius = 25
def __init__(self, owner): self.image = display.loadtex("grapple.png") self.on = 0 self.owner = owner self.x = 0 self.y = 0 self.length = 0 self.angle = 0
def __init__(self, xp,yp,owner): basebomb.__init__(self) self.owner = owner self.x = float(xp) self.y = float(yp) self.image = display.loadtex("shellBFG.png") self.destalpha = 15 self.radius = 150 self.scale = 2.5
def __init__(self, xp,yp,owner): basebomb.__init__(self) self.owner = owner self.x = float(xp) self.y = float(yp) self.image = display.loadtex("fire.png") self.destalpha = 15 self.radius = 25 self.scale = 1 self.bouncing = 1 self.maxbounces = 500 self.totalmoves=75
def __init__(self,x,y,image,scale,startspeed, colour=[1,1,1]): xv = (random()*10-5)*startspeed yv = (random()*10-5)*startspeed baseparticle.__init__(self,x+xv,y+yv,xv,yv,image) self.x+=xv*(scale*1.4+8) self.y+=yv*(scale*1.4+8) self.scale = scale self.grav = random()*0.4-0.25 self.totalmoves = 15.0 self.startmoves = 25.0 self.colour = colour self.image = display.loadtex(image)
def __init__(self, xp,yp,owner): basebomb.__init__(self,owner,xp,yp) self.image = display.loadtex("arrow.png") self.pix = display.loadpixID("arrow.png")
def __init__(self, xp,yp,owner): basebomb.__init__(self,owner,xp,yp) self.image = display.loadtex("drillgrenade.png") self.destalpha = 35 self.radius = 50 self.maxbounces = 9
def __init__(self, xp,yp,owner): arrow.__init__(self,xp,yp,owner) self.image = display.loadtex("grapple.png") self.pix = display.loadpixID("grapple.png")
def __init__(self, gamestate, name, netdata): self.isbot = 0 self.healthscale = 1 self.kills = 0 self.damagedealt = 0 self.msinx = 300 self.msiny = 300 self.camx = 1 self.camy = 1 self.gmx = 0 self.gmy = 0 self.reset() self.gamestate = gamestate self.name = name self.netdata = netdata self.landcolour=[1,1,1] self.cx = self.x self.cy = self.y+8.0 self.image = display.loadtex("minimar.png") self.runs = [display.loadtex("run1.png"), display.loadtex("run2.png"), display.loadtex("run3.png"), display.loadtex("run4.png"), display.loadtex("run5.png")] self.runanim = 0 self.jumps = [display.loadtex("jump1.png"), display.loadtex("jump2.png")] #self.pix = display.loadpix("minimar.png") self.bullets = [] self.onground = 0 self.wasonground = 0 self.guns = [] #self.guns.append(rope.rope(self)) self.guns.append(weapons.chaingun(self)) self.guns.append(weapons.sword(self)) self.guns.append(weapons.shotgun(self)) self.guns.append(weapons.bazooka(self)) self.guns.append(weapons.uzi(self)) self.guns.append(weapons.redeemer(self)) self.guns.append(weapons.gravgun(self)) self.guns.append(weapons.bow(self)) self.guns.append(weapons.bridgegun(self)) self.guns.append(weapons.dirtthrower(self)) self.guns.append(weapons.dirtsprayer(self)) self.guns.append(weapons.digger(self)) self.guns.append(weapons.grenadelauncher(self)) self.guns.append(weapons.hominbow(self)) self.guns.append(weapons.guidedbow(self)) self.gunid = 0 self.gun = self.guns[self.gunid] self.altgun = rope.rope(self) #self.jumpsound = pygame.mixer.Sound('ouh.ogg') self.upkey = 0 self.dnkey = 0 self.ltkey = 0 self.rtkey = 0 self.jumpkey = 0 self.digkey = 0 self.crouchkey = 0 self.shootkey = 0 self.grapplekey = 0 #these were dodge self.xvel = 0 self.yvel = 0 self.vel = 0 self.movesleft = 0 self.xn = 0 self.yn = 0 self.mx = 0 self.my = 0 self.tnx = 0 self.tny = -1 self.dnx = 0 self.dny = -1 self.lastdig = 0 self.aimgle = 0 #self.onground = 0 self.canjump = 1 self.jumpwait = 0
#from pygame.locals import * import pygame.locals as pgl surfarray = pygame.surfarray #if not surfarray:raise ImportError #except ImportError: # raise ImportError, 'need pygame and numeric' import settings from math import hypot pygame.init() import display display.loadtex("nothing.png") import terrain #import walker, ball, player #walker is like a lemming, and ball a simpler player import player import timer, time import simplenet import particles import menu #from cPickle import * #import zlib #from zlib import * import OpenGL.GL as GL pygame.display.set_caption("NeinJarz")