def setUpPlayer (self, pos, clrBase = None, clrTurret = None): if self.side == 'player': self.maze.addPlayer (self) self.pos = pos self.vel = 0 self.cooldownTimer = 0 self.viewTheta = math.pi / 8 self.base = Graphics.cube (clrBase) self.base.transform (Matrix.scale (7.5, 7.5, 3.75)) self.base.translate (self.pos.x (), self.pos.y(), 10) self.turretp1 = Graphics.icosahedron (clrTurret) self.turretp1.transform (Matrix.scale (5, 5, 5)) self.turretp2 = Graphics.cube (clrTurret) self.turretp2.transform (Matrix.scale (1, 7.5, 1)) self.turretp2.translate (0, 3.5, 0) self.turret = self.turretp1.union (self.turretp2) self.turret.translate (self.pos.x (), self.pos.y(), 0) self.theta = 0 self.turretTheta = 0 self.changeAngle (math.pi / 4) self.alive = True
def setPositionVelocity (self, pos, vel): self.pos = pos self.vel = vel self.bulletObject = Graphics.icosahedron () self.bulletObject.translate (pos.x (), pos.y (), 5)