fix the rope physics

This commit is contained in:
mightypanders 2021-06-13 18:55:01 +02:00
parent a8f6e482c6
commit 70a989fa89
4 changed files with 9 additions and 8 deletions

View File

@ -56,7 +56,8 @@ func _physics_process(delta):
collision.disabled = true
mode = RigidBody2D.MODE_STATIC
var rot_dir = get_angle_to(follow_pos)
rotation += (rot_dir)
rotation += (rot_dir + deg2rad(90))*0.2
var distance = follow_pos.distance_to(global_position)
global_position = follow_pos
pass

View File

@ -4,17 +4,17 @@
[ext_resource path="res://Guest.gd" type="Script" id=2]
[ext_resource path="res://assets/Sam.png" type="Texture" id=3]
[sub_resource type="PhysicsMaterial" id=7]
[sub_resource type="PhysicsMaterial" id=1]
absorbent = true
[sub_resource type="CircleShape2D" id=5]
[sub_resource type="CircleShape2D" id=2]
radius = 124.702
[sub_resource type="CapsuleShape2D" id=3]
radius = 6.0
height = 9.75
[sub_resource type="CapsuleShape2D" id=6]
[sub_resource type="CapsuleShape2D" id=4]
radius = 8.02541
height = 10.5115
@ -24,7 +24,7 @@ height = 10.5115
collision_layer = 3
collision_mask = 3
mass = 10.0
physics_material_override = SubResource( 7 )
physics_material_override = SubResource( 1 )
gravity_scale = 0.0
angular_damp = 100.0
script = ExtResource( 2 )
@ -37,7 +37,7 @@ __meta__ = {
[node name="CollisionShape2D" type="CollisionShape2D" parent="ExclusionZone"]
modulate = Color( 0.0823529, 1, 0.027451, 1 )
show_behind_parent = true
shape = SubResource( 5 )
shape = SubResource( 2 )
disabled = true
[node name="SpriteMarkus" type="Sprite" parent="."]
@ -59,7 +59,7 @@ modulate = Color( 1, 0, 0.984314, 1 )
scale = Vector2( 2.76, 2.6 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="PickUpArea"]
shape = SubResource( 6 )
shape = SubResource( 4 )
[node name="Anchor" type="Position2D" parent="."]

View File

@ -22,3 +22,4 @@ position = Vector2( 0, 9.83977 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 1 )
disabled = true

View File

@ -18,7 +18,6 @@ config/icon="res://icon.png"
window/size/width=1280
window/size/height=720
window/size/fullscreen=true
window/stretch/mode="2d"
[physics]