Added color variations
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 825 B After Width: | Height: | Size: 825 B |
Before Width: | Height: | Size: 831 B After Width: | Height: | Size: 831 B |
Before Width: | Height: | Size: 813 B After Width: | Height: | Size: 813 B |
Before Width: | Height: | Size: 859 B After Width: | Height: | Size: 859 B |
Before Width: | Height: | Size: 844 B After Width: | Height: | Size: 844 B |
BIN
gamedata/assets/lemmings/green/Left/0.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
gamedata/assets/lemmings/green/Left/1.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
gamedata/assets/lemmings/green/Left/2.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
gamedata/assets/lemmings/green/Left/3.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
gamedata/assets/lemmings/green/Right/0.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
gamedata/assets/lemmings/green/Right/1.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
gamedata/assets/lemmings/green/Right/2.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
gamedata/assets/lemmings/green/Right/3.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
gamedata/assets/lemmings/green/falling.png
Normal file
After Width: | Height: | Size: 11 KiB |
@ -3,7 +3,7 @@ import random
|
|||||||
|
|
||||||
class FallingPinmik(BaseObject):
|
class FallingPinmik(BaseObject):
|
||||||
|
|
||||||
def __init__(self,game):
|
def __init__(self,game,skins=["base","green"]):
|
||||||
|
|
||||||
x = random.randint(0,game.DISPLAY_WIDTH)
|
x = random.randint(0,game.DISPLAY_WIDTH)
|
||||||
y = -30
|
y = -30
|
||||||
@ -12,7 +12,7 @@ class FallingPinmik(BaseObject):
|
|||||||
|
|
||||||
self.cameraratio = random.random()*0.1+0.05
|
self.cameraratio = random.random()*0.1+0.05
|
||||||
|
|
||||||
self.sprite = game.sprite_lib["lemmings/falling.png"]
|
self.sprite = game.sprite_lib["lemmings/"+random.choice(skins)+"/falling.png"]
|
||||||
|
|
||||||
self.offset = 0
|
self.offset = 0
|
||||||
self.speed = 100*(0.30-self.cameraratio)/0.30
|
self.speed = 100*(0.30-self.cameraratio)/0.30
|
||||||
|
@ -2,7 +2,7 @@ from gamedata.objects.base import BaseObject
|
|||||||
import random,math
|
import random,math
|
||||||
|
|
||||||
class Lemming(BaseObject):
|
class Lemming(BaseObject):
|
||||||
def __init__(self,x,y,game,speedmargin=5):
|
def __init__(self,x,y,game,speedmargin=5,skin="base"):
|
||||||
super().__init__(x,y,game,w=70,h=70)
|
super().__init__(x,y,game,w=70,h=70)
|
||||||
self.direction = random.randint(0,360)
|
self.direction = random.randint(0,360)
|
||||||
self.holdrect = self.rect.copy()
|
self.holdrect = self.rect.copy()
|
||||||
@ -13,6 +13,8 @@ class Lemming(BaseObject):
|
|||||||
self.normalspeed = self.basespeed # Speed "objective"
|
self.normalspeed = self.basespeed # Speed "objective"
|
||||||
self.speed = 0 # Current speed, leaning towards objective speed
|
self.speed = 0 # Current speed, leaning towards objective speed
|
||||||
|
|
||||||
|
self.skin = skin
|
||||||
|
|
||||||
self.selected = False # If beeing redirected
|
self.selected = False # If beeing redirected
|
||||||
|
|
||||||
self.anglemargin = 25
|
self.anglemargin = 25
|
||||||
@ -27,7 +29,7 @@ class Lemming(BaseObject):
|
|||||||
self.orientations = ["Right","Left","Left","Right"]
|
self.orientations = ["Right","Left","Left","Right"]
|
||||||
self.sprites = {}
|
self.sprites = {}
|
||||||
for i in self.orientations:
|
for i in self.orientations:
|
||||||
self.sprites[i] = game.getSpriteDir("lemmings/"+i+"/")
|
self.sprites[i] = game.getSpriteDir("lemmings/"+skin+"/"+i+"/")
|
||||||
self.spriteindex = 0
|
self.spriteindex = 0
|
||||||
self.animspeed = 0.2
|
self.animspeed = 0.2
|
||||||
|
|
||||||
|
@ -4,18 +4,24 @@ from gamedata.objects.ingame.lemmings import Lemming
|
|||||||
import random
|
import random
|
||||||
|
|
||||||
class Spawner(BaseObject):
|
class Spawner(BaseObject):
|
||||||
def __init__(self,game,tiles,speedmargin=5):
|
def __init__(self,game,tiles,speedmargin=5,skins={"normal":["base","green"],"specials":[]}):
|
||||||
spawnpoint = random.choice(tiles.spawns)
|
spawnpoint = random.choice(tiles.spawns)
|
||||||
super().__init__(spawnpoint[0],spawnpoint[1],game)
|
super().__init__(spawnpoint[0],spawnpoint[1],game)
|
||||||
self.sprite = game.sprite_lib["lemmings/shadow.png"].copy()
|
self.sprite = game.sprite_lib["lemmings/shadow.png"].copy()
|
||||||
self.speedmargin = speedmargin
|
self.speedmargin = speedmargin
|
||||||
self.fallsprite = game.sprite_lib["lemmings/falling.png"]
|
|
||||||
self.distance = game.DISPLAY_HEIGHT
|
self.distance = game.DISPLAY_HEIGHT
|
||||||
self.timer = game.lib.Timer(2.5+random.random()) # Seconds of telegraph before spawning the lemming
|
self.timer = game.lib.Timer(2.5+random.random()) # Seconds of telegraph before spawning the lemming
|
||||||
|
|
||||||
|
# Skin choosing
|
||||||
|
self.skin = random.choice(skins["normal"])
|
||||||
|
if random.randint(1,10)==1: # 1/10 chance to have a special
|
||||||
|
if len(skins["specials"])>0:
|
||||||
|
self.skin = random.choice(skins["specials"])
|
||||||
|
self.fallsprite = game.sprite_lib["lemmings/"+self.skin+"/falling.png"]
|
||||||
|
|
||||||
def step(self):
|
def step(self):
|
||||||
if self.timer.tick(self.game.dt):
|
if self.timer.tick(self.game.dt):
|
||||||
lemming = Lemming(self.rect[0],self.rect[1],self.game,speedmargin=self.speedmargin)
|
lemming = Lemming(self.rect[0],self.rect[1],self.game,speedmargin=self.speedmargin,skin=self.skin)
|
||||||
lemming.move(-lemming.rect[2]/2,-lemming.rect[3]/2)
|
lemming.move(-lemming.rect[2]/2,-lemming.rect[3]/2)
|
||||||
self.game.gameloop.summon(lemming)
|
self.game.gameloop.summon(lemming)
|
||||||
self.game.gameloop.delid(self.id)
|
self.game.gameloop.delid(self.id)
|
||||||
|