Implement basic peg and ball
This commit is contained in:
parent
cacb7bbe84
commit
79b8c1059e
3 changed files with 43 additions and 1 deletions
14
prefabs/ball.tscn
Normal file
14
prefabs/ball.tscn
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
[gd_scene load_steps=3 format=3 uid="uid://ylvptuj0xnm8"]
|
||||||
|
|
||||||
|
[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_1mhds"]
|
||||||
|
bounce = 0.92
|
||||||
|
|
||||||
|
[sub_resource type="CircleShape2D" id="CircleShape2D_xd6lq"]
|
||||||
|
radius = 24.0
|
||||||
|
|
||||||
|
[node name="Ball" type="RigidBody2D"]
|
||||||
|
physics_material_override = SubResource("PhysicsMaterial_1mhds")
|
||||||
|
|
||||||
|
[node name="Shape" type="CollisionShape2D" parent="."]
|
||||||
|
shape = SubResource("CircleShape2D_xd6lq")
|
||||||
|
debug_color = Color(0.7, 0, 0, 0.419608)
|
10
prefabs/peg.tscn
Normal file
10
prefabs/peg.tscn
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
[gd_scene load_steps=2 format=3 uid="uid://bbtm3534mdeat"]
|
||||||
|
|
||||||
|
[sub_resource type="CircleShape2D" id="CircleShape2D_cj4kg"]
|
||||||
|
radius = 24.0
|
||||||
|
|
||||||
|
[node name="Peg" type="StaticBody2D"]
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
shape = SubResource("CircleShape2D_cj4kg")
|
||||||
|
debug_color = Color(0.7, 0.7, 0.7, 0.419608)
|
20
root.tscn
20
root.tscn
|
@ -1,3 +1,21 @@
|
||||||
[gd_scene format=3 uid="uid://d15wtjeqete7v"]
|
[gd_scene load_steps=3 format=3 uid="uid://d15wtjeqete7v"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" uid="uid://ylvptuj0xnm8" path="res://prefabs/ball.tscn" id="1_d2cjj"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bbtm3534mdeat" path="res://prefabs/peg.tscn" id="2_i427g"]
|
||||||
|
|
||||||
[node name="Root" type="Node2D"]
|
[node name="Root" type="Node2D"]
|
||||||
|
|
||||||
|
[node name="Ball" parent="." instance=ExtResource("1_d2cjj")]
|
||||||
|
position = Vector2(42, -281)
|
||||||
|
|
||||||
|
[node name="Peg" parent="." instance=ExtResource("2_i427g")]
|
||||||
|
position = Vector2(77, -102)
|
||||||
|
|
||||||
|
[node name="Peg2" parent="." instance=ExtResource("2_i427g")]
|
||||||
|
position = Vector2(-68, -70)
|
||||||
|
|
||||||
|
[node name="Peg3" parent="." instance=ExtResource("2_i427g")]
|
||||||
|
position = Vector2(45, 77)
|
||||||
|
|
||||||
|
[node name="Peg4" parent="." instance=ExtResource("2_i427g")]
|
||||||
|
position = Vector2(-114, 125)
|
||||||
|
|
Loading…
Reference in a new issue