diff --git a/gamedata/assets/particles/confetti/blue/0.png b/gamedata/assets/particles/confetti/blue/0.png new file mode 100644 index 0000000..96a71aa Binary files /dev/null and b/gamedata/assets/particles/confetti/blue/0.png differ diff --git a/gamedata/assets/particles/confetti/blue/1.png b/gamedata/assets/particles/confetti/blue/1.png new file mode 100644 index 0000000..349d3b7 Binary files /dev/null and b/gamedata/assets/particles/confetti/blue/1.png differ diff --git a/gamedata/assets/particles/confetti/blue/2.png b/gamedata/assets/particles/confetti/blue/2.png new file mode 100644 index 0000000..1b895c4 Binary files /dev/null and b/gamedata/assets/particles/confetti/blue/2.png differ diff --git a/gamedata/assets/particles/confetti/red/0.png b/gamedata/assets/particles/confetti/red/0.png new file mode 100644 index 0000000..8e7b928 Binary files /dev/null and b/gamedata/assets/particles/confetti/red/0.png differ diff --git a/gamedata/assets/particles/confetti/red/1.png b/gamedata/assets/particles/confetti/red/1.png new file mode 100644 index 0000000..4f0a395 Binary files /dev/null and b/gamedata/assets/particles/confetti/red/1.png differ diff --git a/gamedata/assets/particles/confetti/red/2.png b/gamedata/assets/particles/confetti/red/2.png new file mode 100644 index 0000000..9d18f0a Binary files /dev/null and b/gamedata/assets/particles/confetti/red/2.png differ diff --git a/gamedata/assets/particles/confetti/yellow/0.png b/gamedata/assets/particles/confetti/yellow/0.png new file mode 100644 index 0000000..2c7a65f Binary files /dev/null and b/gamedata/assets/particles/confetti/yellow/0.png differ diff --git a/gamedata/assets/particles/confetti/yellow/1.png b/gamedata/assets/particles/confetti/yellow/1.png new file mode 100644 index 0000000..7df0e5d Binary files /dev/null and b/gamedata/assets/particles/confetti/yellow/1.png differ diff --git a/gamedata/assets/particles/confetti/yellow/2.png b/gamedata/assets/particles/confetti/yellow/2.png new file mode 100644 index 0000000..9f9e101 Binary files /dev/null and b/gamedata/assets/particles/confetti/yellow/2.png differ diff --git a/gamedata/maps/Level 1/map.json b/gamedata/maps/Level 1/map.json index 74522af..5f299ce 100644 --- a/gamedata/maps/Level 1/map.json +++ b/gamedata/maps/Level 1/map.json @@ -1,6 +1,6 @@ { "ogmoVersion": "3.4.0", - "width": 1392, + "width": 1536, "height": 432, "offsetX": 0, "offsetY": 0, @@ -12,7 +12,7 @@ "offsetY": 0, "gridCellWidth": 16, "gridCellHeight": 16, - "gridCellsX": 87, + "gridCellsX": 96, "gridCellsY": 27, "tileset": "base.png", "dataCoords2D": [ @@ -103,6 +103,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -192,6 +201,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -281,6 +299,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -370,6 +397,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -459,6 +495,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -548,6 +593,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -637,6 +691,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -726,6 +789,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -815,6 +887,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -904,6 +985,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -993,6 +1083,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [5, 4], + [6, 4], + [5, 4], + [6, 4], + [4, 4], + [-1], [-1] ], [ @@ -1082,6 +1181,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [5, 5], + [6, 5], + [5, 5], + [6, 5], + [4, 5], + [-1], [-1] ], [ @@ -1171,6 +1279,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [7, 4], + [8, 4], + [7, 4], + [8, 4], + [4, 5], + [-1], [-1] ], [ @@ -1260,6 +1377,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [7, 5], + [8, 5], + [7, 5], + [8, 5], + [4, 5], + [-1], [-1] ], [ @@ -1349,6 +1475,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [7, 4], + [8, 4], + [7, 4], + [8, 4], + [4, 5], + [-1], [-1] ], [ @@ -1438,6 +1573,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [7, 5], + [8, 5], + [7, 5], + [8, 5], + [4, 5], + [-1], [-1] ], [ @@ -1527,6 +1671,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [0, 5], + [1, 5], + [7, 4], + [8, 4], + [4, 6], + [-1], [-1] ], [ @@ -1616,6 +1769,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [0, 6], + [1, 6], + [7, 5], + [8, 5], + [-1], + [-1], [-1] ], [ @@ -1705,6 +1867,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [0, 5], + [1, 5], + [-1], + [-1], [-1] ], [ @@ -1794,6 +1965,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [0, 6], + [1, 6], + [-1], + [-1], [-1] ], [ @@ -1883,6 +2063,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -1972,6 +2161,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -2061,6 +2259,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -2150,6 +2357,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -2239,6 +2455,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -2328,6 +2553,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -2417,6 +2651,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ] ], @@ -2430,7 +2673,7 @@ "offsetY": 0, "gridCellWidth": 16, "gridCellHeight": 16, - "gridCellsX": 87, + "gridCellsX": 96, "gridCellsY": 27, "tileset": "base.png", "dataCoords2D": [ @@ -2521,6 +2764,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -2610,6 +2862,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -2699,6 +2960,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -2788,6 +3058,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -2877,6 +3156,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -2966,6 +3254,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -3055,6 +3352,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -3144,6 +3450,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -3233,6 +3548,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -3322,6 +3646,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -3357,6 +3690,9 @@ [-1], [-1], [-1], + [6, 6], + [7, 6], + [8, 6], [-1], [-1], [-1], @@ -3388,6 +3724,12 @@ [-1], [-1], [-1], + [9, 8], + [-1], + [9, 8], + [-1], + [-1], + [-1], [-1], [-1], [-1], @@ -3446,6 +3788,15 @@ [-1], [-1], [-1], + [6, 7], + [7, 7], + [8, 7], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1], [-1], [-1], @@ -3509,13 +3860,13 @@ [-1], [-1], [-1], - [-1], - [-1], - [-1], - [-1], - [-1], - [-1], - [-1], + [10, 6], + [9, 6], + [10, 6], + [9, 6], + [10, 6], + [9, 6], + [10, 6], [-1], [-1], [-1], @@ -3534,11 +3885,11 @@ [15, 0], [14, 0], [15, 0], - [-1], - [-1], - [-1], - [-1], - [-1], + [9, 8], + [6, 8], + [7, 8], + [8, 8], + [9, 8], [15, 0], [14, 0], [15, 0], @@ -3579,6 +3930,15 @@ [-1], [-1], [-1], + [9, 8], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1], [-1], [-1], @@ -3598,13 +3958,13 @@ [-1], [-1], [-1], - [-1], - [-1], - [-1], - [-1], - [-1], - [-1], - [-1], + [10, 7], + [9, 7], + [10, 7], + [9, 7], + [10, 7], + [9, 7], + [10, 7], [-1], [-1], [-1], @@ -3678,6 +4038,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -3767,6 +4136,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -3856,6 +4234,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -3945,6 +4332,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -4034,6 +4430,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -4123,6 +4528,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -4212,6 +4626,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -4301,6 +4724,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -4390,6 +4822,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -4479,6 +4920,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -4568,6 +5018,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -4657,6 +5116,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -4746,6 +5214,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ], [ @@ -4835,6 +5312,15 @@ [-1], [-1], [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], + [-1], [-1] ] ], @@ -4848,7 +5334,7 @@ "offsetY": 0, "gridCellWidth": 16, "gridCellHeight": 16, - "gridCellsX": 87, + "gridCellsX": 96, "gridCellsY": 27, "entities": [ {"name": "Solid", "id": 25, "_eid": "17026310", "x": 16, "y": 224, "width": 208, "height": 80, "originX": 0, "originY": 0}, @@ -4868,7 +5354,8 @@ {"name": "SemiSolid", "id": 40, "_eid": "59763689", "x": 832, "y": 208, "width": 64, "height": 16, "originX": 0, "originY": 0}, {"name": "SemiSolid", "id": 42, "_eid": "59763689", "x": 1040, "y": 176, "width": 80, "height": 16, "originX": 0, "originY": 0}, {"name": "SemiSolid", "id": 43, "_eid": "59763689", "x": 1184, "y": 208, "width": 80, "height": 16, "originX": 0, "originY": 0}, - {"name": "Solid", "id": 44, "_eid": "17026310", "x": 832, "y": 336, "width": 16, "height": 32, "originX": 0, "originY": 0} + {"name": "Solid", "id": 44, "_eid": "17026310", "x": 832, "y": 336, "width": 16, "height": 32, "originX": 0, "originY": 0}, + {"name": "SemiSolid", "id": 45, "_eid": "59763689", "x": 1424, "y": 160, "width": 80, "height": 16, "originX": 0, "originY": 0} ] }, { @@ -4878,7 +5365,7 @@ "offsetY": 0, "gridCellWidth": 16, "gridCellHeight": 16, - "gridCellsX": 87, + "gridCellsX": 96, "gridCellsY": 27, "entities": [ {"name": "Spawns", "id": 4, "_eid": "25816588", "x": 64, "y": 176, "originX": 0, "originY": 0} @@ -4891,7 +5378,7 @@ "offsetY": 0, "gridCellWidth": 16, "gridCellHeight": 16, - "gridCellsX": 87, + "gridCellsX": 96, "gridCellsY": 27, "entities": [ { @@ -4923,20 +5410,20 @@ }, {"name": "Balloon", "id": 36, "_eid": "16494694", "x": 1296, "y": 176, "originX": 0, "originY": 0}, {"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": "WaterChange", "id": 40, "_eid": "48957583", - "x": 208, - "y": 208, + "x": 64, + "y": 176, "originX": 0, "originY": 0, "nodes": [ - {"x": 240, "y": 240} + {"x": 96, "y": 240} ], "values": {"Speed": 1} - } + }, + {"name": "End", "id": 42, "_eid": "65940624", "x": 1456, "y": 128, "originX": 0, "originY": 0} ] } ] diff --git a/gamedata/objects/ingame/endflag.py b/gamedata/objects/ingame/endflag.py new file mode 100644 index 0000000..7660c49 --- /dev/null +++ b/gamedata/objects/ingame/endflag.py @@ -0,0 +1,59 @@ +from gamedata.objects.ingame.ennemies.ennemy import Ennemy + +class EndFlag(Ennemy): + + def __init__(self,*args): + + super().__init__(*args) + + self.blueflags = self.game.getSpriteDir("flags/blue/") + self.greenflags = self.game.getSpriteDir("flags/green/") + + self.confettis = {} + self.confettiscolors = ["red","blue","yellow"] + for i in self.confettiscolors: + self.confettis[i] = self.game.getSpriteDir("particles/confetti/"+i+"/") + self.sprites = self.blueflags + + self.depth = -1 + + self.spriteindex = 0 + self.animspeed = 10 + + self.rect[2],self.rect[3] = self.sprites[0].get_size() + + self.candie = False + self.canhit = False + + self.endtimer = self.game.lib.Timer(3) + self.ended = False + + def step(self): + + super().step() + self.spriteindex+=self.animspeed*self.game.dt + + if self.player: + if self.player.rect.colliderect(self.rect): + self.sprites = self.greenflags + self.player.canmove = False + if not self.ended: + self.ended = True + nb = 30 + for i in range(nb): + color = self.game.lib.choice(self.confettiscolors) + sprites = self.confettis[color] + velx = self.game.lib.randint(-1,1) + vely = self.game.lib.randint(-5,-4)/3 + steps = 5 + offsetx = self.game.lib.randint(-10*steps,10*steps)/(steps) + offsety = self.game.lib.randint(-5,5) + self.game.addParticle(sprites,self.rect.center[0]+offsetx,self.rect.center[1]+offsety,velx=velx,vely=vely,modvely=0.05,fps=2) + + if self.ended: + if self.endtimer.tick(self.game.dt): + self.game.scene = self.game.scenes.overworld + + def draw(self): + sprite = self.sprites[int(self.spriteindex)%len(self.sprites)] + self.game.window.blit(sprite,[self.rect[0]-self.game.globals["camerax"],self.rect[1]-self.game.globals["cameray"]]) diff --git a/gamedata/objects/ingame/player.py b/gamedata/objects/ingame/player.py index ba7040c..5554616 100644 --- a/gamedata/objects/ingame/player.py +++ b/gamedata/objects/ingame/player.py @@ -15,12 +15,12 @@ class Player(Movable): self.spritefalling = game.sprite_lib["player/falling.png"] # Descending self.spritehurt = game.sprite_lib["player/hurt.png"] # Being hurted self.spritelanding = game.sprite_lib["player/landing.png"] - self.testsprites = self.game.getchars("Test") self.landingtimer = 0 self.maxlandtime = 0.15 self.spriteindex = 0 self.flipx = False self.animationspeed = 2.5 + self.canmove = True self.sprite = self.spritestill collisionratio = 0.7 @@ -116,7 +116,8 @@ class Player(Movable): keys = self.game.inputs["keys"] self.horspd = 0 if canmove: - self.horspd=(keys["right"]["pressed"]-keys["left"]["pressed"])*self.game.dt*self.speed + if self.canmove: + self.horspd=(keys["right"]["pressed"]-keys["left"]["pressed"])*self.game.dt*self.speed if self.landingtimer<=0: self.sprite = self.spritestill @@ -193,7 +194,7 @@ class Player(Movable): self.jumped = False if self.onground or self.leaptimer<0: - if 0