Compare commits
3 Commits
31a1cf70fd
...
572002db32
Author | SHA1 | Date | |
---|---|---|---|
572002db32 | |||
4517c6d877 | |||
c6a32a6b65 |
BIN
gamedata/assets/ripple/0.png
Normal file
After Width: | Height: | Size: 675 B |
BIN
gamedata/assets/ripple/1.png
Normal file
After Width: | Height: | Size: 674 B |
BIN
gamedata/assets/ripple/10.png
Normal file
After Width: | Height: | Size: 581 B |
BIN
gamedata/assets/ripple/11.
Normal file
After Width: | Height: | Size: 581 B |
BIN
gamedata/assets/ripple/12.
Normal file
After Width: | Height: | Size: 581 B |
BIN
gamedata/assets/ripple/2.png
Normal file
After Width: | Height: | Size: 690 B |
BIN
gamedata/assets/ripple/3.png
Normal file
After Width: | Height: | Size: 581 B |
BIN
gamedata/assets/ripple/4.png
Normal file
After Width: | Height: | Size: 581 B |
BIN
gamedata/assets/ripple/5.png
Normal file
After Width: | Height: | Size: 581 B |
BIN
gamedata/assets/ripple/6.png
Normal file
After Width: | Height: | Size: 581 B |
BIN
gamedata/assets/ripple/7.png
Normal file
After Width: | Height: | Size: 581 B |
BIN
gamedata/assets/ripple/8.png
Normal file
After Width: | Height: | Size: 581 B |
BIN
gamedata/assets/ripple/9.png
Normal file
After Width: | Height: | Size: 581 B |
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 7.6 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 17 KiB |
BIN
gamedata/maps/Level 1/background4.png
Normal file
After Width: | Height: | Size: 9.1 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 33 KiB |
@ -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}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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")
|
||||
|
24
gamedata/objects/ripple.py
Normal 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"]])
|