pong.tscn 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. [gd_scene load_steps=13 format=2]
  2. [ext_resource path="res://scripts/paddle.vs" 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.vs" 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.vs" type="Script" id=7]
  9. [ext_resource path="res://scripts/ceiling_floor.vs" 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. __meta__ = {
  24. "_edit_use_anchors_": false
  25. }
  26. [node name="Left" type="Area2D" parent="."]
  27. position = Vector2( 67.6285, 192.594 )
  28. script = ExtResource( 1 )
  29. [node name="Sprite" type="Sprite" parent="Left"]
  30. texture = ExtResource( 2 )
  31. [node name="Collision" type="CollisionShape2D" parent="Left"]
  32. shape = SubResource( 1 )
  33. [node name="Right" type="Area2D" parent="."]
  34. position = Vector2( 563.815, 188.919 )
  35. script = ExtResource( 1 )
  36. ball_dir = -1.0
  37. [node name="Sprite" type="Sprite" parent="Right"]
  38. texture = ExtResource( 3 )
  39. [node name="Collision" type="CollisionShape2D" parent="Right"]
  40. shape = SubResource( 1 )
  41. [node name="Ball" type="Area2D" parent="."]
  42. position = Vector2( 320.5, 191.124 )
  43. script = ExtResource( 4 )
  44. [node name="Sprite" type="Sprite" parent="Ball"]
  45. texture = ExtResource( 5 )
  46. [node name="Collision" type="CollisionShape2D" parent="Ball"]
  47. shape = SubResource( 2 )
  48. [node name="Separator" type="Sprite" parent="."]
  49. position = Vector2( 320, 200 )
  50. texture = ExtResource( 6 )
  51. [node name="LeftWall" type="Area2D" parent="."]
  52. position = Vector2( -10, 200 )
  53. script = ExtResource( 7 )
  54. [node name="Collision" type="CollisionShape2D" parent="LeftWall"]
  55. shape = SubResource( 3 )
  56. [node name="RightWall" type="Area2D" parent="."]
  57. position = Vector2( 650, 200 )
  58. script = ExtResource( 7 )
  59. [node name="Collision" type="CollisionShape2D" parent="RightWall"]
  60. shape = SubResource( 3 )
  61. [node name="Ceiling" type="Area2D" parent="."]
  62. position = Vector2( 320, -10 )
  63. script = ExtResource( 8 )
  64. [node name="Collision" type="CollisionShape2D" parent="Ceiling"]
  65. shape = SubResource( 4 )
  66. [node name="Floor" type="Area2D" parent="."]
  67. position = Vector2( 320, 410 )
  68. script = ExtResource( 8 )
  69. bounce_direction = -1.0
  70. [node name="Collision" type="CollisionShape2D" parent="Floor"]
  71. shape = SubResource( 4 )
  72. [node name="Camera2D" type="Camera2D" parent="."]
  73. offset = Vector2( 320, 200 )
  74. current = true
  75. [connection signal="area_entered" from="Left" to="Left" method="_on_area_entered"]
  76. [connection signal="area_entered" from="Right" to="Right" method="_on_area_entered"]
  77. [connection signal="area_entered" from="LeftWall" to="LeftWall" method="_on_area_entered"]
  78. [connection signal="area_entered" from="RightWall" to="RightWall" method="_on_area_entered"]
  79. [connection signal="area_entered" from="Ceiling" to="Ceiling" method="_on_area_entered"]
  80. [connection signal="area_entered" from="Floor" to="Floor" method="_on_area_entered"]