-
Notifications
You must be signed in to change notification settings - Fork 3
/
Sprite.gd
40 lines (30 loc) · 808 Bytes
/
Sprite.gd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
tool
extends Sprite
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
var done = false;
const ELEMENTALS = ["FIRE","WATER","POISON","ICE","HUMAN"]
func _ready():
if not done:
done = true
var thing = {}
for element in ELEMENTALS:
thing[element] = []
var dir = Directory.new()
var path = "res://assets/planetpallets/" + element
dir.open(path)
dir.list_dir_begin()
while true:
var file = dir.get_next()
if file == "":
break
if file.ends_with("png"):
thing[element].append(path+"/"+file)
var f = File.new()
f.open("res://assets/planet_stuff/pallete_map.json", File.WRITE)
f.store_string(to_json(thing))
f.close()
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass