1
0
mirror of https://github.com/JohnBreaux/Boat-Battle.git synced 2024-11-15 05:25:57 +00:00

Add handles to ships and improve placement controls; Make the debug menu more aggressive.

This commit is contained in:
John 2021-10-21 03:18:31 -05:00
parent 0fd0fa63f0
commit f74ad64865
17 changed files with 40 additions and 14 deletions

View File

@ -1,3 +1,3 @@
source_md5="9e91c010f678dd0d23b8d9efb811370a" source_md5="5a201530a2c7e3bb42181c09984b89f5"
dest_md5="8e4332e351eefabd8f0349cd49fe52ff" dest_md5="39b189f098cbee69227d4913fcf35a6e"

View File

@ -1,3 +1,3 @@
source_md5="263ca33dd302d621fee895e7ac383887" source_md5="bd884562b68793860604020d5a651d91"
dest_md5="339c525433359be4bef49afd8a886aba" dest_md5="c961eaade5ba9a652feb566a65040afb"

View File

@ -1,3 +1,3 @@
source_md5="24ed4b24e9603882a33d8f18ee46d922" source_md5="086625ddff37c472c9d5d5e1c4d5ab3c"
dest_md5="9e8d32510b6010bd437605aa787cc6b0" dest_md5="f02370861aec23baa35bf0a1f97f385d"

View File

@ -1,3 +1,3 @@
source_md5="d6943caf0946316838b9cd9c8fbdb2f1" source_md5="77989e8476ff29d4ab3a32a70c772b3c"
dest_md5="f3bfd7942ca02a45a0a53af26f79a60c" dest_md5="cd23260b170f58022c0d09f60a98af66"

View File

@ -1,3 +1,3 @@
source_md5="040b2cdbb0654ad245f989217247bd7f" source_md5="7273b593f374b6fd54f7c33ee56d7ef0"
dest_md5="a8f0e7cd43f7c196985ae222f836bef4" dest_md5="27a3f76531230e0b36bab4843641d961"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -11,6 +11,8 @@ var debug_active = false
var menu_position = 0.0 var menu_position = 0.0
var menu_velocity = 4 var menu_velocity = 4
onready var present_working_node = get_node("/root")
# positions when the menu is hidden/active # positions when the menu is hidden/active
var menu_hidden = Transform2D(Vector2(1,0), Vector2(0,1), Vector2(0,-170)) var menu_hidden = Transform2D(Vector2(1,0), Vector2(0,1), Vector2(0,-170))
var menu_active = Transform2D(Vector2(1,0), Vector2(0,1), Vector2(0, 0)) var menu_active = Transform2D(Vector2(1,0), Vector2(0,1), Vector2(0, 0))
@ -71,6 +73,10 @@ func _on_LineEdit_text_entered(line):
command_clear(command) command_clear(command)
"help", "h": "help", "h":
command_help(command) command_help(command)
"pwd", "pwn":
command_pwd(command)
"cd", "cn":
command_cd(command)
_: _:
debug_print_line("Command not recognized.\n") debug_print_line("Command not recognized.\n")
@ -100,8 +106,11 @@ func command_stop (command):
# list: Lists names of active scenes (children of Root) # list: Lists names of active scenes (children of Root)
func command_list (_command): func command_list (_command):
debug_print_line("list: ") var children = present_working_node.get_children()
MessageBus.emit_signal("list_scenes") var names = []
for i in range (children.size()):
names.append(children[i].name)
debug_print_line(String(names) + "\n")
# restart: Kills the current tree and replants Root # restart: Kills the current tree and replants Root
func command_restart (_command): func command_restart (_command):
@ -128,7 +137,24 @@ func command_emit (command):
func command_clear (_command): func command_clear (_command):
emit_signal("clear_out"); emit_signal("clear_out");
func command_tree (_command): func command_pwd (_command):
debug_print_line("pwd\n" + String(present_working_node.get_path()) + "\n")
func command_cd (command):
if command.size() > 1:
var path
if command[1].is_abs_path():
path = command[1]
else: #convert to absolute path
path = String(present_working_node.get_path()) + "/" + command[1]
var node = get_node(path)
if node:
debug_print_line("cd " + command[1] + "\n")
present_working_node = node
else:
debug_print_line ('change node: node not found.\n')
else:
debug_print_line("")
pass pass
# help: Prints help dialogue # help: Prints help dialogue

View File

@ -11,7 +11,7 @@ var held = false
func _ready(): func _ready():
pass # Replace with function body. pass # Replace with function body.
var click_radius = 32 var click_radius = 16
var orient = 0; var orient = 0;
func _input(event): func _input(event):