-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLevelEditCell.gd
More file actions
84 lines (81 loc) · 1.76 KB
/
LevelEditCell.gd
File metadata and controls
84 lines (81 loc) · 1.76 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
extends TextureRect
var type : String = " "
func _input(event : InputEvent) -> void:
if event is InputEventKey:
if get_rect().encloses(Rect2(get_viewport().get_mouse_position(),Vector2(1, 1))):
if event.pressed:
match event.keycode:
KEY_R:
set_brick_type("R")
KEY_Y:
set_brick_type("Y")
KEY_G:
set_brick_type("G")
KEY_B:
set_brick_type("B")
KEY_M:
set_brick_type("M")
KEY_C:
set_brick_type("C")
KEY_O:
set_brick_type("O")
KEY_W:
set_brick_type("W")
KEY_1:
set_brick_type("s")
KEY_2:
set_brick_type("g")
KEY_3:
set_brick_type("i")
KEY_DELETE, KEY_BACKSPACE, KEY_SPACE:
set_brick_type(" ")
func set_brick_type(t : String) -> void:
match t:
"R":
texture = Global.Bricks["base"]
modulate = Color.RED
type = "R"
"Y":
texture = Global.Bricks["base"]
modulate = Color.YELLOW
type = "Y"
"G":
texture = Global.Bricks["base"]
modulate = Color.GREEN
type = "G"
"B":
texture = Global.Bricks["base"]
modulate = Color.ROYAL_BLUE
type = "B"
"M":
texture = Global.Bricks["base"]
modulate = Color.MAGENTA
type = "M"
"C":
texture = Global.Bricks["base"]
modulate = Color.CYAN
type = "C"
"O":
texture = Global.Bricks["base"]
modulate = Color.ORANGE
type = "O"
"W":
texture = Global.Bricks["base"]
modulate = Color.WHITE
type = "W"
"s":
texture = Global.Bricks["shiny"]
modulate = Color.SILVER
type = "s"
"g":
texture = Global.Bricks["shiny"]
modulate = Color.GOLD
type = "g"
"i":
texture = Global.Bricks["invul"]
modulate = Color.GRAY
type = "i"
" ":
texture = Global.Bricks["blank"]
modulate = Color.WHITE
type = " "