Browse Source

Fix issues with heroes coming from inheritance

Hero 0: Remove cursor, allow wallriding (enable collision detection)

Hero 2: Move RepelHUD to center, ignore self with Area (gravity)
master
Luna 7 years ago
parent
commit
a277b43638
3 changed files with 13 additions and 6 deletions
  1. +7
    -1
      scenes/heroes/0.tscn
  2. +4
    -3
      scenes/heroes/2.tscn
  3. +2
    -2
      scripts/heroes/2.gd

+ 7
- 1
scenes/heroes/0.tscn View File

@ -3,8 +3,14 @@
[ext_resource path="res://scenes/player.tscn" type="PackedScene" id=1]
[ext_resource path="res://scripts/heroes/0.gd" type="Script" id=2]
[node name="RigidBody" index="0" instance=ExtResource( 1 )]
[node name="RigidBody" instance=ExtResource( 1 )]
contacts_reported = 1
contact_monitor = true
script = ExtResource( 2 )
[node name="Ray" parent="Yaw/Pitch" index="1"]
_sections_unfolded = [ "Pause", "Transform", "Visibility" ]

+ 4
- 3
scenes/heroes/2.tscn View File

@ -7,8 +7,9 @@
radius = 7.0
[node name="RigidBody" instance=ExtResource( 1 )]
[node name="RigidBody" index="0" instance=ExtResource( 1 )]
collision_layer = 4
script = ExtResource( 2 )
[node name="Crosshair" parent="MasterOnly" index="0"]
@ -22,9 +23,9 @@ anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -20.0
margin_top = -34.0
margin_top = -7.0
margin_right = 20.0
margin_bottom = -20.0
margin_bottom = 7.0
rect_pivot_offset = Vector2( 0, 0 )
mouse_filter = 2
mouse_default_cursor_shape = 0


+ 2
- 2
scripts/heroes/2.gd View File

@ -9,9 +9,9 @@ func _process(delta):
rpc("switch_gravity")
is_repelling = !is_repelling
if is_repelling:
get_node("RepellingHUD").set_text("/\\")
get_node("MasterOnly/RepellingHUD").set_text("/\\")
else:
get_node("RepellingHUD").set_text("\\/")
get_node("MasterOnly/RepellingHUD").set_text("\\/")
sync func switch_gravity():
var area = get_node("Area")


Loading…
Cancel
Save