pong.tscn 3.2 KB

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