Add cannon_bullet scene and update cannon settings; implement new bullet behavior and shooting interval
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_6gptm"]
|
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_6gptm"]
|
||||||
[ext_resource type="Script" uid="uid://bnaxy8cw3wrko" path="res://scripts/components/PeriodicShootingComponent.cs" id="2_q37h7"]
|
[ext_resource type="Script" uid="uid://bnaxy8cw3wrko" path="res://scripts/components/PeriodicShootingComponent.cs" id="2_q37h7"]
|
||||||
[ext_resource type="PackedScene" uid="uid://bhc7y4xugu4q7" path="res://objects/entities/bullet.tscn" id="3_bhwy3"]
|
[ext_resource type="PackedScene" uid="uid://chetx6gmnwbxi" path="res://objects/entities/cannon_bullet.tscn" id="3_ww0hb"]
|
||||||
[ext_resource type="Script" uid="uid://b3j23e7b7x8ro" path="res://scripts/components/RecoilComponent.cs" id="4_bhwy3"]
|
[ext_resource type="Script" uid="uid://b3j23e7b7x8ro" path="res://scripts/components/RecoilComponent.cs" id="4_bhwy3"]
|
||||||
[ext_resource type="Script" uid="uid://c707c53k7c5ae" path="res://scripts/components/SquashAndStretchComponent.cs" id="5_ww0hb"]
|
[ext_resource type="Script" uid="uid://c707c53k7c5ae" path="res://scripts/components/SquashAndStretchComponent.cs" id="5_ww0hb"]
|
||||||
|
|
||||||
@@ -24,11 +24,11 @@ shape = SubResource("RectangleShape2D_j5sus")
|
|||||||
|
|
||||||
[node name="PeriodicShootingComponent" type="Node" parent="." node_paths=PackedStringArray("BulletSpawnPointRight")]
|
[node name="PeriodicShootingComponent" type="Node" parent="." node_paths=PackedStringArray("BulletSpawnPointRight")]
|
||||||
script = ExtResource("2_q37h7")
|
script = ExtResource("2_q37h7")
|
||||||
BulletScene = ExtResource("3_bhwy3")
|
BulletScene = ExtResource("3_ww0hb")
|
||||||
ShootInterval = 0.2
|
ShootInterval = 3.0
|
||||||
ShootDirection = Vector2(0, -1)
|
ShootDirection = Vector2(0, -1)
|
||||||
BulletSpawnPointRight = NodePath("../Bullet spawn")
|
BulletSpawnPointRight = NodePath("../Bullet spawn")
|
||||||
ShootingIntervalVariation = 0.3
|
ShootingIntervalVariation = 0.61
|
||||||
metadata/_custom_type_script = "uid://bnaxy8cw3wrko"
|
metadata/_custom_type_script = "uid://bnaxy8cw3wrko"
|
||||||
|
|
||||||
[node name="Bullet spawn" type="Marker2D" parent="."]
|
[node name="Bullet spawn" type="Marker2D" parent="."]
|
||||||
|
72
objects/entities/cannon_bullet.tscn
Normal file
72
objects/entities/cannon_bullet.tscn
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
[gd_scene load_steps=11 format=3 uid="uid://chetx6gmnwbxi"]
|
||||||
|
|
||||||
|
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_alaj6"]
|
||||||
|
[ext_resource type="Script" uid="uid://2i7p7v135u7c" path="res://scripts/components/DamageComponent.cs" id="2_xmjlg"]
|
||||||
|
[ext_resource type="Script" uid="uid://cs6u3sh68f43j" path="res://scripts/components/OutOfScreenComponent.cs" id="3_jege3"]
|
||||||
|
[ext_resource type="Script" uid="uid://oyf25mpc5etr" path="res://scripts/components/LifetimeComponent.cs" id="4_aniyw"]
|
||||||
|
[ext_resource type="Script" uid="uid://cbexrnnj47f87" path="res://scripts/components/LaunchComponent.cs" id="5_3ks47"]
|
||||||
|
[ext_resource type="Script" uid="uid://c7p06t0eax8am" path="res://scripts/components/StraightMotionComponent.cs" id="6_4cg6n"]
|
||||||
|
[ext_resource type="Script" uid="uid://cfw8nbrarex0i" path="res://scripts/components/BulletComponent.cs" id="7_cr5p0"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://c1iorglk708g0" path="res://objects/fxs/terrain_hit_fx.tscn" id="8_ivkeb"]
|
||||||
|
[ext_resource type="Script" uid="uid://dgb8bqcri7nsj" path="res://scripts/components/HealthComponent.cs" id="9_gx2e5"]
|
||||||
|
|
||||||
|
[sub_resource type="CircleShape2D" id="CircleShape2D_txsw8"]
|
||||||
|
radius = 4.0
|
||||||
|
|
||||||
|
[node name="Bullet" type="Area2D"]
|
||||||
|
collision_layer = 64
|
||||||
|
collision_mask = 21
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
shape = SubResource("CircleShape2D_txsw8")
|
||||||
|
|
||||||
|
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||||
|
modulate = Color(1.5, 1, 1, 1)
|
||||||
|
scale = Vector2(0.5, 0.5)
|
||||||
|
texture = ExtResource("1_alaj6")
|
||||||
|
hframes = 12
|
||||||
|
vframes = 12
|
||||||
|
frame = 79
|
||||||
|
|
||||||
|
[node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="."]
|
||||||
|
position = Vector2(2.38419e-07, 2.38419e-07)
|
||||||
|
scale = Vector2(0.4, 0.4)
|
||||||
|
|
||||||
|
[node name="DamageComponent" type="Node" parent="." node_paths=PackedStringArray("Area", "DamageTimer")]
|
||||||
|
script = ExtResource("2_xmjlg")
|
||||||
|
Area = NodePath("..")
|
||||||
|
DamageTimer = NodePath("../Timer")
|
||||||
|
|
||||||
|
[node name="Timer" type="Timer" parent="."]
|
||||||
|
wait_time = 5.0
|
||||||
|
autostart = true
|
||||||
|
|
||||||
|
[node name="OutOfScreenComponent" type="Node" parent="." node_paths=PackedStringArray("VisibilityNotifier")]
|
||||||
|
script = ExtResource("3_jege3")
|
||||||
|
VisibilityNotifier = NodePath("../VisibleOnScreenNotifier2D")
|
||||||
|
|
||||||
|
[node name="LifetimeComponent" type="Node" parent="."]
|
||||||
|
script = ExtResource("4_aniyw")
|
||||||
|
LifeTime = 10.0
|
||||||
|
|
||||||
|
[node name="LaunchComponent" type="Node2D" parent="."]
|
||||||
|
script = ExtResource("5_3ks47")
|
||||||
|
Speed = 160.0
|
||||||
|
|
||||||
|
[node name="StraightMotionComponent" type="Node" parent="." node_paths=PackedStringArray("LaunchComponent")]
|
||||||
|
script = ExtResource("6_4cg6n")
|
||||||
|
LaunchComponent = NodePath("../LaunchComponent")
|
||||||
|
|
||||||
|
[node name="BulletComponent" type="Node" parent="." node_paths=PackedStringArray("Area", "TerrainHitFx", "BulletSprite")]
|
||||||
|
script = ExtResource("7_cr5p0")
|
||||||
|
Area = NodePath("..")
|
||||||
|
TerrainHitFx = NodePath("../TerrainHitFX")
|
||||||
|
BulletSprite = NodePath("../Sprite2D")
|
||||||
|
|
||||||
|
[node name="TerrainHitFX" parent="." instance=ExtResource("8_ivkeb")]
|
||||||
|
z_index = 3
|
||||||
|
|
||||||
|
[node name="HealthComponent" type="Node2D" parent="."]
|
||||||
|
script = ExtResource("9_gx2e5")
|
||||||
|
Health = 0.1
|
||||||
|
metadata/_custom_type_script = "uid://dgb8bqcri7nsj"
|
Reference in New Issue
Block a user