Water animations on map

This commit is contained in:
theo@manjaro 2021-11-24 16:04:34 +01:00
parent 31a1cf70fd
commit c6a32a6b65
16 changed files with 35 additions and 2 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

View File

@ -1584,7 +1584,15 @@
{"x": 640, "y": 144}
],
"values": {"0": "Beginning;20", "1": "The Docks;40"}
}
},
{"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

@ -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):
@ -77,7 +78,7 @@ class TilesetRenderer(BaseObject):
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

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"]])