summaryrefslogtreecommitdiff
path: root/cat.gd
blob: f84273a37743eb2d14214be95dcb8547f429dfbf (plain) (blame)
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
class_name Cat extends MeshInstance

var images: Dictionary = {}
var frame_i = 0
var lastt =0

func _process(delta):
	lastt += delta

	if lastt >= 0.05:
		lastt = 0
		frame_i += 1

		if frame_i >= 55:
			frame_i = 0

	var material = get_active_material(0)

	material.albedo_texture = images[frame_i]

# Called when the node enters the scene tree for the first time.
func _ready():
	for i in range(55):
		images[i] = load("res://cat/c" + str(i) + ".png")