basic texture

This commit is contained in:
2024-03-15 15:55:19 +01:00
parent 249bd45f04
commit 5f87e4f54f
13 changed files with 126 additions and 15 deletions
+9 -3
View File
@@ -1,7 +1,8 @@
[gd_scene load_steps=6 format=3 uid="uid://catrpx1vuhvou"]
[gd_scene load_steps=7 format=3 uid="uid://catrpx1vuhvou"]
[ext_resource type="Script" path="res://scenes/playground/Playground.gd" id="1_86x6h"]
[ext_resource type="PackedScene" uid="uid://ce4mnfokb6pkn" path="res://scenes/playground/racket/Racket.tscn" id="1_ywul3"]
[ext_resource type="Texture2D" uid="uid://cf7xqjtabmist" path="res://assets/playground.png" id="2_5bwsm"]
[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_v2vae"]
friction = 0.0
@@ -24,6 +25,11 @@ physics_material_override = SubResource("PhysicsMaterial_v2vae")
polygon = PackedVector2Array(0, 8, 0, 600, 1200, 600, 1200, 8, 0, 0, 0, 8, 1192, 16, 1192, 16, 1192, 592, 8, 592, 8, 16)
one_way_collision_margin = 0.0
[node name="TextureRect" type="TextureRect" parent="Wall"]
offset_right = 40.0
offset_bottom = 40.0
texture = ExtResource("2_5bwsm")
[node name="GoalAreaLeft" type="Area2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="GoalAreaLeft"]
@@ -59,9 +65,9 @@ metadata/UP_KEY = "right_up"
metadata/DOWN_KEY = "right_down"
[node name="Score" type="Label" parent="."]
offset_left = 544.0
offset_left = 534.0
offset_top = 32.0
offset_right = 673.0
offset_right = 663.0
offset_bottom = 120.0
text = "0 - 0"
label_settings = SubResource("LabelSettings_ildlg")
+10 -8
View File
@@ -1,12 +1,13 @@
[gd_scene load_steps=4 format=3 uid="uid://dmsd30hc2ob1w"]
[gd_scene load_steps=5 format=3 uid="uid://dmsd30hc2ob1w"]
[ext_resource type="Script" path="res://scenes/playground/ball/Ball.gd" id="1_vsr7q"]
[ext_resource type="Texture2D" uid="uid://8gw5knpb4bx6" path="res://assets/ball.png" id="2_efxb4"]
[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_h7mi1"]
friction = 0.0
[sub_resource type="RectangleShape2D" id="RectangleShape2D_bdxrg"]
size = Vector2(32, 32)
[sub_resource type="CircleShape2D" id="CircleShape2D_8ps5q"]
radius = 20.0
[node name="Ball" type="RigidBody2D"]
mass = 0.01
@@ -20,12 +21,13 @@ contact_monitor = true
linear_damp_mode = 1
script = ExtResource("1_vsr7q")
[node name="ColorRect" type="ColorRect" parent="."]
offset_right = 40.0
offset_bottom = 40.0
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(20, 20)
shape = SubResource("RectangleShape2D_bdxrg")
shape = SubResource("CircleShape2D_8ps5q")
[node name="TextureRect" type="TextureRect" parent="."]
offset_right = 40.0
offset_bottom = 40.0
texture = ExtResource("2_efxb4")
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
+1 -1
View File
@@ -1,7 +1,7 @@
extends RigidBody2D
const SPEED = 500.0
const SPEED = 800.0
func _physics_process(delta):
if Input.is_action_pressed(get_meta("UP_KEY")):
+4 -3
View File
@@ -1,6 +1,7 @@
[gd_scene load_steps=4 format=3 uid="uid://ce4mnfokb6pkn"]
[gd_scene load_steps=5 format=3 uid="uid://ce4mnfokb6pkn"]
[ext_resource type="Script" path="res://scenes/playground/racket/Racket.gd" id="1_gclos"]
[ext_resource type="Texture2D" uid="uid://cc71lbhjc1wl5" path="res://assets/racket.png" id="2_7620b"]
[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_lq6ot"]
friction = 0.0
@@ -19,7 +20,7 @@ script = ExtResource("1_gclos")
position = Vector2(20, 72)
shape = SubResource("RectangleShape2D_ehve4")
[node name="ColorRect" type="ColorRect" parent="."]
[node name="TextureRect" type="TextureRect" parent="."]
offset_right = 40.0
offset_bottom = 144.0
color = Color(0.0117647, 0.0117647, 0.0117647, 1)
texture = ExtResource("2_7620b")