Compare commits
3 Commits
484a621b72
...
7bb10926a2
Author | SHA1 | Date |
---|---|---|
theo@manjaro | 7bb10926a2 | |
theo@manjaro | 6543de826a | |
theo@manjaro | 9504a8213c |
Binary file not shown.
After Width: | Height: | Size: 618 B |
|
@ -1583,7 +1583,7 @@
|
||||||
{"x": 512, "y": 96},
|
{"x": 512, "y": 96},
|
||||||
{"x": 640, "y": 144}
|
{"x": 640, "y": 144}
|
||||||
],
|
],
|
||||||
"values": {"0": "Beginning;18", "1": "The Docks;18", "2": "Tiny Island;25", "3": "Archipelago;32", "4": "Shipping Bridges;25", "5": "Cityscape;25"}
|
"values": {"0": "Beginning;18", "1": "The Docks;18", "2": "Tiny Island;22", "3": "Archipelago;28", "4": "Shipping Bridges;23", "5": "Cityscape;25"}
|
||||||
},
|
},
|
||||||
{"name": "Ripple", "id": 1, "_eid": "76589705", "x": 368, "y": 192, "originX": 0, "originY": 0},
|
{"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": 2, "_eid": "76589705", "x": 224, "y": 176, "originX": 0, "originY": 0},
|
||||||
|
|
|
@ -17,6 +17,10 @@ class Player(Movable):
|
||||||
self.spritefalling = game.sprite_lib["player/falling.png"] # Descending
|
self.spritefalling = game.sprite_lib["player/falling.png"] # Descending
|
||||||
self.spritehurt = game.sprite_lib["player/hurt.png"] # Being hurted
|
self.spritehurt = game.sprite_lib["player/hurt.png"] # Being hurted
|
||||||
self.spritelanding = game.sprite_lib["player/landing.png"]
|
self.spritelanding = game.sprite_lib["player/landing.png"]
|
||||||
|
|
||||||
|
self.ouch = game.getchars("Ouch !")
|
||||||
|
self.bubble = game.getSpriteDir("particles/bubble/")
|
||||||
|
self.bubbletimer = game.lib.Timer(0.3)
|
||||||
self.landingtimer = 0
|
self.landingtimer = 0
|
||||||
self.maxlandtime = 0.15
|
self.maxlandtime = 0.15
|
||||||
self.spriteindex = 0
|
self.spriteindex = 0
|
||||||
|
@ -212,6 +216,13 @@ class Player(Movable):
|
||||||
self.jumpsfx.play()
|
self.jumpsfx.play()
|
||||||
self.jumped = True
|
self.jumped = True
|
||||||
super().step() # Actually move
|
super().step() # Actually move
|
||||||
|
# Spawning bubbles
|
||||||
|
if self.water:
|
||||||
|
if self.rect.center[1]>self.water.rect.y and self.bubbletimer.tick((abs(self.horspd)+abs(self.verspd))/30):
|
||||||
|
offx = self.game.lib.randint(-8,8)
|
||||||
|
offy = self.game.lib.randint(-8,8)
|
||||||
|
self.game.addParticle(self.bubble,self.rect.center[0]+offx,self.rect.center[1]+offy,fps=2,depth=3,vely=-0.1)
|
||||||
|
|
||||||
if self.rect.center[1]>self.game.globals["cameray"]+self.game.globals["camerah"]:
|
if self.rect.center[1]>self.game.globals["cameray"]+self.game.globals["camerah"]:
|
||||||
self.die()
|
self.die()
|
||||||
for i in self.spikes:
|
for i in self.spikes:
|
||||||
|
@ -298,6 +309,8 @@ class Player(Movable):
|
||||||
self.hp-=dmg
|
self.hp-=dmg
|
||||||
if self.hp<=0:
|
if self.hp<=0:
|
||||||
self.die()
|
self.die()
|
||||||
|
else:
|
||||||
|
self.game.addParticle([self.ouch],self.rect.center[0],self.rect.center[1],fps=1,vely=-2,modvely=0.1) # "Ouch !" being displayed
|
||||||
|
|
||||||
def die(self):
|
def die(self):
|
||||||
if not self.dead:
|
if not self.dead:
|
||||||
|
|
Loading…
Reference in New Issue