diff --git a/gamedata/assets/icon.png b/gamedata/assets/icon.png index 79b5283..5b433e9 100644 Binary files a/gamedata/assets/icon.png and b/gamedata/assets/icon.png differ diff --git a/gamedata/game.py b/gamedata/game.py index 635fc0b..e835985 100644 --- a/gamedata/game.py +++ b/gamedata/game.py @@ -11,7 +11,7 @@ class Game(): self.DISPLAY_WIDTH, self.DISPLAY_HEIGHT = 1280, 720 self.window = pygame.Surface((self.DISPLAY_WIDTH,self.DISPLAY_HEIGHT)) self.realwindow = pygame.display.set_mode((self.DISPLAY_WIDTH,self.DISPLAY_HEIGHT)) - pygame.display.set_caption("kfr 2 ???") + pygame.display.set_caption("Overflown") pygame.init() pygame.mixer.init() @@ -100,7 +100,7 @@ class Game(): self.pasttime = time.time() # Je charge la scene de base - scenes.fight(self) + scenes.ingame(self) def set_camera(self,posx,posy): self.globals["camerax"], self.globals["cameray"] = posx,posy diff --git a/gamedata/maps/TulipFields/background0.png b/gamedata/maps/Level 1/background0.png similarity index 100% rename from gamedata/maps/TulipFields/background0.png rename to gamedata/maps/Level 1/background0.png diff --git a/gamedata/maps/TulipFields/background1.png b/gamedata/maps/Level 1/background1.png similarity index 100% rename from gamedata/maps/TulipFields/background1.png rename to gamedata/maps/Level 1/background1.png diff --git a/gamedata/maps/TulipFields/background2.png b/gamedata/maps/Level 1/background2.png similarity index 100% rename from gamedata/maps/TulipFields/background2.png rename to gamedata/maps/Level 1/background2.png diff --git a/gamedata/maps/TulipFields/background3.png b/gamedata/maps/Level 1/background3.png similarity index 100% rename from gamedata/maps/TulipFields/background3.png rename to gamedata/maps/Level 1/background3.png diff --git a/gamedata/maps/TulipFields/base.png b/gamedata/maps/Level 1/base.png similarity index 100% rename from gamedata/maps/TulipFields/base.png rename to gamedata/maps/Level 1/base.png diff --git a/gamedata/maps/TulipFields/filler.png b/gamedata/maps/Level 1/filler.png similarity index 100% rename from gamedata/maps/TulipFields/filler.png rename to gamedata/maps/Level 1/filler.png diff --git a/gamedata/maps/TulipFields/map.json b/gamedata/maps/Level 1/map.json similarity index 99% rename from gamedata/maps/TulipFields/map.json rename to gamedata/maps/Level 1/map.json index f6c8850..74522af 100644 --- a/gamedata/maps/TulipFields/map.json +++ b/gamedata/maps/Level 1/map.json @@ -4925,14 +4925,17 @@ {"name": "Balloon", "id": 37, "_eid": "16494694", "x": 1360, "y": 160, "originX": 0, "originY": 0}, {"name": "Balloon", "id": 38, "_eid": "16494694", "x": 1264, "y": 128, "originX": 0, "originY": 0}, { - "name": "Spring", - "id": 39, - "_eid": "24018769", - "x": 912, - "y": 336, + "name": "WaterChange", + "id": 40, + "_eid": "48957583", + "x": 208, + "y": 208, "originX": 0, "originY": 0, - "values": {"angle": 180, "strength": 7} + "nodes": [ + {"x": 240, "y": 240} + ], + "values": {"Speed": 1} } ] } diff --git a/gamedata/objects/combat/ennemies/balloon.py b/gamedata/objects/ingame/ennemies/balloon.py similarity index 94% rename from gamedata/objects/combat/ennemies/balloon.py rename to gamedata/objects/ingame/ennemies/balloon.py index 57d5705..3eb4d32 100644 --- a/gamedata/objects/combat/ennemies/balloon.py +++ b/gamedata/objects/ingame/ennemies/balloon.py @@ -1,4 +1,4 @@ -from gamedata.objects.combat.ennemies.ennemy import Ennemy +from gamedata.objects.ingame.ennemies.ennemy import Ennemy class Balloon(Ennemy): diff --git a/gamedata/objects/combat/ennemies/crate.py b/gamedata/objects/ingame/ennemies/crate.py similarity index 93% rename from gamedata/objects/combat/ennemies/crate.py rename to gamedata/objects/ingame/ennemies/crate.py index 76c35fb..d6e60a5 100644 --- a/gamedata/objects/combat/ennemies/crate.py +++ b/gamedata/objects/ingame/ennemies/crate.py @@ -1,4 +1,4 @@ -from gamedata.objects.combat.ennemies.ennemy import Ennemy +from gamedata.objects.ingame.ennemies.ennemy import Ennemy class Crate(Ennemy): diff --git a/gamedata/objects/combat/ennemies/ennemy.py b/gamedata/objects/ingame/ennemies/ennemy.py similarity index 98% rename from gamedata/objects/combat/ennemies/ennemy.py rename to gamedata/objects/ingame/ennemies/ennemy.py index 579fe09..42c2807 100644 --- a/gamedata/objects/combat/ennemies/ennemy.py +++ b/gamedata/objects/ingame/ennemies/ennemy.py @@ -1,4 +1,4 @@ -from gamedata.objects.combat.movable import Movable +from gamedata.objects.ingame.movable import Movable class Ennemy(Movable): diff --git a/gamedata/objects/combat/ennemies/robot.py b/gamedata/objects/ingame/ennemies/robot.py similarity index 97% rename from gamedata/objects/combat/ennemies/robot.py rename to gamedata/objects/ingame/ennemies/robot.py index d4b0ffd..17635ca 100644 --- a/gamedata/objects/combat/ennemies/robot.py +++ b/gamedata/objects/ingame/ennemies/robot.py @@ -1,4 +1,4 @@ -from gamedata.objects.combat.ennemies.ennemy import Ennemy +from gamedata.objects.ingame.ennemies.ennemy import Ennemy class Robot(Ennemy): diff --git a/gamedata/objects/combat/ennemies/spring.py b/gamedata/objects/ingame/ennemies/spring.py similarity index 98% rename from gamedata/objects/combat/ennemies/spring.py rename to gamedata/objects/ingame/ennemies/spring.py index f70fcdf..0643dfa 100644 --- a/gamedata/objects/combat/ennemies/spring.py +++ b/gamedata/objects/ingame/ennemies/spring.py @@ -1,4 +1,4 @@ -from gamedata.objects.combat.ennemies.ennemy import Ennemy +from gamedata.objects.ingame.ennemies.ennemy import Ennemy class Spring(Ennemy): diff --git a/gamedata/objects/ingame/ennemies/waterchange.py b/gamedata/objects/ingame/ennemies/waterchange.py new file mode 100644 index 0000000..4b2e25a --- /dev/null +++ b/gamedata/objects/ingame/ennemies/waterchange.py @@ -0,0 +1,23 @@ +from gamedata.objects.ingame.ennemies.ennemy import Ennemy + +class WaterChange(Ennemy): + + def __init__(self,*args): + + super().__init__(*args) + self.rect[2] = self.tileset.tilew + self.rect[3] = self.tileset.tileh + self.canhit = False + self.candie = False + + self.objective = self.nodes[0]["y"]+8 + self.speed = self.customvalues["Speed"] + + def step(self): + super().step() + if self.rect.colliderect(self.player.rect): + self.water.destinationy = self.objective + self.water.speed = self.speed + + def draw(self): + pass diff --git a/gamedata/objects/combat/hitbox.py b/gamedata/objects/ingame/hitbox.py similarity index 100% rename from gamedata/objects/combat/hitbox.py rename to gamedata/objects/ingame/hitbox.py diff --git a/gamedata/objects/combat/manager.py b/gamedata/objects/ingame/manager.py similarity index 100% rename from gamedata/objects/combat/manager.py rename to gamedata/objects/ingame/manager.py diff --git a/gamedata/objects/combat/movable.py b/gamedata/objects/ingame/movable.py similarity index 100% rename from gamedata/objects/combat/movable.py rename to gamedata/objects/ingame/movable.py diff --git a/gamedata/objects/combat/player.py b/gamedata/objects/ingame/player.py similarity index 99% rename from gamedata/objects/combat/player.py rename to gamedata/objects/ingame/player.py index 67439d7..c4cfc56 100644 --- a/gamedata/objects/combat/player.py +++ b/gamedata/objects/ingame/player.py @@ -1,4 +1,4 @@ -from gamedata.objects.combat.movable import Movable +from gamedata.objects.ingame.movable import Movable class Player(Movable): diff --git a/gamedata/objects/combat/tileset.py b/gamedata/objects/ingame/tileset.py similarity index 95% rename from gamedata/objects/combat/tileset.py rename to gamedata/objects/ingame/tileset.py index a493c28..684f842 100644 --- a/gamedata/objects/combat/tileset.py +++ b/gamedata/objects/ingame/tileset.py @@ -1,8 +1,9 @@ from gamedata.objects.base import BaseObject -from gamedata.objects.combat.ennemies.robot import Robot -from gamedata.objects.combat.ennemies.crate import Crate -from gamedata.objects.combat.ennemies.balloon import Balloon -from gamedata.objects.combat.ennemies.spring import Spring +from gamedata.objects.ingame.ennemies.robot import Robot +from gamedata.objects.ingame.ennemies.crate import Crate +from gamedata.objects.ingame.ennemies.balloon import Balloon +from gamedata.objects.ingame.ennemies.spring import Spring +from gamedata.objects.ingame.ennemies.waterchange import WaterChange class TilesetRenderer(BaseObject): @@ -60,7 +61,7 @@ class TilesetRenderer(BaseObject): self.layers = [] self.spawns = [] spawnlists = {"Spawns":self.spawns} - ennemies = {"Robot":Robot,"Crate":Crate,"Balloon":Balloon,"Spring":Spring} + ennemies = {"Robot":Robot,"Crate":Crate,"Balloon":Balloon,"Spring":Spring,"WaterChange":WaterChange} self.queue = [] # For spawning ennemies after beeing initialized if "layers" in json.keys() and type(json["layers"]).__name__=="list": solidlayer = False diff --git a/gamedata/objects/combat/water.py b/gamedata/objects/ingame/water.py similarity index 88% rename from gamedata/objects/combat/water.py rename to gamedata/objects/ingame/water.py index 2cba052..245eabe 100644 --- a/gamedata/objects/combat/water.py +++ b/gamedata/objects/ingame/water.py @@ -2,11 +2,14 @@ from gamedata.objects.base import BaseObject class Water(BaseObject): - def __init__(self,y,game): + def __init__(self,game): + + self.tileset = game.gameloop.findname("TilesetRenderer")[0] + y = self.tileset.spawns[0].center[1]+game.globals["camerah"]/2 + self.destinationy = y super().__init__(0,y,game,game.DISPLAY_WIDTH,game.DISPLAY_HEIGHT) - self.destinationy = y self.speed = 10 self.depth = 2 diff --git a/gamedata/scenes.py b/gamedata/scenes.py index a551320..ae7b062 100644 --- a/gamedata/scenes.py +++ b/gamedata/scenes.py @@ -4,11 +4,11 @@ from gamedata.objects.bg.menubackground import MenuBackground from gamedata.objects.menu.optionmenu import OptionMenu from gamedata.objects.sliders.bgmslider import BGMSlider from gamedata.objects.sliders.sfxslider import SFXSlider -from gamedata.objects.combat.player import Player -from gamedata.objects.combat.manager import FightManager -from gamedata.objects.combat.hitbox import Hitbox -from gamedata.objects.combat.tileset import TilesetRenderer -from gamedata.objects.combat.water import Water +from gamedata.objects.ingame.player import Player +from gamedata.objects.ingame.manager import FightManager +from gamedata.objects.ingame.hitbox import Hitbox +from gamedata.objects.ingame.tileset import TilesetRenderer +from gamedata.objects.ingame.water import Water def main(game): game.scaleCamera() @@ -18,17 +18,12 @@ def main(game): game.gameloop.summon(bg) game.gameloop.summon(menu) -def fight(game): +def ingame(game,level="Level 1"): game.scaleCamera(416,234) game.gameloop.reinit() - mapname = game.lib.choice(list(game.levels_lib.keys())) - manager = FightManager(game) - game.gameloop.summon(manager) - tileset = TilesetRenderer(0,0,game,mapname) + tileset = TilesetRenderer(0,0,game,level) game.gameloop.summon(tileset) - box = Hitbox(100,80,game) - game.gameloop.summon(box) - water = Water(250,game) + water = Water(game) game.gameloop.summon(water) p1 = Player(game) game.gameloop.summon(p1)