def run(self):
        running = True
        currentTime = 0
        lastTime = 0
        time = 0

        event = sdl.Event()
        while running:
            sdl.renderClear(driver.renderer)
            textureW, textureH = game.textureSize(backgroundTexture)
            backgroundRect = game.centeredRect(game.width, game.height,
                                               textureW, textureH)
            sdl.renderCopy(driver.renderer, backgroundTexture, None,
                           backgroundRect)
            while sdl.pollEvent(event):
                if event.type == sdl.MOUSEBUTTONDOWN:
                    running = False
                    self.next = "menu"
                elif event.type == sdl.KEYDOWN:
                    if event.key.keysym.sym in [sdl.K_q, sdl.K_ESCAPE]:
                        running = False
                        game.turnOff()
                    elif event.key.keysym.sym in [sdl.K_SPACE, sdl.K_RETURN]:
                        running = False
                        self.next = "menu"
            sdl.renderPresent(driver.renderer)
	def run(self):
		running = True
		count = 0
		event = sdl.Event()
		#if self.num is 7:
		while running:
			sdl.renderClear(driver.renderer)
			sdl.renderCopy(driver.renderer, self.textures[count], None, textureRect)

			if count ==  0 and self.num is 7:
				self.updateAlpha()
				sdl.setTextureAlphaMod(blackScreen, int(self.alpha))
				sdl.renderCopy(driver.renderer, blackScreen, None, textureRect)

			while sdl.pollEvent(event):
				if event.type == sdl.QUIT:
				 	running = False
				 	game.turnOff()
				elif event.type == sdl.MOUSEBUTTONDOWN: count += 1
				elif event.type == sdl.KEYUP:
					if event.key.keysym.sym in [sdl.K_q, sdl.K_ESCAPE]:
						running = False
						game.turnOff()
					elif event.key.keysym.sym == sdl.K_RETURN:  count += 100
					elif (count < self.length - 1 or self.num is 2 or self.num is 4 or self.num is 6 or self.num is 7) and event.key.keysym.sym == sdl.K_SPACE: count += 1

			if count > self.length - 1:
				running = False
			sdl.renderPresent(driver.renderer)
