mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-17 19:33:47 +00:00
Turrets
This commit is contained in:
parent
1d24be6156
commit
d60878c94b
10 changed files with 180 additions and 4 deletions
|
|
@ -31,7 +31,6 @@ collision_layer = 16
|
|||
collision_mask = 2
|
||||
script = ExtResource("3_ax0x5")
|
||||
SweepSpeed = 10.0
|
||||
Debug = true
|
||||
SpritePath = NodePath("../AnimatedSprite2D")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="PlayerDetection"]
|
||||
|
|
|
|||
95
Scenes/Actors/Turret.tscn
Normal file
95
Scenes/Actors/Turret.tscn
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
[gd_scene load_steps=14 format=3 uid="uid://b3485f35xal4g"]
|
||||
|
||||
[ext_resource type="Script" path="res://Scripts/Actors/Turret.cs" id="1_8kaj0"]
|
||||
[ext_resource type="Texture2D" uid="uid://coai700bkqote" path="res://Sprites/Actors/Turret.png" id="2_epkv0"]
|
||||
[ext_resource type="Script" path="res://Scripts/Components/CameraPlayerDetection.cs" id="3_qgpoq"]
|
||||
[ext_resource type="PackedScene" uid="uid://bhl8u2plfk4yh" path="res://Scenes/Weapons/enemy_weapon_spread.tscn" id="4_dbwkh"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_5n5rh"]
|
||||
atlas = ExtResource("2_epkv0")
|
||||
region = Rect2(64, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_01kjk"]
|
||||
atlas = ExtResource("2_epkv0")
|
||||
region = Rect2(48, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_w7jtw"]
|
||||
atlas = ExtResource("2_epkv0")
|
||||
region = Rect2(32, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_er617"]
|
||||
atlas = ExtResource("2_epkv0")
|
||||
region = Rect2(16, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_sdq4o"]
|
||||
atlas = ExtResource("2_epkv0")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_57tcf"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_5n5rh")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_01kjk")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_w7jtw")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_er617")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_sdq4o")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"default",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_nkpag"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_gs7jc"]
|
||||
radius = 85.0529
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_3bqsq"]
|
||||
size = Vector2(8, 12)
|
||||
|
||||
[node name="Turret" type="CharacterBody2D" node_paths=PackedStringArray("EquippedWeapon", "_playerDetection")]
|
||||
collision_layer = 16
|
||||
collision_mask = 75
|
||||
script = ExtResource("1_8kaj0")
|
||||
WalkSpeed = 0.0
|
||||
PlayerDisengageRange = 200.0
|
||||
EquippedWeapon = NodePath("EnemyWeapon")
|
||||
_playerDetection = NodePath("PlayerDetection")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
sprite_frames = SubResource("SpriteFrames_57tcf")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("CircleShape2D_nkpag")
|
||||
|
||||
[node name="PlayerDetection" type="Area2D" parent="."]
|
||||
collision_layer = 16
|
||||
collision_mask = 2
|
||||
script = ExtResource("3_qgpoq")
|
||||
SweepSpeed = 10.0
|
||||
SpritePath = NodePath("../AnimatedSprite2D")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="PlayerDetection"]
|
||||
shape = SubResource("CircleShape2D_gs7jc")
|
||||
|
||||
[node name="DamageHitbox" type="Area2D" parent="."]
|
||||
collision_layer = 16
|
||||
collision_mask = 9
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="DamageHitbox"]
|
||||
shape = SubResource("RectangleShape2D_3bqsq")
|
||||
|
||||
[node name="EnemyWeapon" parent="." instance=ExtResource("4_dbwkh")]
|
||||
|
||||
[connection signal="area_entered" from="PlayerDetection" to="PlayerDetection" method="_on_area_entered"]
|
||||
[connection signal="area_exited" from="PlayerDetection" to="PlayerDetection" method="_on_area_exited"]
|
||||
[connection signal="area_entered" from="DamageHitbox" to="." method="_on_damage_hitbox_area_entered"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue