def __init__(self,f,hit_paddle,TIME,X,Y,orignal,BRICK,POWER,points,level,level_time,ufo_x,ufo_y,ufo_health):
		# Thses all written below are instance variables
		# methods are the functions which are defined in the class to manipulate these attributes
		# self is an object
		self.x = X
		self.y = Y
		self.f = f
		self.hit_paddle = hit_paddle
		self.orignal = orignal
		self.bricks = BRICK
		self.power = POWER
		self.points = points
		self.level = level
		self.level_time = level_time
		self.ufo_x = ufo_x
		self.ufo_y = ufo_y
		self.ufo_health = ufo_health
		self.paddle = Paddles(self.x,self.y,self.orignal,self.bricks,self.power,self.points,self.level)
		self.ball = Balls(self.x,self.y,self.orignal,self.bricks,self.power,self.points,self.paddle)
		self.bomb = Bombs(self.x,self.y,self.orignal,self.bricks,self.power,self.paddle,self.ball,self.level,self.ufo_x,self.ufo_y,self.ufo_health)
		self.brick = Bricks(self.x,self.y,self.orignal,self.bricks,self.power,self.points,self.paddle,self.ball)
		self.powerup = PowerUps(self.x,self.y,self.orignal,self.bricks,self.power,self.points,self.paddle,self.ball,self.brick)
		self.board = Board(self.x,self.y,self.orignal,self.bricks,self.power,self.points,self.paddle,self.ball,self.brick,self.powerup)
		self.time = TIME
		self.GAMEOVER = False
Beispiel #2
0
    def __init__(self,
                 renderingSurface,
                 bgcolor=(0, 0, 0),
                 size=(1280, 720),
                 thickness=3,
                 autoscroll=[2, 0],
                 ratio=(1, 1),
                 successound=None):
        self.renderingSurface = renderingSurface
        self.surface = pygame.Surface(size)
        self.ratio = ratio
        self.bgcolor = bgcolor

        self.spawnpoint = 600 * ratio[1], 200 * ratio[1]

        self.player = Player(self.surface,
                             x=self.spawnpoint[0],
                             y=self.spawnpoint[1],
                             speed=autoscroll[0],
                             ratio=self.ratio)
        self.flamewall = animatedPng(self.renderingSurface,
                                     "./graphic/flamewall", 50, (40, size[1]))
        self.raspberry = pygame.image.load("graphic/raspberry.png").convert()
        self.raspberry = pygame.transform.scale(
            self.raspberry, (int(100 * ratio[1]), int(126 * ratio[1])))
        self.raspberry.set_colorkey((255, 255, 255))

        #self.ground = (x,y,length,(r,b,g))
        #self.walls = (x,y,height,(r,b,g)) height nach unten gerichtet
        #self.decolines = [x1, y1, x2, y2, z, thickness,(r,g,b)]
        #self.texts = [x,y, "text", size, [r,g,b]]
        #self.coins = (x,y,(r,b,g), wert)

        self.ground = [[1, 600 * self.ratio[1], 800, [64, 169, 64]]]
        self.stumble = []

        self.walls = []
        self.decolines = []
        self.powerups = [
        ]  #[[1200,500,"random"], [1400,500,"random"], [1800,500,"random"]]
        self.enemies = []

        self.groundManager = Grounds(self.surface, self.ground, self.ratio)
        self.wallManager = Walls(self.surface, self.walls, self.ratio)
        self.decolineManager = Decolines(self.surface, self.decolines,
                                         self.ratio)
        self.PowerUpManager = PowerUps(self.surface, self, self.powerups,
                                       self.ratio, successound)
        self.enemieManager = Enemies(
            self.surface, self, self.enemies)  # are not fully integrated, yet
        self.stumbleManager = Stumbles(self.surface, self.stumble, self.ratio,
                                       self.player)

        self.partloader = levelloader()

        self.gravity = 0.3
        self.thickness = thickness

        self.viewport = [0, 0]
        self.speedlencounter = self.viewport[0]
        self.autoscroll = autoscroll
        self.size = size

        self.genHeight = 200
        self.genWide = 80
        self.points = 0
        self.pointmultiplier = 1

        self.maxSpeedPoints = 40000
        self.speedStep = 10000
        self.timer = 1