diff --git a/global.gd b/global.gd index 5791e99..bb60cfe 100644 --- a/global.gd +++ b/global.gd @@ -38,7 +38,7 @@ var firstrun const musictracks = ["res://music/midorinoakuma.wav", "res://music/seahorse.wav", "res://music/chinesegoat.wav", "res://music/doyoufeelold.wav", "res://music/doyiuneedahealer.wav", "res://music/adayatceres.wav", "res://music/twintroublemakers.wav", "res://music/easyquiz.wav", "res://music/neowave.wav", "res://music/multivectorsubmarines.wav", "res://music/halfgeniegirls.wav", "res://music/rusianmaverickfairy.wav", "res://music/blacksmithofdestruction.wav", "res://music/shininglikefireworks.wav", "res://music/sadtrashcan.wav", "res://music/akikoletter.wav", "res://music/asadcat.wav", "res://music/lilydesire.wav", "res://music/scholartrip.wav", "res://music/quantumice.wav", "res://music/unreeeal.wav"] const sfxtracks = ["res://sfx/braindamage.wav", "res://sfx/gaugefill.wav", "res://sfx/boomboombakudan.wav"] var debug = false -const release = "R0.1.4-alpha" +const release = "R0.1.4-dev" var sk = false var xm = 0 var ym = 0 diff --git a/sprites/common/bullet/X11.gd b/sprites/common/bullet/X11.gd new file mode 100644 index 0000000..1043238 --- /dev/null +++ b/sprites/common/bullet/X11.gd @@ -0,0 +1,40 @@ +extends Area2D +var velocity: Vector2 = Vector2() +var direction +var speciality = 3 +var btype +# Called when the node enters the scene tree for the first time. +func _ready(): + add_to_group(btype) + #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): + pass + +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 == 3: + print("weak to fire") + #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. + + +func _on_timer_timeout(): + queue_free() diff --git a/sprites/common/bullet/X11.svg b/sprites/common/bullet/X11.svg new file mode 100644 index 0000000..030f8bd --- /dev/null +++ b/sprites/common/bullet/X11.svg @@ -0,0 +1,21 @@ + + + + + + + + + diff --git a/sprites/common/bullet/X11.svg.import b/sprites/common/bullet/X11.svg.import new file mode 100644 index 0000000..c61a5b1 --- /dev/null +++ b/sprites/common/bullet/X11.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dr52x3yif0wtw" +path="res://.godot/imported/X11.svg-b7d21ecbd13e564cd4c209aae272d596.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://sprites/common/bullet/X11.svg" +dest_files=["res://.godot/imported/X11.svg-b7d21ecbd13e564cd4c209aae272d596.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 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/sprites/common/bullet/X11.tscn b/sprites/common/bullet/X11.tscn new file mode 100644 index 0000000..2ab72d8 --- /dev/null +++ b/sprites/common/bullet/X11.tscn @@ -0,0 +1,26 @@ +[gd_scene load_steps=4 format=3 uid="uid://dnufhjr63cddd"] + +[ext_resource type="Script" path="res://sprites/common/bullet/X11.gd" id="1_sd1jl"] +[ext_resource type="Texture2D" uid="uid://dr52x3yif0wtw" path="res://sprites/common/bullet/X11.svg" id="2_nkqom"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_g125y"] + +[node name="X11" type="Area2D"] +script = ExtResource("1_sd1jl") + +[node name="Sprite2D" type="Sprite2D" parent="."] +scale = Vector2(0.1, 0.1) +texture = ExtResource("2_nkqom") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource("RectangleShape2D_g125y") + +[node name="VisibleOnScreenEnabler2D" type="VisibleOnScreenEnabler2D" parent="."] + +[node name="Timer" type="Timer" parent="."] +wait_time = 0.3 +autostart = true + +[connection signal="area_entered" from="." to="." method="_on_area_entered"] +[connection signal="body_entered" from="." to="." method="_on_body_entered"] +[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"] diff --git a/sprites/common/bullet/fireball.gd b/sprites/common/bullet/fireball.gd index 9ee5cbc..34a5dbc 100644 --- a/sprites/common/bullet/fireball.gd +++ b/sprites/common/bullet/fireball.gd @@ -3,8 +3,10 @@ var velocity: Vector2 = Vector2() var direction var speed = 100 var btype +var isvisible # Called when the node enters the scene tree for the first time. func _ready(): + isvisible = $VisibleOnScreenNotifier2D add_to_group(btype) #pass # Replace with function body. @@ -14,10 +16,11 @@ func _process(delta): pass func _physics_process(delta): - if direction == null: - position += velocity * delta - else: - position += speed * delta * direction + if isvisible.is_on_screen(): + if direction == null: + position += velocity * delta + else: + position += speed * delta * direction func _on_body_entered(body): @@ -34,8 +37,6 @@ func _on_body_entered(body): queue_free() -func _on_screen_exited(): - queue_free() func _on_area_entered(area): diff --git a/sprites/common/bullet/fireball.tscn b/sprites/common/bullet/fireball.tscn index 2a5e735..75c847f 100644 --- a/sprites/common/bullet/fireball.tscn +++ b/sprites/common/bullet/fireball.tscn @@ -16,7 +16,9 @@ texture = ExtResource("1_ues2l") position = Vector2(0.5, 0) shape = SubResource("RectangleShape2D_g125y") -[node name="VisibleOnScreenEnabler2D" type="VisibleOnScreenEnabler2D" parent="."] +[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"] diff --git a/sprites/common/bullet/snowflake.gd b/sprites/common/bullet/snowflake.gd index 063455b..2369504 100644 --- a/sprites/common/bullet/snowflake.gd +++ b/sprites/common/bullet/snowflake.gd @@ -3,8 +3,10 @@ var velocity: Vector2 = Vector2() var direction var speed = 100 var btype +var isvisible # Called when the node enters the scene tree for the first time. func _ready(): + isvisible = $VisibleOnScreenNotifier2D add_to_group(btype) #pass # Replace with function body. @@ -14,10 +16,11 @@ func _process(delta): pass func _physics_process(delta): - if direction == null: - position += velocity * delta - else: - position += speed * delta * direction + if isvisible.is_on_screen(): + if direction == null: + position += velocity * delta + else: + position += speed * delta * direction func _on_body_entered(body): @@ -34,10 +37,6 @@ func _on_body_entered(body): queue_free() -func _on_screen_exited(): - queue_free() - - func _on_area_entered(area): if !area.is_in_group(btype): queue_free() diff --git a/sprites/common/bullet/snowflake.tscn b/sprites/common/bullet/snowflake.tscn index 224075b..9f7af42 100644 --- a/sprites/common/bullet/snowflake.tscn +++ b/sprites/common/bullet/snowflake.tscn @@ -15,7 +15,9 @@ texture = ExtResource("2_0alhu") [node name="CollisionShape2D" type="CollisionShape2D" parent="."] shape = SubResource("RectangleShape2D_g125y") -[node name="VisibleOnScreenEnabler2D" type="VisibleOnScreenEnabler2D" parent="."] +[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"]