Compare commits

...

3 Commits

Author SHA1 Message Date
572002db32 New backgrounds for lvl1 2021-11-24 20:28:26 +01:00
4517c6d877 Added second level 2021-11-24 19:59:23 +01:00
c6a32a6b65 Water animations on map 2021-11-24 16:04:34 +01:00
26 changed files with 5749 additions and 2068 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 675 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 674 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 581 B

BIN
gamedata/assets/ripple/11. Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 581 B

BIN
gamedata/assets/ripple/12. Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 581 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 690 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 581 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 581 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 581 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 581 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 581 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 581 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 581 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 33 KiB

File diff suppressed because it is too large Load Diff

View File

@ -1583,8 +1583,16 @@
{"x": 512, "y": 96},
{"x": 640, "y": 144}
],
"values": {"0": "Beginning;20", "1": "The Docks;40"}
}
"values": {"0": "Beginning;18", "1": "The Docks;18"}
},
{"name": "Ripple", "id": 1, "_eid": "76589705", "x": 368, "y": 192, "originX": 0, "originY": 0},
{"name": "Ripple", "id": 2, "_eid": "76589705", "x": 224, "y": 176, "originX": 0, "originY": 0},
{"name": "Ripple", "id": 3, "_eid": "76589705", "x": 432, "y": 144, "originX": 0, "originY": 0},
{"name": "Ripple", "id": 4, "_eid": "76589705", "x": 464, "y": 208, "originX": 0, "originY": 0},
{"name": "Ripple", "id": 5, "_eid": "76589705", "x": 208, "y": 80, "originX": 0, "originY": 0},
{"name": "Ripple", "id": 6, "_eid": "76589705", "x": 272, "y": 16, "originX": 0, "originY": 0},
{"name": "Ripple", "id": 7, "_eid": "76589705", "x": 336, "y": 64, "originX": 0, "originY": 0},
{"name": "Ripple", "id": 8, "_eid": "76589705", "x": 448, "y": 16, "originX": 0, "originY": 0}
]
}
]

View File

@ -8,6 +8,8 @@ class Ennemy(Movable):
self.player = None
self.damage = 1
self.respawnmargin = 30
self.respawn = True
@ -43,7 +45,7 @@ class Ennemy(Movable):
hor = 1
else:
hor = -1
self.player.yeet(hor*6,self.player.gravityway*-3)
self.player.yeet(hor*6,self.player.gravityway*-3,dmg=self.damage)
if self.candie and self.player.canhit:
if self.rect.colliderect(self.player.hitrect):
# Die

View File

@ -25,6 +25,7 @@ class Player(Movable):
self.hp = 2
self.dead = False
self.spikes = self.tileset.spikes
self.deathtimer = self.game.lib.Timer(0.5)
self.deadsfx = self.game.sound_lib["sfx/dead.wav"]
self.retrytext = self.game.getchars("Try again !")
@ -219,8 +220,9 @@ class Player(Movable):
super().step() # Actually move
if self.rect.center[1]>self.game.globals["cameray"]+self.game.globals["camerah"]:
self.die()
self.game.globals["scamerax"] = 4
self.game.globals["scameray"] = 4
for i in self.spikes:
if i.collidepoint(self.rect.center):
self.die()
# Updated hitrect
self.hitrect[0] = self.rect.center[0]-self.hitrect[2]/2
offset = 0
@ -288,7 +290,7 @@ class Player(Movable):
self.combo+=1
self.combotimer = 1
def yeet(self,hor,ver,resetcombo=True):
def yeet(self,hor,ver,resetcombo=True,dmg = 1):
if not self.dead:
self.verspd = 0
self.horkb = hor
@ -299,12 +301,14 @@ class Player(Movable):
self.game.globals["scameray"] = 4
self.combo = 0
self.hurtsfx.play()
self.hp-=1
self.hp-=dmg
if self.hp<=0:
self.die()
def die(self):
if not self.dead:
self.game.globals["scamerax"] = 4
self.game.globals["scameray"] = 4
self.deadsfx.play()
self.depth = 5
self.rect[2],self.rect[3] = 0,0

View File

@ -7,6 +7,7 @@ from gamedata.objects.ingame.ennemies.waterchange import WaterChange
from gamedata.objects.ingame.ennemies.trashbag import TrashBag
from gamedata.objects.ingame.endflag import EndFlag
from gamedata.objects.levels import Levels
from gamedata.objects.ripple import Ripple
class TilesetRenderer(BaseObject):
@ -57,7 +58,7 @@ class TilesetRenderer(BaseObject):
height = bg.get_height()
nbs = self.game.globals["cameraw"]/width
lastoffset = self.rect[1]+(self.bgoffset-self.game.globals["cameray"])*ratio
for i in range(round(nbs+0.5)):
for i in range(round(max(nbs+0.5,2))):
self.game.window.blit(bg,[(-self.game.globals["camerax"]*ratio)%width+(i-1)*width,lastoffset])
# Draw filler
if self.level["filler"]:
@ -74,10 +75,11 @@ class TilesetRenderer(BaseObject):
name = level["name"]
self.rects = []
self.semirects = []
self.spikes = []
self.layers = []
self.spawns = []
spawnlists = {"Spawns":self.spawns}
ennemies = {"Robot":Robot,"Crate":Crate,"Balloon":Balloon,"Spring":Spring,"WaterChange":WaterChange,"Levels":Levels,"End":EndFlag,"TrashBag":TrashBag}
ennemies = {"Robot":Robot,"Crate":Crate,"Balloon":Balloon,"Spring":Spring,"WaterChange":WaterChange,"Levels":Levels,"End":EndFlag,"TrashBag":TrashBag,"Ripple":Ripple}
self.queue = [] # For spawning ennemies after beeing initialized
if "layers" in json.keys() and type(json["layers"]).__name__=="list":
solidlayer = False
@ -141,7 +143,7 @@ class TilesetRenderer(BaseObject):
w = entity["width"]
if "height" in entity.keys():
h = entity["height"]
lists = {"Solid":self.rects,"SemiSolid":self.semirects}
lists = {"Solid":self.rects,"SemiSolid":self.semirects,"Spikes":self.spikes}
lists[entity["name"]].append(self.game.pygame.Rect(x,y,w,h))
except:
self.game.log("Erreur",name,entity,"Propriétés invalides")

View File

@ -0,0 +1,24 @@
from gamedata.objects.base import BaseObject
class Ripple(BaseObject):
def __init__(self,x,y,game,nodes,customvalues):
super().__init__(x,y,game)
self.sprites = self.game.getSpriteDir("ripple/")
self.sprite = self.sprites[0]
self.rect[2],self.rect[3] = self.sprite.get_size()
self.spriteindex = game.lib.randint(0,len(self.sprites)-1)
self.animspeed = 4
def step(self):
self.spriteindex+=self.animspeed*self.game.dt
self.sprite = self.sprites[int(self.spriteindex)%len(self.sprites)]
def draw(self):
self.game.window.blit(self.sprite,[self.rect[0]-self.game.globals["camerax"],self.rect[1]-self.game.globals["cameray"]])