Skip to content

blocks: add viewport, simple_character, and characterbody2d_move tooltips #209

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion addons/block_code/blocks/graphics/viewport_center.tres
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[resource]
script = ExtResource("1_rc1so")
name = &"viewport_center"
description = ""
description = "Coordinates of the middle of the viewable screen when playing."
category = "Graphics | Viewport"
type = 3
variant_type = 5
Expand Down
2 changes: 1 addition & 1 deletion addons/block_code/blocks/graphics/viewport_height.tres
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[resource]
script = ExtResource("1_1debb")
name = &"viewport_height"
description = ""
description = "How tall the viewable screen is when playing."
category = "Graphics | Viewport"
type = 3
variant_type = 3
Expand Down
2 changes: 1 addition & 1 deletion addons/block_code/blocks/graphics/viewport_width.tres
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[resource]
script = ExtResource("1_ll4rh")
name = &"viewport_width"
description = ""
description = "How wide the viewable screen is when playing."
category = "Graphics | Viewport"
type = 3
variant_type = 3
Expand Down
2 changes: 1 addition & 1 deletion addons/block_code/blocks/input/characterbody2d_move.tres
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
script = ExtResource("1_btxic")
name = &"characterbody2d_move"
target_node_class = "CharacterBody2D"
description = ""
description = "Move the character up, down, left, and right with the keyboard using the given keys. The speed of movement can be adjusted separately for x (left and right) and y (up and down)."
category = "Input"
type = 2
variant_type = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,13 @@ static func setup_custom_blocks():
block_definition.category = "Input"
block_definition.type = Types.BlockType.STATEMENT
block_definition.display_template = "Move with {player: OPTION} buttons as {kind: OPTION}"
block_definition.description = """Move the character using the “Player 1” or “Player 2” controls as configured in Godot.

“Top-down” enables the character to move in both x (vertical) and y (horizontal) dimensions, as if the camera is above the character, looking down. No gravity is added.

“Platformer” enables the character to move as if the camera is looking from the side, like a side-scroller. Gravity is applied on the x (vertical) axis, making the character fall down until they collide.

“Spaceship” uses the left/right controls to turn the character and up/down controls to go forward or backward."""
# TODO: delta here is assumed to be the parameter name of
# the _process or _physics_process method:
block_definition.code_template = 'move_with_player_buttons("{player}", "{kind}", delta)'
Expand Down