Browse Source

Merge pull request #348 from texaco/master

Fix seesaw falling plank from 2d demo
Bojidar Marinov 5 years ago
parent
commit
c34a2b423b
1 changed files with 12 additions and 3 deletions
  1. 12 3
      2d/physics_platformer/background/Seesaw.tscn

+ 12 - 3
2d/physics_platformer/background/Seesaw.tscn

@@ -1,4 +1,4 @@
-[gd_scene load_steps=4 format=2]
+[gd_scene load_steps=5 format=2]
 
 [ext_resource path="res://background/plank.png" type="Texture" id=1]
 [ext_resource path="res://background/plankpin.png" type="Texture" id=2]
@@ -6,6 +6,9 @@
 [sub_resource type="RectangleShape2D" id=1]
 extents = Vector2( 128, 8 )
 
+[sub_resource type="RectangleShape2D" id=2]
+extents = Vector2( 16, 27 )
+
 [node name="Seesaw" type="Node2D"]
 
 [node name="Plank" type="RigidBody2D" parent="."]
@@ -18,9 +21,15 @@ texture = ExtResource( 1 )
 shape = SubResource( 1 )
 
 [node name="Pin" type="PinJoint2D" parent="."]
-node_a = NodePath("../plank")
+node_a = NodePath("../Plank")
+node_b = NodePath("../Pillar")
+
+[node name="Pillar" type="StaticBody2D" parent="."]
 
-[node name="Sprite" type="Sprite" parent="."]
+[node name="Sprite" type="Sprite" parent="Pillar"]
 position = Vector2( -0.290825, 20.2425 )
 texture = ExtResource( 2 )
 
+[node name="CollisionShape2D" type="CollisionShape2D" parent="Pillar"]
+position = Vector2( 0, 25 )
+shape = SubResource( 2 )