ClientDummy.tscn 906 B

12345678910111213141516171819202122232425262728293031323334
  1. [gd_scene load_steps=5 format=2]
  2. [ext_resource path="res://powerMenu.tscn" type="PackedScene" id=1]
  3. [ext_resource path="res://client.gd" type="Script" id=2]
  4. [ext_resource path="res://PowerMenu.gd" type="Script" id=3]
  5. [sub_resource type="GDScript" id=6]
  6. script/source = "extends Node
  7. var enabled = false
  8. func _physics_process(delta):
  9. if enabled:
  10. var input = ''
  11. if Input.is_action_pressed(\"s\"):
  12. input =(\"ui_down\")
  13. if Input.is_action_pressed(\"w\"):
  14. input =(\"ui_up\")
  15. if Input.is_action_pressed(\"a\"):
  16. input =(\"ui_left\")
  17. if Input.is_action_pressed(\"d\"):
  18. input =(\"ui_right\")
  19. get_parent().send_input(input)
  20. "
  21. [node name="ClientDummy" type="Node" groups=["client"]]
  22. script = ExtResource( 2 )
  23. [node name="Input" type="Node" parent="."]
  24. script = SubResource( 6 )
  25. [node name="PowerMenu" type="CanvasLayer" parent="." instance=ExtResource( 1 )]
  26. script = ExtResource( 3 )