Beispiel #3
0
    def run(self):
        sdl.renderClear(driver.renderer)

        textureW, textureH = game.textureSize(loadingTexture)
        textureRect = game.centeredRect(game.width, game.height, textureW,
                                        textureH)
        sdl.renderCopy(driver.renderer, loadingTexture, None, textureRect)
        sdl.renderPresent(driver.renderer)
 def cleanup(self):
     sdl.renderClear(driver.renderer)
     if pauseTexture is not None:
         sdl.destroyTexture(pauseTexture)
     if cursorTexture is not None:
         sdl.destroyTexture(cursorTexture)
     if scrollSound is not None:
         sdl.mixer.freeChunk(scrollSound)
     if selectSound is not None:
         sdl.mixer.freeChunk(selectSound)
    def run(self):
        running = True
        currentTime = 0
        lastTime = 0
        time = 0

        event = sdl.Event()
        textureW, textureH = game.textureSize(full)
        textureRect = game.centeredRect(game.width, game.height, textureW,
                                        textureH)
        sdl.setTextureBlendMode(full, sdl.BLENDMODE_ADD)

        while running:
            currentTime = sdl.getTicks()
            dt = currentTime - lastTime
            time += dt
            lastTime = currentTime

            if time <= 3000:
                sdl.renderClear(driver.renderer)
                alpha = int(round((time / 3000.0) * 255))
                if alpha > 255:
                    time += 3000
                    alpha = 255
                sdl.renderCopy(driver.renderer, fade, None, textureRect)
                sdl.setTextureAlphaMod(full, alpha)
                sdl.renderCopy(driver.renderer, full, None, textureRect)
                while sdl.pollEvent(event):
                    if event.type == sdl.KEYDOWN:
                        time += 3000
                    elif event.type == sdl.MOUSEBUTTONDOWN:
                        time += 3000
                    if event.key.keysym.sym in [sdl.K_q, sdl.K_ESCAPE]:
                        running = False
                        game.turnOff()
            else:
                sdl.renderCopy(driver.renderer, fade, None, textureRect)
                sdl.renderCopy(driver.renderer, full, None, textureRect)
                while sdl.pollEvent(event):
                    if event.type == sdl.MOUSEBUTTONDOWN:
                        running = False
                        self.next = "menu"
                    if event.type == sdl.KEYDOWN:
                        if event.key.keysym.sym in [sdl.K_q, sdl.K_ESCAPE]:
                            running = False
                            game.turnOff()
                        else:
                            running = False
                            self.next = "menu"
            sdl.renderPresent(driver.renderer)
    def run(self):
        running = True
        currentTime = 0
        lastTime = 0
        time = 0
        pressed = False

        event = sdl.Event()

        while running:
            currentTime = sdl.getTicks()
            dt = currentTime - lastTime
            time += dt
            lastTime = currentTime

            textureW, textureH = game.textureSize(winTexture)
            goRect = game.centeredRect(game.width, game.height, textureW,
                                       textureH)

            if time <= 3000:
                sdl.renderClear(driver.renderer)
                alpha = int(round((time / 3000.0) * 255))
                sdl.setTextureAlphaMod(winTexture, alpha)
                sdl.renderCopy(driver.renderer, winTexture, None, goRect)
                while sdl.pollEvent(event):
                    if event.type == sdl.KEYDOWN:
                        time += 3000
                    if event.key.keysym.sym in [sdl.K_q, sdl.K_ESCAPE]:
                        running = False
                        game.turnOff()
            else:
                sdl.renderClear(driver.renderer)
                sdl.renderCopy(driver.renderer, winTexture, None, goRect)
                while sdl.pollEvent(event):
                    if event.type == sdl.KEYDOWN:
                        if event.key.keysym.sym in [sdl.K_q, sdl.K_ESCAPE]:
                            running = False
                            game.turnOff()
                        elif event.key.keysym.sym in [
                                sdl.K_SPACE, sdl.K_RETURN
                        ]:
                            running = False
                            self.next = "highScore"
            sdl.renderPresent(driver.renderer)
    def run(self):
        cursor1 = MC.Chef(220, 190, 50, 80, 'none', 0, 0, 0, 0.001, 0.001,
                          cursorTexture, True, 0, 0, 100, True, 1)
        cursor2 = MC.Chef(535, 190, 50, 80, 'none', 0, 0, 0, 0.001, 0.001,
                          cursorTexture, True, 0, 0, 100, True, 1)

        running = True
        currentTime = 0
        lastTime = 0
        time = 0

        cursorPos = 0
        brightnessPos = 10
        volumePos = round((driver.volume - 8) / 12)

        event = sdl.Event()

        textureW, textureH = game.textureSize(optionsTexture)
        textureRect = game.centeredRect(game.width, game.height, textureW,
                                        textureH)
        sdl.renderClear(driver.renderer)
        sdl.renderCopy(driver.renderer, optionsTexture, None, textureRect)

        # render cursor in
        time1 = ((int(time / 125)) % 4)
        time2 = ((int(time / 500)) % 4)
        # the rectangle that defines which sprite part the sprites
        spriteFrame = sdl.Rect((time1 * 48, 0, 48, 80))
        spriteFrame2 = sdl.Rect((time2 * 48, 0, 48, 80))
        sdl.renderCopy(driver.renderer, cursorTexture, spriteFrame2,
                       cursor1.getRect(0, 0))
        sdl.renderCopy(driver.renderer, cursorTexture, spriteFrame2,
                       cursor2.getRect(0, 0))

        #render in brightness indicators
        for i in range(brightnessPos):
            spot = sdl.Rect((280 + 25 * i, 357, 18, 18))
            sdl.renderCopy(driver.renderer, indTexture, None, spot)

        #render in volume indicators
        for i in range(volumePos):
            spot = sdl.Rect((280 + 25 * i, 242, 18, 18))
            sdl.renderCopy(driver.renderer, indTexture, None, spot)

        sdl.renderPresent(driver.renderer)

        while running:
            hover = None
            clicked = None
            #### TIME MANAGEMENT ####
            currentTime = sdl.getTicks()
            dt = currentTime - lastTime
            time += dt
            lastTime = currentTime

            #### TEXTURE MEASUREMENTS ####
            textureW, textureH = game.textureSize(optionsTexture)
            textureRect = game.centeredRect(game.width, game.height, textureW,
                                            textureH)

            #### HANDLE INPUT ####
            while sdl.pollEvent(event):
                if event.type == sdl.QUIT:
                    running = False
                    game.turnOff()
                elif event.type == sdl.KEYUP:
                    if event.key.keysym.sym in [sdl.K_q, sdl.K_ESCAPE]:
                        running = False
                        game.turnOff()
                elif event.type == sdl.MOUSEBUTTONDOWN:
                    if event.button.button == sdl.BUTTON_LEFT:
                        for i in range(len(boxes)):
                            if clicked is None:
                                sdl.mixer.playChannel(0, selectSound, 0)
                                clicked = boxes[i].checkEvent(
                                    event.motion.x, event.motion.y)
                        for i in range(len(volumeBoxes)):
                            here = volumeBoxes[i].checkEvent(
                                event.motion.x, event.motion.y)
                            if here is not None:
                                volumePos = here
                elif event.type == sdl.MOUSEMOTION:
                    for i in range(len(boxes)):
                        if (boxes[i].checkMotion(event.motion.x,
                                                 event.motion.y)):
                            hover = boxes[i].cursorPos
                if event.type == sdl.KEYDOWN:
                    if event.key.keysym.sym == sdl.K_UP:
                        sdl.mixer.playChannel(1, scrollSound, 0)
                        cursorPos -= 1
                        if cursorPos <= -1:
                            cursorPos = 2
                    elif event.key.keysym.sym == sdl.K_DOWN:
                        sdl.mixer.playChannel(1, scrollSound, 0)
                        cursorPos = (cursorPos + 1) % 3
                    elif event.key.keysym.sym == sdl.K_RIGHT:
                        sdl.mixer.playChannel(1, scrollSound, 0)
                        if cursorPos is 1:
                            if sdl.getWindowBrightness(driver.window) < 1:
                                brightnessPos += 1
                                sdl.setWindowBrightness(
                                    driver.window,
                                    sdl.getWindowBrightness(driver.window) +
                                    0.05)
                        elif cursorPos is 0:
                            if volumePos < 10:
                                volumePos += 1
                                sdl.mixer.volume(-1, volumePos * 12)
                                driver.volume = volumePos * 12
                    elif event.key.keysym.sym == sdl.K_LEFT:
                        sdl.mixer.playChannel(1, scrollSound, 0)
                        if cursorPos is 1:
                            if sdl.getWindowBrightness(driver.window) > .5:
                                brightnessPos -= 1
                                sdl.setWindowBrightness(
                                    driver.window,
                                    sdl.getWindowBrightness(driver.window) -
                                    0.05)
                        elif cursorPos is 0:
                            if volumePos > 1:
                                volumePos -= 1
                                sdl.mixer.volume(-1, volumePos * 12)
                                driver.volume = volumePos * 12
                    elif event.key.keysym.sym == sdl.K_RETURN:
                        if (cursorPos == 0):
                            # Call to play game
                            sdl.mixer.playChannel(1, scrollSound, 0)
                        elif (cursorPos == 1):
                            #ADD IN OPTIONS
                            sdl.mixer.playChannel(1, scrollSound, 0)
                        elif (cursorPos == 2):
                            #Call to controls screen
                            sdl.mixer.playChannel(0, selectSound, 0)
                            running = False
                            self.next = "menu"
                        while (sdl.getTicks() - currentTime < 300):
                            pass

                if (hover is not None):
                    cursorPos = hover

                if clicked is not None:
                    if cursorPos is 2:
                        sdl.mixer.playChannel(0, selectSound, 0)
                        running = False
                        self.next = "menu"
                cursor1.updateY(190 + 115 * cursorPos)
                cursor2.updateY(190 + 115 * cursorPos)

                #### RENDER ####
                sdl.renderClear(driver.renderer)
                sdl.renderCopy(driver.renderer, optionsTexture, None,
                               textureRect)

                # render cursor in
                time1 = ((int(time / 125)) % 4)
                time2 = ((int(time / 500)) % 4)
                # the rectangle that defines which sprite part the sprites
                spriteFrame = sdl.Rect((time1 * 48, 0, 48, 80))
                spriteFrame2 = sdl.Rect((time2 * 48, 0, 48, 80))
                sdl.renderCopy(driver.renderer, cursorTexture, spriteFrame2,
                               cursor1.getRect(0, 0))
                sdl.renderCopy(driver.renderer, cursorTexture, spriteFrame2,
                               cursor2.getRect(0, 0))

                for i in range(brightnessPos):
                    spot = sdl.Rect((280 + 25 * i, 357, 18, 18))
                    sdl.renderCopy(driver.renderer, indTexture, None, spot)
                for i in range(volumePos):
                    spot = sdl.Rect((280 + 25 * i, 242, 18, 18))
                    sdl.renderCopy(driver.renderer, indTexture, None, spot)
                sdl.renderPresent(driver.renderer)
