#!python3

import pygame as pg
from hm_ship import Ship, TBeam
from hm_cow import Cow
from hm_farmer import Farmer
from hm_bullets import Bullet
from hm_ux import UXcomponent,ShieldIcon, Text

class Settings():
    """A class to store all settings"""

    def __init__(self):
        """initialize game settings"""
        #game display
        self.screen_width = 850
        self.screen_height = 600
        self.gameDisplay = pg.display.set_mode((self.screen_width, self.screen_height))
        self.bg_color = (0,230,230)
        self.fps = 30
        self.bg_image = pg.image.load("farm.png")
        
        # game state
        self.state = 'newgame'

        # level tracker
        self.level = 1

        # group for all farmers
        self.num_farmers = 1
        self.farmers = pg.sprite.Group()

        # track number of cows
        self.num_cows = 2

        #animal images
        self.cowLeft = pg.image.load("cow_left.png")
        self.cowRight = pg.image.load("cow_right.png")

        self.chickenLeft = pg.image.load("chicken_left.png")
        self.chickenRight = pg.image.load("chicken_right.png")

        # moo sound
        self.cowsSay = pg.mixer.Sound("yudena__cow-bymondfisch89.ogg")

        # cluck sound
        self.chickensSay = pg.mixer.Sound("rudmer-rotteveel__chicken-single-alarm-call.wav")

        # group for all animals
        self.animals = pg.sprite.Group()

        #used to track captured animals
        self.captured = 0 

        # ux components
        self.bright_green = (61, 235, 98) 
        self.light_orange = (255, 106, 54)

        self.titleImg = pg.image.load("title.png")

        self.playImg = pg.image.load("play_button.png")
        self.quitImg = pg.image.load("quit_button.png")
        self.nextImg = pg.image.load("next_button.png")
        self.restartImg = pg.image.load("restart_button.png")
        self.huntImg = pg.image.load("hunt_button.png")

        self.greenShield = pg.image.load("green_shield.png")

        # ux components
        self.shield_indicator = ShieldIcon(self.gameDisplay,self.greenShield, 31, 35, 35, 75)

        # new game screen
        self.title = UXcomponent(self.gameDisplay,self.titleImg, 513, 141, 425,200)
        self.playButton = UXcomponent(self.gameDisplay,self.playImg, 173, 159,425,400)
        self.quitButton = UXcomponent(self.gameDisplay, self.quitImg, 173, 159, 425, 550) 
 
        # game over screen
        self.gameOverMsg = Text(self.gameDisplay, 120, 425, 175, self.light_orange, "Game Over")
        self.restartButton = UXcomponent(self.gameDisplay, self.restartImg, 173, 159,425,400)

        # start level screen components
        self.levelHeading = Text(self.gameDisplay, 120, 425, 175, self.light_orange, "Farm {0}".format(self.level))
        self.huntButton = UXcomponent(self.gameDisplay, self.huntImg, 173, 159,425,400)

        # end level screen components
        self.goodJob = Text(self.gameDisplay, 120, 425, 140, self.light_orange, "Good Job!")
        self.endMsg = Text(self.gameDisplay, 100, 425, 230, self.light_orange, "All animals abducted!")
        self.nextButton = UXcomponent(self.gameDisplay, self.nextImg, 173, 159,425,400)

        # group for new game menu components
        self.newgameUX = [self.title, self.playButton, self.quitButton]
        
        # group for start level screen components
        self.startUX = [self.levelHeading, self.huntButton]

        # group for start level screen components
        self.endUX = [self.goodJob, self.endMsg, self.nextButton]

        # group for game over menu components
        self.gameoverUX = [self.gameOverMsg, self.restartButton, self.quitButton]

    def setupNextLevel(self):
        """ set up the next level"""
        self.shield_indicator.image = self.greenShield
        self.captured = 0
        self.level += 1
        self.num_farmers += 1
        self.num_cows += 1

    def setupNewGame(self):
        """ setup a new game"""
        self.level = 1
        self.num_cows = 2
        self.num_farmers = 1
        self.levelHeading = Text(self.gameDisplay, 120, 425, 175, self.light_orange, "Farm 1")
        self.shield_indicator.image = self.greenShield
        updatedHeading = self.levelHeading
        self.startUX[0] = updatedHeading

    def setCaptured(self):
        """ increment the captured attribute"""
        total = 0
        for x in self.animals:
            if x.captured == True:
                total += 1
        self.captured = total

