mirror of
https://github.com/CactiChameleon9/PONG-Godot.git
synced 2024-10-18 10:07:58 +01:00
101 lines
2.8 KiB
Plaintext
101 lines
2.8 KiB
Plaintext
[gd_scene load_steps=10 format=2]
|
|
|
|
[ext_resource path="res://Paddle.tscn" type="PackedScene" id=1]
|
|
[ext_resource path="res://Ball.tscn" type="PackedScene" id=2]
|
|
[ext_resource path="res://ExpressionPro.ttf" type="DynamicFontData" id=3]
|
|
[ext_resource path="res://Score.gd" type="Script" id=4]
|
|
[ext_resource path="res://Main.gd" type="Script" id=5]
|
|
|
|
[sub_resource type="DynamicFont" id=2]
|
|
size = 480
|
|
font_data = ExtResource( 3 )
|
|
|
|
[sub_resource type="DynamicFont" id=3]
|
|
size = 200
|
|
font_data = ExtResource( 3 )
|
|
|
|
[sub_resource type="RectangleShape2D" id=1]
|
|
extents = Vector2( 700, 10 )
|
|
|
|
[sub_resource type="RectangleShape2D" id=4]
|
|
extents = Vector2( 10, 540 )
|
|
|
|
[node name="Main" type="Node2D"]
|
|
script = ExtResource( 5 )
|
|
|
|
[node name="UI" type="CanvasLayer" parent="."]
|
|
layer = -1
|
|
|
|
[node name="Score" type="Label" parent="UI"]
|
|
anchor_top = 1.0
|
|
anchor_right = 1.0
|
|
anchor_bottom = 1.0
|
|
margin_top = -420.0
|
|
custom_colors/font_color = Color( 0.356863, 0.356863, 0.356863, 1 )
|
|
custom_fonts/font = SubResource( 2 )
|
|
text = "2 2"
|
|
align = 1
|
|
script = ExtResource( 4 )
|
|
|
|
[node name="Title" type="Label" parent="UI"]
|
|
anchor_right = 1.0
|
|
margin_bottom = 176.0
|
|
custom_colors/font_color = Color( 0.356863, 0.356863, 0.356863, 1 )
|
|
custom_fonts/font = SubResource( 3 )
|
|
text = "PONG!"
|
|
align = 1
|
|
|
|
[node name="PlayerPaddle" parent="." instance=ExtResource( 1 )]
|
|
position = Vector2( 60, 142 )
|
|
scale = Vector2( -15, 100 )
|
|
is_player = true
|
|
acceleration = 25.0
|
|
friction = 15.0
|
|
speed = 1000.0
|
|
|
|
[node name="OppPaddle" parent="." instance=ExtResource( 1 )]
|
|
position = Vector2( 1220, 213 )
|
|
speed = 1000.0
|
|
|
|
[node name="Ball" parent="." instance=ExtResource( 2 )]
|
|
unique_name_in_owner = true
|
|
position = Vector2( 619, 311 )
|
|
|
|
[node name="Walls" type="Node" parent="."]
|
|
|
|
[node name="Wall1" type="StaticBody2D" parent="Walls"]
|
|
position = Vector2( 640, 0 )
|
|
collision_layer = 2
|
|
collision_mask = 0
|
|
|
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Walls/Wall1"]
|
|
shape = SubResource( 1 )
|
|
|
|
[node name="Wall2" type="StaticBody2D" parent="Walls"]
|
|
position = Vector2( 640, 720 )
|
|
collision_layer = 2
|
|
collision_mask = 0
|
|
|
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Walls/Wall2"]
|
|
shape = SubResource( 1 )
|
|
|
|
[node name="PlayerGoal" type="Area2D" parent="."]
|
|
position = Vector2( -30, 360 )
|
|
collision_layer = 0
|
|
collision_mask = 4
|
|
|
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="PlayerGoal"]
|
|
shape = SubResource( 4 )
|
|
|
|
[node name="OppGoal" type="Area2D" parent="."]
|
|
position = Vector2( 1310, 360 )
|
|
collision_layer = 0
|
|
collision_mask = 4
|
|
|
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="OppGoal"]
|
|
shape = SubResource( 4 )
|
|
|
|
[connection signal="goal_scored" from="UI/Score" to="." method="reset_ball"]
|
|
[connection signal="body_entered" from="PlayerGoal" to="UI/Score" method="increase_opp_score"]
|
|
[connection signal="body_entered" from="OppGoal" to="UI/Score" method="increase_player_score"]
|