def run():
    running = True
    lastTime = 0
    time = 0

    up = False
    down = False
    left = False
    right = False

    event = sdl.Event()
    xPos = 100
    yPos = 100
    size = 200
    while running:

        currentTime = sdl.getTicks()
        dt = currentTime - lastTime
        time += dt / 1000.0
        lastTime = currentTime

        textureW, textureH = textureSize(texture)
        textureRect = centeredRect(width, height, textureW, textureH)

        #Figure out what keys are being pressed
        while sdl.pollEvent(event):
            if event.type == sdl.QUIT:
                running = False
            elif event.type == sdl.KEYUP:
                if event.key.keysym.sym in [sdl.K_q, sdl.K_ESCAPE]:
                    running = False
                if event.key.keysym.sym == sdl.K_UP: up = False
                elif event.key.keysym.sym == sdl.K_DOWN: down = False
                elif event.key.keysym.sym == sdl.K_LEFT: left = False
                elif event.key.keysym.sym == sdl.K_RIGHT: right = False
            if event.type == sdl.KEYDOWN:
                if event.key.keysym.sym == sdl.K_UP: up = True
                elif event.key.keysym.sym == sdl.K_DOWN: down = True
                elif event.key.keysym.sym == sdl.K_LEFT: left = True
                elif event.key.keysym.sym == sdl.K_RIGHT: right = True

            #movement based on what keys are being pressed down
            if up and left:
                yPos -= 10
                xPos -= 10
            elif up and right:
                yPos -= 10
                xPos += 10
            elif down and left:
                yPos += 10
                xPos -= 10
            elif down and right:
                yPos += 10
                xPos += 10
            elif up:
                yPos -= 10
            elif down:
                yPos += 10
            elif left:
                xPos -= 10
            elif right:
                xPos += 10

        testRect = sdl.Rect((xPos, yPos, size, size))
        sdl.renderClear(renderer)
        sdl.renderCopy(renderer, texture, None, textureRect)
        sdl.renderCopy(renderer, chefTexture, None, testRect)

        testRect = sdl.Rect((xPos, yPos, 250, 250))

        sdl.renderClear(renderer)

        sdl.renderCopy(renderer, texture, None, textureRect)

        sdl.renderCopy(renderer, chefTexture, None, testRect)
        sdl.renderPresent(renderer)
    def run(self):
        sdl.mixer.volume(-1, driver.volume)
        sdl.mixer.volumeMusic(driver.volume)
        cursor1 = MC.Chef(240, 160, 50, 80, 'none', 0, 0, 0, 0.001, 0.001,
                          cursorTexture, True, 0, 0, 100, True, 1)
        cursor2 = MC.Chef(515, 160, 50, 80, 'none', 0, 0, 0, 0.001, 0.001,
                          cursorTexture, True, 0, 0, 100, True, 1)

        running = True
        currentTime = 0
        lastTime = 0
        time = 0

        cursorPos = 0

        keepOnPlaying = True

        event = sdl.Event()
        controls = Controls()
        options = Options()
        while running:
            hover = None
            clicked = None
            #### TIME MANAGEMENT ####
            currentTime = sdl.getTicks()
            dt = currentTime - lastTime
            time += dt
            lastTime = currentTime

            #### TEXTURE MEASUREMENTS ####
            textureW, textureH = game.textureSize(pauseTexture)
            textureRect = game.centeredRect(game.width, game.height, textureW,
                                            textureH)

            #### HANDLE INPUT ####
            while sdl.pollEvent(event):
                if event.type == sdl.QUIT:
                    running = False
                    game.turnOff()
                    keepOnPlaying = False
                elif event.type == sdl.KEYUP:
                    if event.key.keysym.sym in [sdl.K_q, sdl.K_ESCAPE]:
                        running = False
                        game.turnOff()
                        keepOnPlaying = False
                elif event.type == sdl.MOUSEBUTTONDOWN:
                    if event.button.button == sdl.BUTTON_LEFT:
                        for i in range(len(boxes)):
                            if clicked is None:
                                sdl.mixer.playChannel(0, selectSound, 0)
                                clicked = boxes[i].checkEvent(
                                    event.motion.x, event.motion.y)
                elif event.type == sdl.MOUSEMOTION:
                    for i in range(len(boxes)):
                        if (boxes[i].checkMotion(event.motion.x,
                                                 event.motion.y)):
                            hover = boxes[i].cursorPos
                elif event.type == sdl.KEYDOWN:
                    if event.key.keysym.sym == sdl.K_UP:
                        sdl.mixer.playChannel(1, scrollSound, 0)
                        cursorPos -= 1
                        if cursorPos <= -1:
                            cursorPos = 3
                    elif event.key.keysym.sym == sdl.K_DOWN:
                        sdl.mixer.playChannel(1, scrollSound, 0)
                        cursorPos = (cursorPos + 1) % 4
                    elif event.key.keysym.sym == sdl.K_p:
                        sdl.mixer.playChannel(0, selectSound, 0)
                        running = False
                        keepOnPlaying = True
                    elif event.key.keysym.sym == sdl.K_RETURN:
                        if (cursorPos == 0):
                            # Call to play game
                            sdl.mixer.playChannel(0, selectSound, 0)
                            running = False
                            keepOnPlaying = True
                        elif (cursorPos == 1):
                            #ADD IN OPTIONS
                            sdl.mixer.playChannel(0, selectSound, 0)
                            options.load()
                            options.run()
                            options.cleanup()
                        elif (cursorPos == 2):
                            #Call to controls screen
                            sdl.mixer.playChannel(0, selectSound, 0)
                            controls.load()
                            controls.run()
                            controls.cleanup()
                        elif (cursorPos == 3):
                            # Call to quit
                            sdl.mixer.playChannel(0, selectSound, 0)
                            running = False
                            game.turnOff()
                            keepOnPlaying = False
                        while (sdl.getTicks() - currentTime < 300):
                            pass

