Kimberly Arch

This commit is contained in:
Page Asgardius 2024-03-31 11:39:39 -07:00
parent 2e93425b17
commit a3bcdbc7b8
8 changed files with 155 additions and 12 deletions

View file

@ -5,7 +5,8 @@ var speciality
var btype
# Called when the node enters the scene tree for the first time.
func _ready():
speciality = Global.pcspecialities[Global.dparty[Global.dcpchar][0]]
if is_in_group("players"):
speciality = Global.pcspecialities[Global.dparty[Global.dcpchar][0]]
add_to_group(btype)
#pass # Replace with function body.

View file

@ -0,0 +1,49 @@
extends Area2D
var velocity: Vector2 = Vector2()
var direction
var speciality
var speed = 100
var btype
var isvisible
# Called when the node enters the scene tree for the first time.
func _ready():
if is_in_group("players"):
speciality = Global.pcspecialities[Global.dparty[Global.dcpchar][0]]
isvisible = $VisibleOnScreenNotifier2D
add_to_group(btype)
rotation = velocity.angle()
#pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _physics_process(delta):
if isvisible.is_on_screen():
if direction == null:
position += velocity * delta
else:
position += speed * delta * direction
func _on_body_entered(body):
if !body.is_in_group(btype):
if body.is_in_group("players") || body.is_in_group("boss") || body.is_in_group("enemies"):
if body.weakness == speciality:
print("weakness")
#if body.is_in_group("players"):
# Global.live = 2
#elif body.is_in_group("enemies"):
# Global.live = 3
#elif body.is_in_group("boss"):
# Global.live = 3
queue_free()
func _on_area_entered(area):
if !area.is_in_group(btype):
queue_free()
#pass # Replace with function body.

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bxbokpmpq22mg"
path="res://.godot/imported/arrow.png-5e13463477a6141db7ab43a9f24ff76d.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/common/bullet/arrow.png"
dest_files=["res://.godot/imported/arrow.png-5e13463477a6141db7ab43a9f24ff76d.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

@ -0,0 +1,25 @@
[gd_scene load_steps=4 format=3 uid="uid://batibvdy0i2b4"]
[ext_resource type="Script" path="res://sprites/common/bullet/arrow.gd" id="1_xh7h3"]
[ext_resource type="Texture2D" uid="uid://bxbokpmpq22mg" path="res://sprites/common/bullet/arrow.png" id="2_1l581"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_g125y"]
size = Vector2(129, 60)
[node name="Arrow" type="Area2D"]
script = ExtResource("1_xh7h3")
[node name="Sprite2D" type="Sprite2D" parent="."]
rotation = 3.14159
texture = ExtResource("2_1l581")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0.5, 0)
shape = SubResource("RectangleShape2D_g125y")
[node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="."]
position = Vector2(-7.15256e-07, -1.43051e-06)
scale = Vector2(3, 3)
[connection signal="area_entered" from="." to="." method="_on_area_entered"]
[connection signal="body_entered" from="." to="." method="_on_body_entered"]