f7b5d8d9f2f084b2a834218cc380df082c8264a9
<mask token>


class Settings:
    <mask token>
    <mask token>

    def setupNextLevel(self):
        """ set up the next level"""
        self.shield_indicator.image = self.greenShield
        self.captured = 0
        self.level += 1
        self.num_farmers += 1
        self.num_cows += 1

    def setupNewGame(self):
        """ setup a new game"""
        self.level = 1
        self.num_cows = 2
        self.num_farmers = 1
        self.levelHeading = Text(self.gameDisplay, 120, 425, 175, self.
            light_orange, 'Farm 1')
        self.shield_indicator.image = self.greenShield
        updatedHeading = self.levelHeading
        self.startUX[0] = updatedHeading

    def setCaptured(self):
        """ increment the captured attribute"""
        total = 0
        for x in self.animals:
            if x.captured == True:
                total += 1
        self.captured = total

<mask token>


class Settings:
    <mask token>

    def __init__(self):
        """initialize game settings"""
        self.screen_width = 850
        self.screen_height = 600
        self.gameDisplay = pg.display.set_mode((self.screen_width, self.
            screen_height))
        self.bg_color = 0, 230, 230
        self.fps = 30
        self.bg_image = pg.image.load('farm.png')
        self.state = 'newgame'
        self.level = 1
        self.num_farmers = 1
        self.farmers = pg.sprite.Group()
        self.num_cows = 2
        self.cowLeft = pg.image.load('cow_left.png')
        self.cowRight = pg.image.load('cow_right.png')
        self.chickenLeft = pg.image.load('chicken_left.png')
        self.chickenRight = pg.image.load('chicken_right.png')
        self.cowsSay = pg.mixer.Sound('yudena__cow-bymondfisch89.ogg')
        self.chickensSay = pg.mixer.Sound(
            'rudmer-rotteveel__chicken-single-alarm-call.wav')
        self.animals = pg.sprite.Group()
        self.captured = 0
        self.bright_green = 61, 235, 98
        self.light_orange = 255, 106, 54
        self.titleImg = pg.image.load('title.png')
        self.playImg = pg.image.load('play_button.png')
        self.quitImg = pg.image.load('quit_button.png')
        self.nextImg = pg.image.load('next_button.png')
        self.restartImg = pg.image.load('restart_button.png')
        self.huntImg = pg.image.load('hunt_button.png')
        self.greenShield = pg.image.load('green_shield.png')
        self.shield_indicator = ShieldIcon(self.gameDisplay, self.
            greenShield, 31, 35, 35, 75)
        self.title = UXcomponent(self.gameDisplay, self.titleImg, 513, 141,
            425, 200)
        self.playButton = UXcomponent(self.gameDisplay, self.playImg, 173, 
            159, 425, 400)
        self.quitButton = UXcomponent(self.gameDisplay, self.quitImg, 173, 
            159, 425, 550)
        self.gameOverMsg = Text(self.gameDisplay, 120, 425, 175, self.
            light_orange, 'Game Over')
        self.restartButton = UXcomponent(self.gameDisplay, self.restartImg,
            173, 159, 425, 400)
        self.levelHeading = Text(self.gameDisplay, 120, 425, 175, self.
            light_orange, 'Farm {0}'.format(self.level))
        self.huntButton = UXcomponent(self.gameDisplay, self.huntImg, 173, 
            159, 425, 400)
        self.goodJob = Text(self.gameDisplay, 120, 425, 140, self.
            light_orange, 'Good Job!')
        self.endMsg = Text(self.gameDisplay, 100, 425, 230, self.
            light_orange, 'All animals abducted!')
        self.nextButton = UXcomponent(self.gameDisplay, self.nextImg, 173, 
            159, 425, 400)
        self.newgameUX = [self.title, self.playButton, self.quitButton]
        self.startUX = [self.levelHeading, self.huntButton]
        self.endUX = [self.goodJob, self.endMsg, self.nextButton]
        self.gameoverUX = [self.gameOverMsg, self.restartButton, self.
            quitButton]

    def setupNextLevel(self):
        """ set up the next level"""
        self.shield_indicator.image = self.greenShield
        self.captured = 0
        self.level += 1
        self.num_farmers += 1
        self.num_cows += 1

    def setupNewGame(self):
        """ setup a new game"""
        self.level = 1
        self.num_cows = 2
        self.num_farmers = 1
        self.levelHeading = Text(self.gameDisplay, 120, 425, 175, self.
            light_orange, 'Farm 1')
        self.shield_indicator.image = self.greenShield
        updatedHeading = self.levelHeading
        self.startUX[0] = updatedHeading

    def setCaptured(self):
        """ increment the captured attribute"""
        total = 0
        for x in self.animals:
            if x.captured == True:
                total += 1
        self.captured = total