#### RENDER ####
                if (clicked is not None):
                    if clicked is 'quit':
                        running = False
                        game.turnOff()
                        keepOnPlaying = False
                    elif clicked is "controls":
                        controls.load()
                        controls.run()
                        controls.cleanup()
                    elif clicked is "options":
                        options.load()
                        options.run()
                        options.cleanup()
                    elif clicked is "resume":
                        running = False
                        keepOnPlaying = True

                if (hover is not None):
                    cursorPos = hover

                cursor1.updateY(220 + 60 * cursorPos)
                cursor2.updateY(220 + 60 * cursorPos)
                sdl.renderClear(driver.renderer)
                self.camera.display(time, dt, False, None)
                sdl.renderCopy(driver.renderer, pauseTexture, None,
                               textureRect)

                # render cursor in
                time1 = ((int(time / 125)) % 4)
                time2 = ((int(time / 500)) % 4)
                # the rectangle that defines which sprite part the sprites

                spriteFrame = sdl.Rect((time1 * 48, 0, 48, 80))
                spriteFrame2 = sdl.Rect((time2 * 48, 0, 48, 80))
                sdl.renderCopy(driver.renderer, cursorTexture, spriteFrame2,
                               cursor1.getRect(0, 0))
                sdl.renderCopy(driver.renderer, cursorTexture, spriteFrame2,
                               cursor2.getRect(0, 0))

                sdl.renderPresent(driver.renderer)
                if not running:
                    return keepOnPlaying
    def run(self, itemName):
        sdl.mixer.volume(-1, driver.volume)
        sdl.mixer.volumeMusic(driver.volume)

        running = True
        currentTime = 0
        lastTime = 0
        time = 0

        keepOnPlaying = True

        event = sdl.Event()

        sdl.mixer.allocateChannels(2)
        selectSound = sdl.mixer.loadWAV_RW(
            sdl.RWFromFile("music//chunks/menu_select.wav", 'rw'), 0)
        cur = 0
        if itemName is "bsv":
            cur = 0
        elif itemName is "key":
            cur = 1
        elif itemName is "ladles":
            cur = 2
        elif itemName is "graters":
            cur = 3
        elif itemName is "carrot":
            cur = 4
        elif itemName is "pizza":
            cur = 5
        elif itemName is "tomato":
            cur = 6
        elif itemName is "knives":
            cur = 7

        while running:

            #### TIME MANAGEMENT ####
            currentTime = sdl.getTicks()
            dt = currentTime - lastTime
            time += dt
            lastTime = currentTime

            #### TEXTURE MEASUREMENTS ####
            textureW, textureH = game.textureSize(driver.chef.textures[3][cur])
            textureRect = game.centeredRect(game.width, game.height, textureW,
                                            textureH)
            sdl.renderClear(driver.renderer)
            self.camera.display(time, dt, False, None)
            sdl.renderCopy(driver.renderer, driver.chef.textures[3][cur], None,
                           textureRect)
            sdl.renderPresent(driver.renderer)

            #### HANDLE INPUT ####
            while sdl.pollEvent(event):
                if event.type == sdl.QUIT:
                    running = False
                    game.turnOff()
                    keepOnPlaying = False
                elif event.type == sdl.KEYUP:
                    if event.key.keysym.sym in [sdl.K_q, sdl.K_ESCAPE]:
                        running = False
                        game.turnOff()
                        keepOnPlaying = False
                if event.type == sdl.KEYDOWN:
                    if event.key.keysym.sym is sdl.K_SPACE:
                        sdl.mixer.playChannel(0, selectSound, 0)
                        running = False
                        keepOnPlaying = True

