extends Node2D var map=[[0,1,2,3],[4,5,6,7],[8,9,10,11],[11,12,13,14]] var spriteload = preload("res://levels/Sprite.tscn") var blanklist=[] # Called when the node enters the scene tree for the first time. func _ready(): for n in range(16): blanklist.append(spriteload.instance()) blanklist[n].set_frame(n)#何番目のフレームを入れるか番号を表示 add_child(blanklist[n]) for y in range(4): print(map[y].find(n)) if map[y].find(n) != -1:#スプライトのリストの中からnがみつかったら blanklist[n].set_position(Vector2(map[y].find(n)*100, y*100))