From e0a389ff5964c34022fb90d9c3fb29053567ec65 Mon Sep 17 00:00:00 2001 From: jacopograndi Date: Tue, 8 Feb 2022 14:14:42 +0100 Subject: enemy colors --- assets/json/enemies.json | 248 +++++++++++++++++++++++++++++++++++++++------ assets/json/enemies_gen.py | 16 +++ 2 files changed, 233 insertions(+), 31 deletions(-) (limited to 'assets') diff --git a/assets/json/enemies.json b/assets/json/enemies.json index 056d215..7a74885 100644 --- a/assets/json/enemies.json +++ b/assets/json/enemies.json @@ -7,7 +7,13 @@ "name": "T", "model_name": "T.glb", "thumbnail_name": "T.png", - "resource": "T" + "resource": "T", + "color": [ + 1.0, + 1.0, + 1.0, + 1.0 + ] }, { "lives": 10, @@ -18,7 +24,13 @@ "spawn_on_death": "T", "model_name": "kT.glb", "thumbnail_name": "kT.png", - "resource": "k" + "resource": "k", + "color": [ + 0.6, + 0.85, + 0.5, + 1.0 + ] }, { "lives": 10, @@ -29,7 +41,13 @@ "spawn_on_death": "kT", "model_name": "dkT.glb", "thumbnail_name": "dkT.png", - "resource": "d" + "resource": "d", + "color": [ + 0.39999999999999997, + 0.7000000000000001, + 0.6666666666666666, + 1.0 + ] }, { "lives": 10, @@ -40,7 +58,13 @@ "spawn_on_death": "T", "model_name": "aT.glb", "thumbnail_name": "aT.png", - "resource": "a" + "resource": "a", + "color": [ + 1.0, + 0.5, + 0.5, + 1.0 + ] }, { "lives": 10, @@ -51,7 +75,13 @@ "spawn_on_death": "aT", "model_name": "kaT.glb", "thumbnail_name": "kaT.png", - "resource": "k" + "resource": "k", + "color": [ + 0.7333333333333334, + 0.5666666666666667, + 0.3333333333333333, + 1.0 + ] }, { "lives": 10, @@ -62,7 +92,13 @@ "spawn_on_death": "kaT", "model_name": "dkaT.glb", "thumbnail_name": "dkaT.png", - "resource": "d" + "resource": "d", + "color": [ + 0.55, + 0.525, + 0.5, + 1.0 + ] }, { "lives": 10, @@ -73,7 +109,13 @@ "spawn_on_death": "aT", "model_name": "aaT.glb", "thumbnail_name": "aaT.png", - "resource": "a" + "resource": "a", + "color": [ + 1.0, + 0.3333333333333333, + 0.3333333333333333, + 1.0 + ] }, { "lives": 10, @@ -84,7 +126,13 @@ "spawn_on_death": "aaT", "model_name": "daaT.glb", "thumbnail_name": "daaT.png", - "resource": "d" + "resource": "d", + "color": [ + 0.75, + 0.35, + 0.5, + 1.0 + ] }, { "lives": 10, @@ -95,7 +143,13 @@ "spawn_on_death": "daaT", "model_name": "kdaaT.glb", "thumbnail_name": "kdaaT.png", - "resource": "k" + "resource": "k", + "color": [ + 0.64, + 0.42000000000000004, + 0.4, + 1.0 + ] }, { "lives": 10, @@ -106,7 +160,13 @@ "spawn_on_death": "kdaaT", "model_name": "dkdaaT.glb", "thumbnail_name": "dkdaaT.png", - "resource": "d" + "resource": "d", + "color": [ + 0.5333333333333333, + 0.4166666666666667, + 0.5, + 1.0 + ] }, { "lives": 10, @@ -117,7 +177,13 @@ "spawn_on_death": "aaT", "model_name": "aaaT.glb", "thumbnail_name": "aaaT.png", - "resource": "a" + "resource": "a", + "color": [ + 1.0, + 0.25, + 0.25, + 1.0 + ] }, { "lives": 10, @@ -128,7 +194,13 @@ "spawn_on_death": "aaaT", "model_name": "daaaT.glb", "thumbnail_name": "daaaT.png", - "resource": "d" + "resource": "d", + "color": [ + 0.8, + 0.27999999999999997, + 0.4, + 1.0 + ] }, { "lives": 10, @@ -139,7 +211,13 @@ "spawn_on_death": "aT", "model_name": "daT.glb", "thumbnail_name": "daT.png", - "resource": "d" + "resource": "d", + "color": [ + 0.6666666666666666, + 0.4666666666666666, + 0.6666666666666666, + 1.0 + ] }, { "lives": 10, @@ -150,7 +228,13 @@ "spawn_on_death": "daT", "model_name": "kdaT.glb", "thumbnail_name": "kdaT.png", - "resource": "k" + "resource": "k", + "color": [ + 0.55, + 0.525, + 0.5, + 1.0 + ] }, { "lives": 10, @@ -161,7 +245,13 @@ "spawn_on_death": "kdaT", "model_name": "dkdaT.glb", "thumbnail_name": "dkdaT.png", - "resource": "d" + "resource": "d", + "color": [ + 0.44000000000000006, + 0.5, + 0.6, + 1.0 + ] }, { "lives": 30, @@ -172,7 +262,13 @@ "spawn_on_death": "aT", "model_name": "saT.glb", "thumbnail_name": "saT.png", - "resource": "s" + "resource": "s", + "color": [ + 1.0, + 0.6666666666666666, + 0.3333333333333333, + 1.0 + ] }, { "lives": 30, @@ -183,7 +279,13 @@ "spawn_on_death": "saT", "model_name": "dsaT.glb", "thumbnail_name": "dsaT.png", - "resource": "d" + "resource": "d", + "color": [ + 0.75, + 0.6, + 0.5, + 1.0 + ] }, { "lives": 30, @@ -194,7 +296,13 @@ "spawn_on_death": "T", "model_name": "sT.glb", "thumbnail_name": "sT.png", - "resource": "s" + "resource": "s", + "color": [ + 1.0, + 1.0, + 0.5, + 1.0 + ] }, { "lives": 30, @@ -205,7 +313,13 @@ "spawn_on_death": "sT", "model_name": "ksT.glb", "thumbnail_name": "ksT.png", - "resource": "k" + "resource": "k", + "color": [ + 0.7333333333333334, + 0.9, + 0.3333333333333333, + 1.0 + ] }, { "lives": 30, @@ -216,7 +330,13 @@ "spawn_on_death": "ksT", "model_name": "dksT.glb", "thumbnail_name": "dksT.png", - "resource": "d" + "resource": "d", + "color": [ + 0.55, + 0.775, + 0.5, + 1.0 + ] }, { "lives": 30, @@ -227,7 +347,13 @@ "spawn_on_death": "sT", "model_name": "asT.glb", "thumbnail_name": "asT.png", - "resource": "a" + "resource": "a", + "color": [ + 1.0, + 0.6666666666666666, + 0.3333333333333333, + 1.0 + ] }, { "lives": 30, @@ -238,7 +364,13 @@ "spawn_on_death": "asT", "model_name": "dasT.glb", "thumbnail_name": "dasT.png", - "resource": "d" + "resource": "d", + "color": [ + 0.75, + 0.6, + 0.5, + 1.0 + ] }, { "lives": 30, @@ -249,7 +381,13 @@ "spawn_on_death": "dasT", "model_name": "kdasT.glb", "thumbnail_name": "kdasT.png", - "resource": "k" + "resource": "k", + "color": [ + 0.64, + 0.62, + 0.4, + 1.0 + ] }, { "lives": 30, @@ -260,7 +398,13 @@ "spawn_on_death": "kdasT", "model_name": "dkdasT.glb", "thumbnail_name": "dkdasT.png", - "resource": "d" + "resource": "d", + "color": [ + 0.5333333333333333, + 0.5833333333333334, + 0.5, + 1.0 + ] }, { "lives": 30, @@ -271,7 +415,13 @@ "spawn_on_death": "asT", "model_name": "aasT.glb", "thumbnail_name": "aasT.png", - "resource": "a" + "resource": "a", + "color": [ + 1.0, + 0.5, + 0.25, + 1.0 + ] }, { "lives": 30, @@ -282,7 +432,13 @@ "spawn_on_death": "aasT", "model_name": "daasT.glb", "thumbnail_name": "daasT.png", - "resource": "d" + "resource": "d", + "color": [ + 0.8, + 0.48, + 0.4, + 1.0 + ] }, { "lives": 30, @@ -293,7 +449,13 @@ "spawn_on_death": "sT", "model_name": "dsT.glb", "thumbnail_name": "dsT.png", - "resource": "d" + "resource": "d", + "color": [ + 0.6666666666666666, + 0.7999999999999999, + 0.6666666666666666, + 1.0 + ] }, { "lives": 30, @@ -304,7 +466,13 @@ "spawn_on_death": "dsT", "model_name": "kdsT.glb", "thumbnail_name": "kdsT.png", - "resource": "k" + "resource": "k", + "color": [ + 0.55, + 0.775, + 0.5, + 1.0 + ] }, { "lives": 30, @@ -315,7 +483,13 @@ "spawn_on_death": "kdsT", "model_name": "dkdsT.glb", "thumbnail_name": "dkdsT.png", - "resource": "d" + "resource": "d", + "color": [ + 0.44000000000000006, + 0.7, + 0.6, + 1.0 + ] }, { "lives": 90, @@ -326,7 +500,13 @@ "spawn_on_death": "sT", "model_name": "ssT.glb", "thumbnail_name": "ssT.png", - "resource": "s" + "resource": "s", + "color": [ + 1.0, + 1.0, + 0.3333333333333333, + 1.0 + ] }, { "lives": 90, @@ -337,6 +517,12 @@ "spawn_on_death": "ssT", "model_name": "dssT.glb", "thumbnail_name": "dssT.png", - "resource": "d" + "resource": "d", + "color": [ + 0.75, + 0.85, + 0.5, + 1.0 + ] } ] diff --git a/assets/json/enemies_gen.py b/assets/json/enemies_gen.py index 695b264..8e1ba88 100644 --- a/assets/json/enemies_gen.py +++ b/assets/json/enemies_gen.py @@ -54,6 +54,14 @@ bonus = { "s": { "speed": 0.8, "lives": 3 }, } +colors = { + "T": [1, 1, 1, 1], + "k": [0.2, 0.7, 0, 1], + "a": [1, 0, 0, 1], + "d": [0, 0.4, 1, 1], + "s": [1, 1, 0, 1], +} + def get_stats (node): stats = base.copy() bonuses = { k:1 for k in stats } @@ -66,6 +74,13 @@ def get_stats (node): stats[s] *= bonuses[s] return stats +def get_color (node): + color = [0,0,0,0] + for r in node: + for i in range(len(color)): color[i] += colors[r][i] + for i in range(len(color)): color[i] /= len(node) + return color + def get_enemy (node): enemy = get_stats(node) enemy['name'] = node @@ -75,6 +90,7 @@ def get_enemy (node): enemy["model_name"] = node + '.glb' enemy["thumbnail_name"] = node + '.png' enemy["resource"] = node[0] + enemy["color"] = get_color(node) return enemy -- cgit v1.2.3-54-g00ecf