<mask token>


class Settings:
    """A class to store all settings"""

    def __init__(self):
        """initialize game settings"""
        self.screen_width = 850
        self.screen_height = 600
        self.gameDisplay = pg.display.set_mode((self.screen_width, self.
            screen_height))
        self.bg_color = 0, 230, 230
        self.fps = 30
        self.bg_image = pg.image.load('farm.png')
        self.state = 'newgame'
        self.level = 1
        self.num_farmers = 1
        self.farmers = pg.sprite.Group()
        self.num_cows = 2
        self.cowLeft = pg.image.load('cow_left.png')
        self.cowRight = pg.image.load('cow_right.png')
        self.chickenLeft = pg.image.load('chicken_left.png')
        self.chickenRight = pg.image.load('chicken_right.png')
        self.cowsSay = pg.mixer.Sound('yudena__cow-bymondfisch89.ogg')
        self.chickensSay = pg.mixer.Sound(
            'rudmer-rotteveel__chicken-single-alarm-call.wav')
        self.animals = pg.sprite.Group()
        self.captured = 0
        self.bright_green = 61, 235, 98
        self.light_orange = 255, 106, 54
        self.titleImg = pg.image.load('title.png')
        self.playImg = pg.image.load('play_button.png')
        self.quitImg = pg.image.load('quit_button.png')
        self.nextImg = pg.image.load('next_button.png')
        self.restartImg = pg.image.load('restart_button.png')
        self.huntImg = pg.image.load('hunt_button.png')
        self.greenShield = pg.image.load('green_shield.png')
        self.shield_indicator = ShieldIcon(self.gameDisplay, self.
            greenShield, 31, 35, 35, 75)
        self.title = UXcomponent(self.gameDisplay, self.titleImg, 513, 141,
            425, 200)
        self.playButton = UXcomponent(self.gameDisplay, self.playImg, 173, 
            159, 425, 400)
        self.quitButton = UXcomponent(self.gameDisplay, self.quitImg, 173, 
            159, 425, 550)
        self.gameOverMsg = Text(self.gameDisplay, 120, 425, 175, self.
            light_orange, 'Game Over')
        self.restartButton = UXcomponent(self.gameDisplay, self.restartImg,
            173, 159, 425, 400)
        self.levelHeading = Text(self.gameDisplay, 120, 425, 175, self.
            light_orange, 'Farm {0}'.format(self.level))
        self.huntButton = UXcomponent(self.gameDisplay, self.huntImg, 173, 
            159, 425, 400)
        self.goodJob = Text(self.gameDisplay, 120, 425, 140, self.
            light_orange, 'Good Job!')
        self.endMsg = Text(self.gameDisplay, 100, 425, 230, self.
            light_orange, 'All animals abducted!')
        self.nextButton = UXcomponent(self.gameDisplay, self.nextImg, 173, 
            159, 425, 400)
        self.newgameUX = [self.title, self.playButton, self.quitButton]
        self.startUX = [self.levelHeading, self.huntButton]
        self.endUX = [self.goodJob, self.endMsg, self.nextButton]
        self.gameoverUX = [self.gameOverMsg, self.restartButton, self.
            quitButton]

    def setupNextLevel(self):
        """ set up the next level"""
        self.shield_indicator.image = self.greenShield
        self.captured = 0
        self.level += 1
        self.num_farmers += 1
        self.num_cows += 1

    def setupNewGame(self):
        """ setup a new game"""
        self.level = 1
        self.num_cows = 2
        self.num_farmers = 1
        self.levelHeading = Text(self.gameDisplay, 120, 425, 175, self.
            light_orange, 'Farm 1')
        self.shield_indicator.image = self.greenShield
        updatedHeading = self.levelHeading
        self.startUX[0] = updatedHeading

    def setCaptured(self):
        """ increment the captured attribute"""
        total = 0
        for x in self.animals:
            if x.captured == True:
                total += 1
        self.captured = total

import pygame as pg
from hm_ship import Ship, TBeam
from hm_cow import Cow
from hm_farmer import Farmer
from hm_bullets import Bullet
from hm_ux import UXcomponent, ShieldIcon, Text


class Settings:
    """A class to store all settings"""

    def __init__(self):
        """initialize game settings"""
        self.screen_width = 850
        self.screen_height = 600
        self.gameDisplay = pg.display.set_mode((self.screen_width, self.
            screen_height))
        self.bg_color = 0, 230, 230
        self.fps = 30
        self.bg_image = pg.image.load('farm.png')
        self.state = 'newgame'
        self.level = 1
        self.num_farmers = 1
        self.farmers = pg.sprite.Group()
        self.num_cows = 2
        self.cowLeft = pg.image.load('cow_left.png')
        self.cowRight = pg.image.load('cow_right.png')
        self.chickenLeft = pg.image.load('chicken_left.png')
        self.chickenRight = pg.image.load('chicken_right.png')
        self.cowsSay = pg.mixer.Sound('yudena__cow-bymondfisch89.ogg')
        self.chickensSay = pg.mixer.Sound(
            'rudmer-rotteveel__chicken-single-alarm-call.wav')
        self.animals = pg.sprite.Group()
        self.captured = 0
        self.bright_green = 61, 235, 98
        self.light_orange = 255, 106, 54
        self.titleImg = pg.image.load('title.png')
        self.playImg = pg.image.load('play_button.png')
        self.quitImg = pg.image.load('quit_button.png')
        self.nextImg = pg.image.load('next_button.png')
        self.restartImg = pg.image.load('restart_button.png')
        self.huntImg = pg.image.load('hunt_button.png')
        self.greenShield = pg.image.load('green_shield.png')
        self.shield_indicator = ShieldIcon(self.gameDisplay, self.
            greenShield, 31, 35, 35, 75)
        self.title = UXcomponent(self.gameDisplay, self.titleImg, 513, 141,
            425, 200)
        self.playButton = UXcomponent(self.gameDisplay, self.playImg, 173, 
            159, 425, 400)
        self.quitButton = UXcomponent(self.gameDisplay, self.quitImg, 173, 
            159, 425, 550)
        self.gameOverMsg = Text(self.gameDisplay, 120, 425, 175, self.
            light_orange, 'Game Over')
        self.restartButton = UXcomponent(self.gameDisplay, self.restartImg,
            173, 159, 425, 400)
        self.levelHeading = Text(self.gameDisplay, 120, 425, 175, self.
            light_orange, 'Farm {0}'.format(self.level))
        self.huntButton = UXcomponent(self.gameDisplay, self.huntImg, 173, 
            159, 425, 400)
        self.goodJob = Text(self.gameDisplay, 120, 425, 140, self.
            light_orange, 'Good Job!')
        self.endMsg = Text(self.gameDisplay, 100, 425, 230, self.
            light_orange, 'All animals abducted!')
        self.nextButton = UXcomponent(self.gameDisplay, self.nextImg, 173, 
            159, 425, 400)
        self.newgameUX = [self.title, self.playButton, self.quitButton]
        self.startUX = [self.levelHeading, self.huntButton]
        self.endUX = [self.goodJob, self.endMsg, self.nextButton]
        self.gameoverUX = [self.gameOverMsg, self.restartButton, self.
            quitButton]

    def setupNextLevel(self):
        """ set up the next level"""
        self.shield_indicator.image = self.greenShield
        self.captured = 0
        self.level += 1
        self.num_farmers += 1
        self.num_cows += 1

    def setupNewGame(self):
        """ setup a new game"""
        self.level = 1
        self.num_cows = 2
        self.num_farmers = 1
        self.levelHeading = Text(self.gameDisplay, 120, 425, 175, self.
            light_orange, 'Farm 1')
        self.shield_indicator.image = self.greenShield
        updatedHeading = self.levelHeading
        self.startUX[0] = updatedHeading

    def setCaptured(self):
        """ increment the captured attribute"""
        total = 0
        for x in self.animals:
            if x.captured == True:
                total += 1
        self.captured = total

#!python3