#### RENDER ####

                if not running:
                    return keepOnPlaying
        sdl.renderClear(driver.renderer)
        if selectSound is not None:
            sdl.mixer.freeChunk(selectSound)
Beispiel #11
0
	def clear(self):
		assert self.handle is not None
		sdl.setRenderDrawColor(self.handle, 0, 0, 0, 255)
		if sdl.renderClear(self.handle) != 0:
			raise SDLException("Could not clear screen")
    def display(self, currentTime, dt, keyPress, globalTime):
        overlay = True
        if currentTime > self.shakeTime:
            self.shake = False

        if self.boss is not None:
            if self.level is 3:
                if self.boss.dying and not self.boss.dead:
                    self.xMin = int((len(self.map[0]) * 50) - 801)
                    self.yMin = 1
                    overlay = False
            elif self.level is 5:
                if self.boss.dying and not self.boss.dead:
                    self.xMin = int((self.boss.xPos + 75 - 400))
                    self.yMin = int((self.boss.yPos + 95 - 300))
                    if self.xMin < 0: self.xMin = 0
                    elif self.xMin > len(self.map[0]) * 50 - 800:
                        self.xMin = len(self.map[0]) * 50 - 801
                    if self.yMin < 0: self.yMin = 0
                    elif self.yMin > len(self.map) * 50 - 600:
                        self.yMin = len(self.map) * 50 - 601
                    overlay = False
                elif self.boss.transforming and not self.boss.transformed:
                    self.xMin = int((self.boss.xPos + 75 - 400))
                    self.yMin = int((self.boss.yPos + 95 - 300))
                    if self.xMin < 0: self.xMin = 0
                    elif self.xMin > len(self.map[0]) * 50 - 800:
                        self.xMin = len(self.map[0]) * 50 - 801
                    if self.yMin < 0: self.yMin = 0
                    elif self.yMin > len(self.map) * 50 - 600:
                        self.yMin = len(self.map) * 50 - 601
                    overlay = False

        oldxMin = self.xMin
        oldyMin = self.yMin
        if self.shake:
            #self.xMin += math.sin(random.random() * math.pi * 2) * self.shakeIntensityX
            #self.xMin += math.sin(currentTime/10) * self.shakeIntensityX
            self.xMin += random.randint(0, int(self.shakeIntensityX))
            if self.xMin < 0: self.xMin = -self.xMin
            if self.xMin + 800 >= (len(self.map[0])) * 50:
                self.xMin = self.xMin - 50
            #self.yMin += math.sin(random.random() * math.pi * 2) * self.shakeIntensityY
            #self.yMin += math.sin(currentTime/10) * self.shakeIntensityY
            self.yMin += random.randint(0, int(self.shakeIntensityY))
            if self.yMin < 0: self.yMin = -self.yMin
            if self.yMin + 600 >= (len(self.map)) * 50:
                self.yMin = self.yMin - 50

        sdl.renderClear(driver.renderer)
        tilesPlaced = 0
        tileValue = 0
        for i in range(13):  # RIGHT NOW ITS FOR 12 ROW AND 16 COLLUMS
            for j in range(17):  # AKA THE 600 x 800 PIXELS OF OUR SCREEEN
                tileValue = self.map[i +
                                     int(self.yMin / 50)][j +
                                                          int(self.xMin / 50)]
                tileRect = sdl.Rect(
                    (int(50 * j) - int(self.xMin % 50),
                     int(50 * i) - int(self.yMin % 50), 50, 50))
                sdl.renderCopy(driver.renderer,
                               self.mapTextures[tileValue - 1], None, tileRect)

        #Sorting experiment:

        renderArray = []
        renderArray.extend(self.enemies)
        renderArray.extend(self.structures)
        renderArray.extend(self.objects)
        renderArray.extend(self.emitters)
        renderArray.append(self.chef)
        if self.chef2 is not None:
            renderArray.append(self.chef2)
        if self.boss is not None:
            renderArray.append(self.boss)

        sortedArray = sorted(renderArray,
                             key=operator.methodcaller('getCameraPos'))

        for obj in sortedArray:
            if (type(obj).__name__ == "Enemy"):
                obj.renderSelf(currentTime, driver.renderer, self.xMin,
                               self.yMin, self.ratTextures)
            elif (type(obj).__name__ == "BossRat"):
                obj.renderSelf(currentTime, driver.renderer, self.xMin,
                               self.yMin, self.bossTextures)
            elif (type(obj).__name__ == "Emitter"):
                obj.renderSelf(driver.renderer, self.xMin, self.yMin, dt)
                if (obj.getTime() <= currentTime):
                    self.emitters.remove(obj)
            elif (type(obj).__name__ == "Chef"):
                obj.renderSelf(currentTime, driver.renderer, self.xMin,
                               self.yMin, keyPress)
            else:
                obj.renderSelf(currentTime, driver.renderer, self.xMin,
                               self.yMin)

        if self.boss is not None:
            if len(self.boss.projectiles) is not 0:
                for projectile in self.boss.projectiles:
                    if projectile.title is 'green' or projectile.title is 'purple' or projectile.title is 'knife' or projectile.title is 'fire' or projectile.title is 'fireSlow':
                        projectile.renderSelf(currentTime, self.xMin,
                                              self.yMin)
        if len(self.chef.projectiles) is not 0:
            for projectile in self.chef.projectiles:
                if projectile.title is 'green' or projectile.title is 'purple' or projectile.title is 'knife':
                    projectile.renderSelf(currentTime, self.xMin, self.yMin)
        if self.chef2 is not None:
            if len(self.chef2.projectiles) is not 0:
                for projectile in self.chef2.projectiles:
                    if projectile.title is 'green' or projectile.title is 'purple' or projectile.title is 'knife':
                        projectile.renderSelf(currentTime, self.xMin,
                                              self.yMin)

        if self.level >= 2:
            if overlay:
                self.overlayblack()
            lightArray = []
            lightArray.append(self.chef)
            lightArray.extend(self.enemies)
            lightArray.extend(self.structures)
            lightArray.extend(self.emitters)
            if self.boss is not None and not self.boss.dead:
                lightArray.extend(self.boss.projectiles)
                lightArray.append(self.boss)
            lightArray.extend(self.chef.projectiles)

            for lightSource in lightArray:
                lightSource.renderLight(driver.renderer, self.xMin, self.yMin)

        #render in messages LAST
        for pantry in self.structures:
            if pantry.getVisible():
                pantry.renderMessage(driver.renderer, self.xMin, self.yMin)

        if self.chef.getEnergy() == 0:
            self.chef.renderEnergyMessage(driver.renderer, self.xMin,
                                          self.yMin)

        if self.level is 1 and len(self.chef.weapons) is 0:
            self.chef.renderNoWepMessage(driver.renderer, self.xMin, self.yMin)

        if self.level is not 6:
            driver.scoreBoard.renderScore(driver.renderer)
            self.chef.renderHealth(driver.renderer)
            self.chef.renderEnergy(driver.renderer, self.top)
            if len(self.chef.items) is not 0:
                self.chef.renderItems(driver.renderer)
            if len(self.chef.weapons) is not 0:
                self.chef.renderWeapons(driver.renderer)
        else:
            self.chef.renderHealthPvp(driver.renderer)
            self.chef2.renderHealthPvp(driver.renderer)

# displaying the ranged weapon arrows ##### NOT A THING FOR NOW JUST IGNORE
        #if self.chef.degreePress or globalTime < self.chef.updateDegreeTime + 250:
        #		xDiff = 400 - (int(self.chef.xPos) - int(self.xMin)) - int(self.chef.width / 2)
        #		yDiff = 300 - (int(self.chef.yPos) - int(self.yMin)) - int(self.chef.height / 2)
        #		tileRect = sdl.Rect((240 - xDiff, 140 - yDiff, 320, 320))
        #		#sdl.renderCopy(driver.renderer, self.chef.textures[2][13], None, tileRect)
        #		sdl.renderCopyEx(driver.renderer, self.chef.textures[2][13], None, tileRect, math.degrees(self.chef.degree) + 90, sdl.Point((tileRect.w//2, tileRect.h//2)), sdl.FLIP_NONE)

        if self.level is 6:
            for object in self.objects:
                if object.title is 'blackScreen':
                    object.renderSelf(currentTime, driver.renderer, self.xMin,
                                      self.yMin)

        self.xMin = oldxMin
        self.yMin = oldyMin