mirror of
https://github.com/Yadciel1/2048-Shooter.git
synced 2024-11-12 17:11:18 +01:00
56 lines
1.3 KiB
Plaintext
56 lines
1.3 KiB
Plaintext
[gd_scene load_steps=4 format=2]
|
|
|
|
[ext_resource path="res://box.png" type="Texture" id=1]
|
|
|
|
[sub_resource type="GDScript" id=3]
|
|
resource_name = "Bullet"
|
|
script/source = "extends KinematicBody2D
|
|
|
|
|
|
var velocity = Vector2(0,-1)
|
|
var speed = 300
|
|
|
|
# Declare member variables here. Examples:
|
|
# var a = 2
|
|
# var b = \"text\"
|
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready():
|
|
pass # Replace with function body.
|
|
|
|
func _physics_process(delta):
|
|
|
|
move_and_collide(velocity.normalized() * delta * speed)
|
|
pass
|
|
|
|
|
|
func _on_Area2D_area_entered(area):
|
|
if !area.is_in_group(\"Border\"):
|
|
queue_free()
|
|
pass # Replace with function body.
|
|
"
|
|
|
|
[sub_resource type="RectangleShape2D" id=2]
|
|
extents = Vector2( 3.33333, 3.33333 )
|
|
|
|
[node name="Node2D" type="KinematicBody2D"]
|
|
scale = Vector2( 1.5, 1.5 )
|
|
script = SubResource( 3 )
|
|
|
|
[node name="Sprite" type="Sprite" parent="."]
|
|
texture = ExtResource( 1 )
|
|
|
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
|
position = Vector2( 3.73522e-06, -3.41733e-06 )
|
|
scale = Vector2( 1.1, 1.1 )
|
|
shape = SubResource( 2 )
|
|
|
|
[node name="Area2D" type="Area2D" parent="." groups=["Bullet"]]
|
|
|
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
|
position = Vector2( 5.96046e-08, -5.96046e-08 )
|
|
shape = SubResource( 2 )
|
|
|
|
[connection signal="area_entered" from="Area2D" to="." method="_on_Area2D_area_entered"]
|