Added color variations

This commit is contained in:
theo@manjaro 2021-09-18 18:03:04 +02:00
parent 32467d017d
commit 53b81bb48c
21 changed files with 15 additions and 7 deletions

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 825 B

After

Width:  |  Height:  |  Size: 825 B

View File

Before

Width:  |  Height:  |  Size: 831 B

After

Width:  |  Height:  |  Size: 831 B

View File

Before

Width:  |  Height:  |  Size: 813 B

After

Width:  |  Height:  |  Size: 813 B

View File

Before

Width:  |  Height:  |  Size: 859 B

After

Width:  |  Height:  |  Size: 859 B

View File

Before

Width:  |  Height:  |  Size: 844 B

After

Width:  |  Height:  |  Size: 844 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -3,7 +3,7 @@ import random
class FallingPinmik(BaseObject):
def __init__(self,game):
def __init__(self,game,skins=["base","green"]):
x = random.randint(0,game.DISPLAY_WIDTH)
y = -30
@ -12,7 +12,7 @@ class FallingPinmik(BaseObject):
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.speed = 100*(0.30-self.cameraratio)/0.30

View File

@ -2,7 +2,7 @@ from gamedata.objects.base import BaseObject
import random,math
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)
self.direction = random.randint(0,360)
self.holdrect = self.rect.copy()
@ -13,6 +13,8 @@ class Lemming(BaseObject):
self.normalspeed = self.basespeed # Speed "objective"
self.speed = 0 # Current speed, leaning towards objective speed
self.skin = skin
self.selected = False # If beeing redirected
self.anglemargin = 25
@ -27,7 +29,7 @@ class Lemming(BaseObject):
self.orientations = ["Right","Left","Left","Right"]
self.sprites = {}
for i in self.orientations:
self.sprites[i] = game.getSpriteDir("lemmings/"+i+"/")
self.sprites[i] = game.getSpriteDir("lemmings/"+skin+"/"+i+"/")
self.spriteindex = 0
self.animspeed = 0.2

View File

@ -4,18 +4,24 @@ from gamedata.objects.ingame.lemmings import Lemming
import random
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)
super().__init__(spawnpoint[0],spawnpoint[1],game)
self.sprite = game.sprite_lib["lemmings/shadow.png"].copy()
self.speedmargin = speedmargin
self.fallsprite = game.sprite_lib["lemmings/falling.png"]
self.distance = game.DISPLAY_HEIGHT
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):
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)
self.game.gameloop.summon(lemming)
self.game.gameloop.delid(self.id)