8000 Merge pull request #199 from endlessm/T35591-more-block-definitions · endlessm/godot-block-coding@aa80f0c · GitHub
[go: up one dir, main page]

Skip to content

Commit aa80f0c

Browse files
authored
Merge pull request #199 from endlessm/T35591-more-block-definitions
T35591 more block definitions
2 parents 2dfcf0d + 9dec121 commit aa80f0c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1250
-1104
lines changed

addons/block_code/blocks/communication/add_to_group.tres

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
[resource]
66
script = ExtResource("1_bcm71")
77
name = &"add_to_group"
8+
target_node_class = ""
9+
description = "Add this node into the group"
10+
category = "Communication | Groups"
811
type = 2
912
variant_type = 0
1013
display_template = "Add to group {group: STRING}"
1114
code_template = "add_to_group({group})"
12-
description = "Add this node into the group"
13-
category = "Communication | Groups"
1415
defaults = {}
1516
signal_name = ""
17+
scope = ""
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://de4k7t7uqws1j"]
2+
3+
[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_xotf5"]
4+
5+
[resource]
6+
script = ExtResource("1_xotf5")
7+
name = &"area2d_on_entered"
8+
target_node_class = "Area2D"
9+
description = ""
10+
category = "Communication | Methods"
11+
type = 1
12+
variant_type = 0
13+
display_template = "On [body: OBJECT] entered"
14+
code_template = "func _on_body_entered(body: Node2D):
15+
"
16+
defaults = {}
17+
signal_name = "body_entered"
18+
scope = ""
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://b36nq4mau6lu6"]
2+
3+
[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_21qth"]
4+
5+
[resource]
6+
script = ExtResource("1_21qth")
7+
name = &"area2d_on_exited"
8+
target_node_class = "Area2D"
9+
description = ""
10+
category = "Communication | Methods"
11+
type = 1
12+
variant_type = 0
13+
display_template = "On [body: OBJECT] exited"
14+
code_template = "func _on_body_exited(body: Node2D):
15+
"
16+
defaults = {}
17+
signal_name = "body_entered"
18+
scope = ""
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://dl1xd1jit2mlp"]
2+
3+
[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_v2421"]
4+
5+
[resource]
6+
script = ExtResource("1_v2421")
7+
name = &"rigidbody2d_on_entered"
8+
target_node_class = "RigidBody2D"
9+
description = ""
10+
category = "Communication | Methods"
11+
type = 1
12+
variant_type = 0
13+
display_template = "On [body: OBJECT] entered"
14+
code_template = "func _on_body_entered(body: Node2D):
15+
"
16+
defaults = {}
17+
signal_name = "body_entered"
18+
scope = ""
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://c15ymi1kxb570"]
2+
3+
[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_sahiu"]
4+
5+
[resource]
6+
script = ExtResource("1_sahiu")
7+
name = &"rigidbody2d_on_exited"
8+
target_node_class = "RigidBody2D"
9+
description = ""
10+
category = "Communication | Methods"
11+
type = 1
12+
variant_type = 0
13+
display_template = "On [body: OBJECT] exited"
14+
code_template = "func _on_body_exited(body: Node2D):
15+
"
16+
defaults = {}
17+
signal_name = "body_exited"
18+
scope = ""
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://mg4y3o0rsqd5"]
2+
3+
[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_xr50b"]
4+
5+
[resource]
6+
script = ExtResource("1_xr50b")
7+
name = &"animationplayer_is_playing"
8+
target_node_class = "AnimationPlayer"
9+
description = "Check if an animation is currently playing."
10+
category = "Graphics | Animation"
11+
type = 3
12+
variant_type = 1
13+
display_template = "Is playing"
14+
code_template = "is_playing()"
15+
defaults = {}
16+
signal_name = ""
17+
scope = ""
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://clopo7gmje5a"]
2+
3+
[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_2enqv"]
4+
5+
[resource]
6+
script = ExtResource("1_2enqv")
7+
name = &"animationplayer_pause"
8+
target_node_class = "AnimationPlayer"
9+
description = "Pause the currently playing animation."
10+
category = "Graphics | Animation"
11+
type = 2
12+
variant_type = 0
13+
display_template = "Pause"
14+
code_template = "pause()"
15+
defaults = {}
16+
signal_name = ""
17+
scope = ""
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[gd_resource type="Resource" load_steps=4 format=3 uid="uid://c5e1byehtxwc0"]
2+
3+
[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_emeuv"]
4+
[ext_resource type="Script" path="res://addons/block_code/ui/block_canvas/option_data.gd" id="1_xu43h"]
5+
6+
[sub_resource type="Resource" id="Resource_vnp2w"]
7+
script = ExtResource("1_xu43h")
8+
selected = 0
9+
items = ["ahead", "backwards"]
10+
11+
[resource]
12+
script = ExtResource("1_emeuv")
13+
name = &"animationplayer_play"
14+
target_node_class = "AnimationPlayer"
15+
description = "Play the animation."
16+
category = "Graphics | Animation"
17+
type = 2
18+
variant_type = 0
19+
display_template = "Play {animation: STRING} {direction: OPTION}"
20+
code_template = "if \"{direction}\" == \"ahead\":
21+
play({animation})
22+
else:
23+
play_backwards({animation})
24+
"
25+
defaults = {
26+
"direction": SubResource("Resource_vnp2w")
27+
}
28+
signal_name = ""
29+
scope = ""
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://b4v00oxoxbfet"]
2+
3+
[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_wp8gr"]
4+
5+
[resource]
6+
script = ExtResource("1_wp8gr")
7+
name = &"animationplayer_stop"
8+
target_node_class = "AnimationPlayer"
9+
description = "Stop the currently playing animation."
10+
category = "Graphics | Animation"
11+
type = 2
12+
variant_type = 0
13+
display_template = "Stop"
14+
code_template = "stop()"
15+
defaults = {}
16+
signal_name = ""
17+
scope = ""
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://cu3ru61vg6bx5"]
2+
3+
[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_btxic"]
4+
5+
[resource]
6+
script = ExtResource("1_btxic")
7+
name = &"characterbody2d_move"
8+
target_node_class = "CharacterBody2D"
9+
description = ""
10+
category = "Input"
11+
type = 2
12+
variant_type = 0
13+
display_template = "Move with keys {up: STRING} {down: STRING} {left: STRING} {right: STRING} with speed {speed: VECTOR2}"
14+
code_template = "var dir = Vector2()
15+
dir.x += float(Input.is_key_pressed(OS.find_keycode_from_string({right})))
16+
dir.x -= float(Input.is_key_pressed(OS.find_keycode_from_string({left})))
17+
dir.y += float(Input.is_key_pressed(OS.find_keycode_from_string({down})))
18+
dir.y -= float(Input.is_key_pressed(OS.find_keycode_from_string({up})))
19+
dir = dir.normalized()
20+
velocity = dir*{speed}
21+
move_and_slide()
22+
"
23+
defaults = {
24+
"down": "S",
25+
"left": "A",
26+
"right": "D",
27+
"speed": Vector2(100, 100),
28+
"up": "W"
29+
}
30+
signal_name = ""
31+
scope = ""

0 commit comments

Comments
 (0)
0