Upload files to "/"
This commit is contained in:
parent
9f7495fa83
commit
252bd52e56
18
White_Pawn.tscn
Normal file
18
White_Pawn.tscn
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
[gd_scene load_steps=4 format=3 uid="uid://bdrva148huqjm"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://White_pawn.gd" id="1_cao44"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://i3yvfhq53pk8" path="res://Asset/Pion_alb.jpeg" id="2_5gkww"]
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_0433c"]
|
||||||
|
|
||||||
|
[node name="WhitePawn" type="Area2D"]
|
||||||
|
script = ExtResource("1_cao44")
|
||||||
|
metadata/_edit_group_ = true
|
||||||
|
|
||||||
|
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||||
|
texture = ExtResource("2_5gkww")
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
position = Vector2(15, 0)
|
||||||
|
scale = Vector2(1.75, 5.4)
|
||||||
|
shape = SubResource("RectangleShape2D_0433c")
|
15
White_pawn.gd
Normal file
15
White_pawn.gd
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
extends Area2D
|
||||||
|
|
||||||
|
# Proprietăți pion
|
||||||
|
var type = "pawn"
|
||||||
|
var color = "white"
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
# Folosim Callable pentru a conecta semnalul
|
||||||
|
connect("input_event", Callable(self, "_on_pion_input_event"))
|
||||||
|
|
||||||
|
func _on_pion_input_event(viewport, event, shape_idx):
|
||||||
|
if event is InputEventMouseButton and event.pressed:
|
||||||
|
if event.button_index == MOUSE_BUTTON_LEFT:
|
||||||
|
print("Pionul alb a fost click-uit.")
|
||||||
|
get_parent()._on_piece_input_event(viewport, event, shape_idx, self)
|
17
tile_area.tscn
Normal file
17
tile_area.tscn
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
[gd_scene load_steps=3 format=3 uid="uid://f68oedbkr2yv"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://tile_area.gd" id="1_rfkfj"]
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_vas3a"]
|
||||||
|
size = Vector2(9.2, 20)
|
||||||
|
|
||||||
|
[node name="tile_area" type="Area2D"]
|
||||||
|
script = ExtResource("1_rfkfj")
|
||||||
|
metadata/_edit_group_ = true
|
||||||
|
|
||||||
|
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
position = Vector2(-27, 0)
|
||||||
|
scale = Vector2(5, 5)
|
||||||
|
shape = SubResource("RectangleShape2D_vas3a")
|
Loading…
Reference in New Issue
Block a user