implemented y-wing main cannon and effects.

This commit is contained in:
zerothelootrat
2024-06-06 03:24:17 -04:00
parent 869ad92e5a
commit 62f6b4d873
6 changed files with 88 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 B

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://qmnr2uqcocyi"
path="res://.godot/imported/y-wing_main_laser.png-eb02e45ecdcfd605782f38b4c2feafab.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Assets/y-wing_main_laser.png"
dest_files=["res://.godot/imported/y-wing_main_laser.png-eb02e45ecdcfd605782f38b4c2feafab.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -6,6 +6,7 @@ var Laser = preload("res://Scenes/PlayerLaser.tscn")
var missile = preload("res://Scenes/missile.tscn")
var missile_refil = preload("res://Scenes/missile_pickup.tscn")
var enemy_laser = preload("res://Scenes/enemy_laser.tscn")
var enemy_y_wing_main = preload("res://Scenes/y_wing_main_cannon_laser.tscn")
var enemy_y_wing_turret_laser = preload("res://Scenes/turret_laser.tscn")
var enemy_y_wing_main_laser = null
@@ -68,6 +69,11 @@ func firey_wingturret(location,firing_solution,target):
add_child(l)
#l.initialize(rotation,target)
func fire_y_wing_main(location):
print("fired")
var l = enemy_y_wing_main.instantiate()
l.global_position = location
add_child(l)

View File

@@ -0,0 +1,30 @@
[gd_scene load_steps=5 format=3 uid="uid://bclbidx5k15o7"]
[ext_resource type="Script" path="res://Scripts/y_wing_main_cannon_laser.gd" id="1_2yenk"]
[ext_resource type="Texture2D" uid="uid://qmnr2uqcocyi" path="res://Assets/y-wing_main_laser.png" id="1_jmsrt"]
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_iw7a3"]
radius = 3.0
height = 80.0
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_mtiwm"]
radius = 3.0
height = 80.0
[node name="y-wing-main-cannon" type="Area2D"]
collision_layer = 16
collision_mask = 3
script = ExtResource("1_2yenk")
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("1_jmsrt")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(-8, 4)
shape = SubResource("CapsuleShape2D_iw7a3")
[node name="CollisionShape2D2" type="CollisionShape2D" parent="."]
position = Vector2(7, 4)
shape = SubResource("CapsuleShape2D_mtiwm")
[connection signal="area_entered" from="." to="." method="_on_area_entered"]

View File

@@ -43,8 +43,9 @@ func _physics_process(delta):
global_position.y += speed * delta
#main cannon firing
if mainray.is_colliding and mainray.get_collider is player:
if mainray.is_colliding and mainray.get_collider() is player:
if main_cannon == true:
print("target")
fire_main_cannon()
main_cannon = false
mainCannonFire.start()

View File

@@ -0,0 +1,16 @@
extends Area2D
var speed = 2500
func _physics_process(delta):
global_position.y += speed * delta
if global_position.y >= 980:
queue_free()
func _on_area_entered(area):
if area is player:
area.take_damage(1)
queue_free()