Gun and rose

This commit is contained in:
2024-02-16 20:35:30 +08:00
parent 23143ba9bf
commit 7cc86d8546
20 changed files with 370 additions and 42 deletions

View File

@ -0,0 +1,19 @@
[gd_scene load_steps=3 format=3 uid="uid://cppmks4ln28yd"]
[ext_resource type="Texture2D" uid="uid://p3urintydjlo" path="res://assets/attacker.svg" id="1_56wxx"]
[ext_resource type="Script" path="res://scripts/attacker.gd" id="1_d7hg4"]
[node name="Attacker" type="CharacterBody2D"]
collision_layer = 2
collision_mask = 7
script = ExtResource("1_d7hg4")
[node name="AttackerSprite" type="Sprite2D" parent="."]
position = Vector2(5.96046e-08, -12)
scale = Vector2(0.1, 0.1)
texture = ExtResource("1_56wxx")
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
position = Vector2(3.55271e-15, -12)
scale = Vector2(0.2, 0.2)
polygon = PackedVector2Array(2.08165e-12, -222, -256, 222, 256, 222)

View File

@ -0,0 +1,27 @@
[gd_scene load_steps=4 format=3 uid="uid://h4fxpxqc6bpt"]
[ext_resource type="Script" path="res://scripts/bullet.gd" id="1_7ic61"]
[ext_resource type="Texture2D" uid="uid://voltvmrkr73s" path="res://assets/bullet.svg" id="1_tytsj"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_r7dy5"]
size = Vector2(8, 24)
[node name="Bullet" type="CharacterBody2D"]
collision_layer = 4
collision_mask = 2
script = ExtResource("1_7ic61")
[node name="BulletSprite" type="Sprite2D" parent="."]
position = Vector2(2.08165e-12, 2.08165e-12)
rotation = 1.5708
scale = Vector2(0.25, 0.25)
texture = ExtResource("1_tytsj")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
rotation = 1.5708
shape = SubResource("RectangleShape2D_r7dy5")
[node name="DisposeTimer" type="Timer" parent="."]
autostart = true
[connection signal="timeout" from="DisposeTimer" to="." method="_on_timed_out"]

View File

@ -1,17 +1,25 @@
[gd_scene load_steps=4 format=3 uid="uid://cwkcf8h5rspoh"]
[gd_scene load_steps=5 format=3 uid="uid://cwkcf8h5rspoh"]
[ext_resource type="Script" path="res://scripts/PlayerMovement.gd" id="1_e1gjl"]
[ext_resource type="Script" path="res://scripts/player.gd" id="1_sa7t7"]
[ext_resource type="Texture2D" uid="uid://b4daomndc1ag" path="res://assets/player.svg" id="2_3pad2"]
[ext_resource type="PackedScene" uid="uid://h4fxpxqc6bpt" path="res://scenes/objects/bullet.tscn" id="2_v83ov"]
[sub_resource type="CircleShape2D" id="CircleShape2D_k56cq"]
radius = 52.0096
[node name="Player" type="CharacterBody2D" node_paths=PackedStringArray("dash_cooldown_timer")]
script = ExtResource("1_e1gjl")
[node name="Player" type="CharacterBody2D" node_paths=PackedStringArray("dash_cooldown_timer", "weapon_bullet_parent", "fire_cooldown_timer")]
collision_mask = 3
script = ExtResource("1_sa7t7")
dash_cooldown_timer = NodePath("DashCooldown")
weapon_bullet_scene = ExtResource("2_v83ov")
weapon_bullet_parent = NodePath("")
fire_cooldown_timer = NodePath("ShootCooldown")
[node name="DashCooldown" type="Timer" parent="."]
[node name="ShootCooldown" type="Timer" parent="."]
wait_time = 0.2
[node name="PlayerSprite" type="Sprite2D" parent="."]
position = Vector2(1.90735e-06, 1.78814e-06)
scale = Vector2(0.1, 0.1)
@ -20,4 +28,5 @@ texture = ExtResource("2_3pad2")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_k56cq")
[connection signal="timeout" from="DashCooldown" to="." method="_on_cooled_down"]
[connection signal="timeout" from="DashCooldown" to="." method="_on_dash_cooled_down"]
[connection signal="timeout" from="ShootCooldown" to="." method="_on_fire_cooled_down"]

View File

@ -1,17 +1,23 @@
[gd_scene load_steps=4 format=3 uid="uid://cxlgt8h33u7os"]
[gd_scene load_steps=5 format=3 uid="uid://cxlgt8h33u7os"]
[ext_resource type="Script" path="res://scripts/Tower.gd" id="1_58egr"]
[ext_resource type="Script" path="res://scripts/tower.gd" id="1_d5o8q"]
[ext_resource type="Texture2D" uid="uid://jxub8lma4oud" path="res://assets/tower_background.svg" id="2_ynj1l"]
[ext_resource type="Script" path="res://scripts/tower_health_display.gd" id="3_ijb8h"]
[sub_resource type="CircleShape2D" id="CircleShape2D_7mogk"]
radius = 129.139
[node name="Tower" type="Area2D"]
script = ExtResource("1_58egr")
[node name="Tower" type="Area2D" node_paths=PackedStringArray("sprite")]
collision_mask = 3
script = ExtResource("1_d5o8q")
sprite = NodePath("TowerSprite")
[node name="TowerSprite" type="Sprite2D" parent="."]
scale = Vector2(0.25, 0.25)
texture = ExtResource("2_ynj1l")
script = ExtResource("3_ijb8h")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_7mogk")
[connection signal="body_entered" from="." to="." method="_on_someone_entered"]