import pygame as pg
from hm_ship import Ship, TBeam
from hm_cow import Cow
from hm_farmer import Farmer
from hm_bullets import Bullet
from hm_ux import UXcomponent,ShieldIcon, Text

class Settings():
    """A class to store all settings"""

    def __init__(self):
        """initialize game settings"""
        #game display
        self.screen_width = 850
        self.screen_height = 600
        self.gameDisplay = pg.display.set_mode((self.screen_width, self.screen_height))
        self.bg_color = (0,230,230)
        self.fps = 30
        self.bg_image = pg.image.load("farm.png")
        
        # game state
        self.state = 'newgame'

        # level tracker
        self.level = 1

        # group for all farmers
        self.num_farmers = 1
        self.farmers = pg.sprite.Group()

        # track number of cows
        self.num_cows = 2

        #animal images
        self.cowLeft = pg.image.load("cow_left.png")
        self.cowRight = pg.image.load("cow_right.png")

        self.chickenLeft = pg.image.load("chicken_left.png")
        self.chickenRight = pg.image.load("chicken_right.png")

        # moo sound
        self.cowsSay = pg.mixer.Sound("yudena__cow-bymondfisch89.ogg")

        # cluck sound
        self.chickensSay = pg.mixer.Sound("rudmer-rotteveel__chicken-single-alarm-call.wav")

        # group for all animals
        self.animals = pg.sprite.Group()

        #used to track captured animals
        self.captured = 0 

        # ux components
        self.bright_green = (61, 235, 98) 
        self.light_orange = (255, 106, 54)

        self.titleImg = pg.image.load("title.png")

        self.playImg = pg.image.load("play_button.png")
        self.quitImg = pg.image.load("quit_button.png")
        self.nextImg = pg.image.load("next_button.png")
        self.restartImg = pg.image.load("restart_button.png")
        self.huntImg = pg.image.load("hunt_button.png")

        self.greenShield = pg.image.load("green_shield.png")

        # ux components
        self.shield_indicator = ShieldIcon(self.gameDisplay,self.greenShield, 31, 35, 35, 75)

        # new game screen
        self.title = UXcomponent(self.gameDisplay,self.titleImg, 513, 141, 425,200)
        self.playButton = UXcomponent(self.gameDisplay,self.playImg, 173, 159,425,400)
        self.quitButton = UXcomponent(self.gameDisplay, self.quitImg, 173, 159, 425, 550) 
 
        # game over screen
        self.gameOverMsg = Text(self.gameDisplay, 120, 425, 175, self.light_orange, "Game Over")
        self.restartButton = UXcomponent(self.gameDisplay, self.restartImg, 173, 159,425,400)

        # start level screen components
        self.levelHeading = Text(self.gameDisplay, 120, 425, 175, self.light_orange, "Farm {0}".format(self.level))
        self.huntButton = UXcomponent(self.gameDisplay, self.huntImg, 173, 159,425,400)

        # end level screen components
        self.goodJob = Text(self.gameDisplay, 120, 425, 140, self.light_orange, "Good Job!")
        self.endMsg = Text(self.gameDisplay, 100, 425, 230, self.light_orange, "All animals abducted!")
        self.nextButton = UXcomponent(self.gameDisplay, self.nextImg, 173, 159,425,400)

        # group for new game menu components
        self.newgameUX = [self.title, self.playButton, self.quitButton]
        
        # group for start level screen components
        self.startUX = [self.levelHeading, self.huntButton]

        # group for start level screen components
        self.endUX = [self.goodJob, self.endMsg, self.nextButton]

        # group for game over menu components
        self.gameoverUX = [self.gameOverMsg, self.restartButton, self.quitButton]

    def setupNextLevel(self):
        """ set up the next level"""
        self.shield_indicator.image = self.greenShield
        self.captured = 0
        self.level += 1
        self.num_farmers += 1
        self.num_cows += 1

    def setupNewGame(self):
        """ setup a new game"""
        self.level = 1
        self.num_cows = 2
        self.num_farmers = 1
        self.levelHeading = Text(self.gameDisplay, 120, 425, 175, self.light_orange, "Farm 1")
        self.shield_indicator.image = self.greenShield
        updatedHeading = self.levelHeading
        self.startUX[0] = updatedHeading

    def setCaptured(self):
        """ increment the captured attribute"""
        total = 0
        for x in self.animals:
            if x.captured == True:
                total += 1
        self.captured = total
