diff --git a/src/Champs.py b/src/Champs.py index 4f7bcf9674c48805ca1ba74a4ea1a77d8eb5aa4b..2302bfa7168a3219dae7fa349e82976d0a20bd55 100755 --- a/src/Champs.py +++ b/src/Champs.py @@ -3,14 +3,14 @@ import numpy as np from Temps import * from Image import transformImage -listeImage = [pygame.transform.scale(pygame.image.load('../assets/crop'+str(i)+'phase.png'),(120,120)) for i in range(1,5)] +listeImage = [pygame.transform.scale(pygame.image.load('../assets/Plantation/crop'+str(i)+'phase.png'),(120,120)) for i in range(1,5)] #TODO : mettre une proba que les plantes meurent si il fait trop froid/chaud, et baisser cette proba de mourir avec une serre ou des torche pour l'hiver -#TODO : mettre des insecte/bacterie qui pourrai venir + class Champs: - iconInsecteStatic = pygame.transform.scale(pygame.image.load("../assets/leech.png"),(90,90)) + iconInsecteStatic = pygame.transform.scale(pygame.image.load("../assets/Plantation/leech.png"),(90,90)) def __init__ (self, temperature, humidite, tempsAvantMaturation, pos, image): self.temperature = temperature self.humidite = humidite @@ -51,10 +51,10 @@ class Champs: self.imageChamp = listeImage[self.indiceImage] else: if(self.indiceImage == 4): - self.imageChamp =pygame.transform.scale(pygame.image.load('../assets/damage.png'),(120,120)) + self.imageChamp =pygame.transform.scale(pygame.image.load('../assets/Plantation/damage.png'),(120,120)) elif(self.indiceImage == 5): self.isInfeste = False - self.imageChamp =pygame.transform.scale(pygame.image.load('../assets/fanne.png'),(120,120)) + self.imageChamp =pygame.transform.scale(pygame.image.load('../assets/Plantation/fanne.png'),(120,120)) @@ -131,7 +131,7 @@ class Champs: class Buisson (Champs): def __init__ (self, pos, prix = 10000): - super().__init__(0, 0, 0, pos, '../assets/buissonCadenas.png') + super().__init__(0, 0, 0, pos, '../assets/Interface/buissonCadenas.png') self.prix = prix self.text = self.police.render("Champ disponible à l'achat : " + str(self.prix), False, (0,0,0)) self.zoomText = self.text @@ -145,100 +145,100 @@ class Buisson (Champs): class TerrainVide(Champs): def __init__ (self, pos): - super().__init__(0, 0, 0, pos,'../assets/champ.png') + super().__init__(0, 0, 0, pos,'../assets/Plantation/champ.png') self.text = self.police.render("Température : " + str(self.temperature), False, (0,0,0)) self.zoomText = self.text class Houblon (Champs): - iconStatic = pygame.transform.scale(pygame.image.load('../assets/houblon.png'),(150,150)) + iconStatic = pygame.transform.scale(pygame.image.load('../assets/Plantation/houblon.png'),(150,150)) textStatic = police.render('Houblon',False, (0,0,0)) textDescriptionStatic = police.render("Houblon sa marche bien",False,(0,0,0)) montantAchat = 250 montantVente = 600 def __init__ (self, pos): - super().__init__(0, 0, 0, pos,'../assets/champ.png') + super().__init__(0, 0, 0, pos,'../assets/Plantation/champ.png') self.text = self.police.render("Température : " + str(self.temperature), False, (0,0,0)) self.zoomText = self.text - self.imageChamp = pygame.transform.scale(pygame.image.load('../assets/crop1phase.png'),(120,120)) + self.imageChamp = pygame.transform.scale(pygame.image.load('../assets/Plantation/crop1phase.png'),(120,120)) class Ble (Champs): - iconStatic = pygame.transform.scale(pygame.image.load('../assets/wheat.png'),(150,150)) + iconStatic = pygame.transform.scale(pygame.image.load('../assets/Plantation/wheat.png'),(150,150)) textStatic = police.render('Ble',False, (0,0,0)) textDescriptionStatic = police.render("Ble sa marche bien",False,(0,0,0)) montantAchat = 250 montantVente = 800 def __init__ (self,pos): - super().__init__(0,0,0,pos,'../assets/champ.png') + super().__init__(0,0,0,pos,'../assets/Plantation/champ.png') - self.imageChamp = pygame.transform.scale(pygame.image.load('../assets/crop1phase.png'),(120,120)) + self.imageChamp = pygame.transform.scale(pygame.image.load('../assets/Plantation/crop1phase.png'),(120,120)) class Malt (Champs): - iconStatic = pygame.transform.scale(pygame.image.load('../assets/malt.png'),(150,150)) + iconStatic = pygame.transform.scale(pygame.image.load('../assets/Plantation/malt.png'),(150,150)) textStatic = police.render('Malt',False, (0,0,0)) textDescriptionStatic = police.render("Malt sa marche bien",False,(0,0,0)) montantAchat = 300 montantVente = 800 def __init__ (self,pos): - super().__init__(0,0,0,pos,'../assets/champ.png') - self.imageChamp = pygame.transform.scale(pygame.image.load('../assets/crop1phase.png'),(120,120)) + super().__init__(0,0,0,pos,'../assets/Plantation/champ.png') + self.imageChamp = pygame.transform.scale(pygame.image.load('../assets/Plantation/crop1phase.png'),(120,120)) class Chanvre(Champs): - iconStatic = pygame.transform.scale(pygame.image.load('../assets/weed.png'),(150,150)) + iconStatic = pygame.transform.scale(pygame.image.load('../assets/Plantation/weed.png'),(150,150)) textStatic = police.render("Chanvre",False, (0,0,0)) textDescriptionStatic = police.render("Pour des spaces bières",False,(0,0,0)) montantAchat = 1000 montantVente = 5000 def __init__ (self,pos): - super().__init__(0,0,0,pos,'../assets/champ.png') - self.imageChamp = pygame.transform.scale(pygame.image.load('../assets/crop1phase.png'),(120,120)) + super().__init__(0,0,0,pos,'../assets/Plantation/champ.png') + self.imageChamp = pygame.transform.scale(pygame.image.load('../assets/Plantation/crop1phase.png'),(120,120)) class OrgeHiver(Champs): - iconStatic = pygame.transform.scale(pygame.image.load('../assets/orge.png'),(150,150)) + iconStatic = pygame.transform.scale(pygame.image.load('../assets/Plantation/orge.png'),(150,150)) textStatic = police.render("Orge hiver",False, (0,0,0)) textDescriptionStatic = police.render("Orge hiver sa marche bien",False,(0,0,0)) montantAchat = 300 montantVente = 800 def __init__ (self,pos): - super().__init__(0,0,0,pos,'../assets/champ.png') - self.imageChamp = pygame.transform.scale(pygame.image.load('../assets/crop1phase.png'),(120,120)) + super().__init__(0,0,0,pos,'../assets/Plantation/champ.png') + self.imageChamp = pygame.transform.scale(pygame.image.load('../assets/Plantation/crop1phase.png'),(120,120)) class OrgePrintemps(Champs): - iconStatic = pygame.transform.scale(pygame.image.load('../assets/OrgePrintemps.png'),(150,150)) + iconStatic = pygame.transform.scale(pygame.image.load('../assets/Plantation/OrgePrintemps.png'),(150,150)) textStatic = police.render("Orge printemps",False, (0,0,0)) textDescriptionStatic = police.render("Orge printemps sa marche bien",False,(0,0,0)) montantAchat = 500 montantVente = 1000 def __init__ (self,pos): - super().__init__(0,0,0,pos,'../assets/champ.png') + super().__init__(0,0,0,pos,'../assets/Plantation/champ.png') - self.imageChamp = pygame.transform.scale(pygame.image.load('../assets/crop1phase.png'),(120,120)) + self.imageChamp = pygame.transform.scale(pygame.image.load('../assets/Plantation/crop1phase.png'),(120,120)) class Seigle(Champs): - iconStatic = pygame.transform.scale(pygame.image.load('../assets/seigle.png'),(150,150)) + iconStatic = pygame.transform.scale(pygame.image.load('../assets/Plantation/seigle.png'),(150,150)) textStatic = police.render("Seigle",False, (0,0,0)) textDescriptionStatic = police.render("Seigle sa marche bien",False,(0,0,0)) montantAchat = 200 montantVente = 600 def __init__ (self,pos): - super().__init__(0,0,0,pos,'../assets/champ.png') - self.imageChamp = pygame.transform.scale(pygame.image.load('../assets/crop1phase.png'),(120,120)) + super().__init__(0,0,0,pos,'../assets/Plantation/champ.png') + self.imageChamp = pygame.transform.scale(pygame.image.load('../assets/Plantation/crop1phase.png'),(120,120)) class Pesticide(Champs): - iconStatic = pygame.transform.scale(pygame.image.load('../assets/pesticide.png'),(150,150)) + iconStatic = pygame.transform.scale(pygame.image.load('../assets/Plantation/pesticide.png'),(150,150)) textStatic = police.render("Pesticide",False, (0,0,0)) textDescriptionStatic = police.render("Pour tuer les insectes",False,(0,0,0)) montantAchat = 200 def __init__ (self,pos): - super().__init__(0,0,0,pos,'../assets/pesticide.png') + super().__init__(0,0,0,pos,'../assets/Plantation/pesticide.png') #TODO : class Bussion, diff --git a/src/Image.py b/src/Image.py index 4b2b4929f28fdbb9c475082cbb02f1f4c2238175..3c78181e146abde7e04118056a31fddb9d3f84f1 100644 --- a/src/Image.py +++ b/src/Image.py @@ -9,14 +9,10 @@ class Image: self.moneyImage = pygame.image.load("../assets/Interface/money.png") self.backgroundImage = pygame.image.load("../assets/Interface/terre.png") self.rainImage = pygame.image.load("../assets/Temps/pluie.png") - self.barnImage = pygame.image.load("../assets/grange.webp") - self.arrowImage1 = pygame.image.load("../assets/flecheScene.png") - self.arrowImage2 = pygame.image.load("../assets/flecheScene2.png") - self.arrowNextImage = pygame.image.load("../assets/suite.png") + self.arrowNextImage = pygame.image.load("../assets/Interface/suite.png") # Modification de l'échelle des images self.backgroundImage = self.setFullScreen(self.backgroundImage) - self.barnImage = self.setFullScreen(self.barnImage) def setFullScreen(self, image): image = pygame.transform.scale(image, (self.screen.get_width(), self.screen.get_height())) diff --git a/src/Infrastructure.py b/src/Infrastructure.py index 6b790a913a957d9ccbf049a598b3482e7844d70b..08cc96d9fd3694fd05449ea1520e89b4fe80b95c 100644 --- a/src/Infrastructure.py +++ b/src/Infrastructure.py @@ -68,43 +68,43 @@ class Infrastructure: class Puit (Infrastructure): - iconStatic = pygame.transform.scale(pygame.image.load('../assets/puit.png'),(150,150)) + iconStatic = pygame.transform.scale(pygame.image.load('../assets/Batiment/puit.png'),(150,150)) textStatic = police.render('Puits',False, (0,0,0)) textDescriptionStatic = police.render("C'est un puit",False,(0,0,0)) montantAchat = 2000 def __init__ (self,pos): - super().__init__(pos,'../assets/champ.png') - self.imagebat = pygame.transform.scale(pygame.image.load('../assets/puit.png'),(120,120)) + super().__init__(pos,'../assets/Plantation/champ.png') + self.imagebat = pygame.transform.scale(pygame.image.load('../assets/Batiment/puit.png'),(120,120)) class ReservoirEau (Infrastructure): - iconStatic = pygame.transform.scale(pygame.image.load('../assets/storagetank.png'),(150,150)) + iconStatic = pygame.transform.scale(pygame.image.load('../assets/Batiment/storagetank.png'),(150,150)) textStatic = police.render('Capteur eau de pluie',False, (0,0,0)) textDescriptionStatic = police.render("Permet de capturer l'eau de pluit",False,(0,0,0)) montantAchat = 3000 def __init__ (self,pos): - super().__init__(pos,'../assets/champ.png') - self.imagebat = pygame.transform.scale(pygame.image.load('../assets/storagetank.png'),(120,120)) + super().__init__(pos,'../assets/Plantation/champ.png') + self.imagebat = pygame.transform.scale(pygame.image.load('../assets/Batiment/storagetank.png'),(120,120)) class Irrigation (Infrastructure): - iconStatic = pygame.transform.scale(pygame.image.load('../assets/irrigation.png'),(150,150)) + iconStatic = pygame.transform.scale(pygame.image.load('../assets/Batiment/irrigation.png'),(150,150)) textStatic = police.render('Arrosoir automatique ',False, (0,0,0)) textDescriptionStatic = police.render("Permet d'arroser les plantes",False,(0,0,0)) montantAchat = 5000 def __init__ (self,pos): - super().__init__(pos,'../assets/champ.png') - self.imagebat = pygame.transform.scale(pygame.image.load('../assets/irrigation.png'),(120,120)) + super().__init__(pos,'../assets/Plantation/champ.png') + self.imagebat = pygame.transform.scale(pygame.image.load('../assets/Batiment/irrigation.png'),(120,120)) class IrrigationGoutte (Infrastructure): - iconStatic = pygame.transform.scale(pygame.image.load('../assets/irrigationGoutte.png'),(150,150)) + iconStatic = pygame.transform.scale(pygame.image.load('../assets/Batiment/irrigationGoutte.png'),(150,150)) textStatic = police.render('Système goutte à goutte',False, (0,0,0)) textDescriptionStatic = police.render("Permet d'arroser les plantes en économisant l'eau",False,(0,0,0)) montantAchat = 10000 def __init__ (self,pos): - super().__init__(pos,'../assets/champ.png') - self.imagebat = pygame.transform.scale(pygame.image.load('../assets/irrigationGoutte.png'),(120,120)) + super().__init__(pos,'../assets/Plantation/champ.png') + self.imagebat = pygame.transform.scale(pygame.image.load('../assets/Batiment/irrigationGoutte.png'),(120,120)) class Serre (Infrastructure): - iconoriginal = pygame.image.load('../assets/serre.png') + iconoriginal = pygame.image.load('../assets/Batiment/serre.png') iconStatic = pygame.transform.scale(iconoriginal,(150,150)) textStatic = police.render('Serre',False, (0,0,0)) textDescriptionStatic = police.render("Permet de proteger les cultures du froid et de la chaleur",False,(0,0,0)) @@ -115,7 +115,7 @@ class Serre (Infrastructure): iconStaticCopie.fill((255, 255, 255, 70), None, pygame.BLEND_RGBA_MULT) def __init__ (self,pos): - super().__init__(pos,'../assets/champ.png') + super().__init__(pos,'../assets/Plantation/champ.png') self.champsAfecte = None #self.imagebat = pygame.transform.scale(pygame.image.load('../assets/serre.png'),(120,120)) @@ -133,34 +133,15 @@ class Serre (Infrastructure): varlongueur = camera.convertLocation(self.pos) screen.blit(self.imgZoom, (varlongueur[0]+ (self.champRect.w - self.rectScale.w)/2,varlongueur[1]+ (self.champRect.h - self.rectScale.h)/2)) - - - """ - if hasattr(self,'imagebat'): - scaleBat = camera.scaleImage(self.imagebat) - if scaleBat: - self.BatZoom = scaleBat - varlongueur = camera.convertLocation(self.pos) - self.rectbatScal = pygame.rect.Rect(camera.convertLocation(self.pos), self.BatZoom.get_size()) - screen.blit( - self.BatZoom, - ( - varlongueur[0] + - (self.rectScale.w-self.rectbatScal.w) - /2, - varlongueur[1] + - (self.rectScale.h-self.rectbatScal.h) - /2) - ) - """ + class Torche (Infrastructure): - iconStatic = pygame.transform.scale(pygame.image.load('../assets/torche.png'),(150,150)) + iconStatic = pygame.transform.scale(pygame.image.load('../assets/Batiment/torche.png'),(150,150)) textStatic = police.render('Torche',False, (0,0,0)) textDescriptionStatic = police.render("Permet de proteger les cultures du froid ",False,(0,0,0)) montantAchat = 1000 def __init__ (self,pos): - super().__init__(pos,'../assets/champ.png') + super().__init__(pos,'../assets/Plantation/champ.png') self.zoneafecte = None #self.imagebat = pygame.transform.scale(pygame.image.load('../assets/torche.png'),(120,120)) diff --git a/src/Temps.py b/src/Temps.py index 36a1e5fb5e8ed3778d28af620e782ca9a0395a36..33046d08e985532314d8190c88490a54903368aa 100755 --- a/src/Temps.py +++ b/src/Temps.py @@ -99,7 +99,7 @@ class Temps: self.tempsaisonImageDeuxPosiiton = police2.render(self.nextSaison +" : "+ str(round(self.nextglobalTemps,1))+" °C",True,(0,0,0)) for key,value in self.climats.items(): - self.climats.get(key)['image'] = transformImage(pygame.image.load("../assets/"+key+".png"),400,300) + self.climats.get(key)['image'] = transformImage(pygame.image.load("../assets/Saison/"+key+".png"),400,300) self.ListTemps = [] @@ -147,19 +147,19 @@ class Temps: def tempAAfficher(self,temperature:float,humidite)-> str: #Determination du temps a afficher if( temperature < 0 and humidite >80): - return "../assets/neige.png" + return "../assets/Temps/neige.png" elif (temperature < 10): - return "../assets/froid.png" + return "../assets/Temps/froid.png" elif (temperature < 35): - return "../assets/chaud.png" + return "../assets/Temps/chaud.png" elif (temperature > 34): if(humidite > 85): - return "../assets/orage.png" + return "../assets/Temps/orage.png" if(humidite < 65): - return "../assets/secheresse.png" + return "../assets/Temps/secheresse.png" else: - return "../assets/canicule.png" + return "../assets/Temps/canicule.png" else: pass