pong.tscn 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. [gd_scene load_steps=12 format=2]
  2. [ext_resource path="res://Logic/Paddle.cs" type="Script" id=1]
  3. [ext_resource path="res://paddle.png" type="Texture2D" id=2]
  4. [ext_resource path="res://Logic/Ball.cs" type="Script" id=4]
  5. [ext_resource path="res://ball.png" type="Texture2D" id=5]
  6. [ext_resource path="res://separator.png" type="Texture2D" id=6]
  7. [ext_resource path="res://Logic/Wall.cs" type="Script" id=7]
  8. [ext_resource path="res://Logic/CeilingFloor.cs" type="Script" id=8]
  9. [sub_resource type="RectangleShape2D" id=1]
  10. extents = Vector2(4, 16)
  11. [sub_resource type="RectangleShape2D" id=2]
  12. extents = Vector2(4, 4)
  13. [sub_resource type="RectangleShape2D" id=3]
  14. extents = Vector2(10, 200)
  15. [sub_resource type="RectangleShape2D" id=4]
  16. extents = Vector2(320, 10)
  17. [node name="Pong" type="Node2D"]
  18. [node name="Background" type="ColorRect" parent="."]
  19. offset_right = 640.0
  20. offset_bottom = 400.0
  21. color = Color(0.141176, 0.152941, 0.164706, 1)
  22. [node name="Left" type="Area2D" parent="."]
  23. modulate = Color(0, 1, 1, 1)
  24. position = Vector2(67.6285, 192.594)
  25. script = ExtResource( 1 )
  26. [node name="Sprite2D" type="Sprite2D" parent="Left"]
  27. texture = ExtResource( 2 )
  28. [node name="Collision" type="CollisionShape2D" parent="Left"]
  29. shape = SubResource( 1 )
  30. [node name="Right" type="Area2D" parent="."]
  31. modulate = Color(1, 0, 1, 1)
  32. position = Vector2(563.815, 188.919)
  33. script = ExtResource( 1 )
  34. [node name="Sprite2D" type="Sprite2D" parent="Right"]
  35. texture = ExtResource( 2 )
  36. [node name="Collision" type="CollisionShape2D" parent="Right"]
  37. shape = SubResource( 1 )
  38. [node name="Ball" type="Area2D" parent="."]
  39. position = Vector2(320.5, 191.124)
  40. script = ExtResource( 4 )
  41. [node name="Sprite2D" type="Sprite2D" parent="Ball"]
  42. texture = ExtResource( 5 )
  43. [node name="Collision" type="CollisionShape2D" parent="Ball"]
  44. shape = SubResource( 2 )
  45. [node name="Separator" type="Sprite2D" parent="."]
  46. position = Vector2(320, 200)
  47. texture = ExtResource( 6 )
  48. [node name="Node2D" type="Node2D" parent="."]
  49. [node name="LeftWall" type="Area2D" parent="."]
  50. position = Vector2(-10, 200)
  51. script = ExtResource( 7 )
  52. [node name="Collision" type="CollisionShape2D" parent="LeftWall"]
  53. shape = SubResource( 3 )
  54. [node name="RightWall" type="Area2D" parent="."]
  55. position = Vector2(650, 200)
  56. script = ExtResource( 7 )
  57. [node name="Collision" type="CollisionShape2D" parent="RightWall"]
  58. shape = SubResource( 3 )
  59. [node name="Ceiling" type="Area2D" parent="."]
  60. position = Vector2(320, -10)
  61. script = ExtResource( 8 )
  62. [node name="Collision" type="CollisionShape2D" parent="Ceiling"]
  63. shape = SubResource( 4 )
  64. [node name="Floor" type="Area2D" parent="."]
  65. position = Vector2(320, 410)
  66. script = ExtResource( 8 )
  67. _bounceDirection = -1
  68. [node name="Collision" type="CollisionShape2D" parent="Floor"]
  69. shape = SubResource( 4 )
  70. [connection signal="area_entered" from="Left" to="Left" method="OnAreaEntered"]
  71. [connection signal="area_entered" from="Right" to="Right" method="OnAreaEntered"]
  72. [connection signal="area_entered" from="LeftWall" to="LeftWall" method="OnWallAreaEntered"]
  73. [connection signal="area_entered" from="RightWall" to="RightWall" method="OnWallAreaEntered"]
  74. [connection signal="area_entered" from="Ceiling" to="Ceiling" method="OnAreaEntered"]
  75. [connection signal="area_entered" from="Floor" to="Floor" method="OnAreaEntered"]