Skip to content

Commit

Permalink
feat: delete glow and add terra_blade's begin function
Browse files Browse the repository at this point in the history
  • Loading branch information
wlywlywlywly committed Aug 24, 2024
1 parent 6a2c279 commit bc5eab7
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 31 deletions.
1 change: 0 additions & 1 deletion project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,3 @@ locale/translations_pot_files=PackedStringArray("res://scenes/multi_game.tscn")
[rendering]

textures/canvas_textures/default_texture_filter=0
viewport/hdr_2d=true
12 changes: 0 additions & 12 deletions scenes/bullets/terra_blade/TerraBladeBeam.gdshader

This file was deleted.

17 changes: 4 additions & 13 deletions scenes/bullets/terra_blade/TerraBladeBeam.tscn
Original file line number Diff line number Diff line change
@@ -1,38 +1,29 @@
[gd_scene load_steps=7 format=3 uid="uid://1megnlcsse45"]
[gd_scene load_steps=4 format=3 uid="uid://1megnlcsse45"]

[ext_resource type="Script" path="res://scenes/bullets/terra_blade/terra_blade_beam.gd" id="1_va6li"]
[ext_resource type="Shader" path="res://scenes/bullets/terra_blade/TerraBladeBeam.gdshader" id="2_aqn2b"]
[ext_resource type="Texture2D" uid="uid://co2n6okllm0tl" path="res://scenes/bullets/terra_blade/terra_blade_beam.png" id="2_n1wh2"]

[sub_resource type="ShaderMaterial" id="ShaderMaterial_awmjb"]
shader = ExtResource("2_aqn2b")

[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_1ieue"]
radius = 8.48517
height = 86.9787

[sub_resource type="Environment" id="Environment_jcpgb"]
background_mode = 3
glow_enabled = true

[node name="TerraBladeBeam" type="Area2D"]
position = Vector2(600, 384)
scale = Vector2(1.5, 1.5)
script = ExtResource("1_va6li")
metadata/_edit_group_ = true

[node name="Sprite2D" type="Sprite2D" parent="."]
material = SubResource("ShaderMaterial_awmjb")
position = Vector2(-23.0017, 1.05356)
rotation = 0.785398
scale = Vector2(1.5, 1.5)
texture = ExtResource("2_n1wh2")
offset = Vector2(10.3465, -11.3398)

[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
rotation = 1.5708
shape = SubResource("CapsuleShape2D_1ieue")

[node name="OutScreen" type="VisibleOnScreenNotifier2D" parent="."]

[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_jcpgb")

[connection signal="screen_exited" from="OutScreen" to="." method="_on_out_screen_screen_exited"]
5 changes: 2 additions & 3 deletions scenes/bullets/terra_blade/terra_blade_beam.gd
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ func straight_move(
func _on_out_screen_screen_exited():
queue_free()


func _ready():
straight_move(Vector2(100, 100), Vector2(500, 500), 2, Tween.EASE_IN, Tween.TRANS_CUBIC)
#func _ready():
#straight_move(Vector2(100, 100), Vector2(500, 500), 2, Tween.EASE_IN, Tween.TRANS_CUBIC)
25 changes: 25 additions & 0 deletions scenes/weapons/terra_blade/terra_blade.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
extends Node

@export var terra_blade_beam : PackedScene
var tween = create_tween()

# Called when the node enters the scene tree for the first time.
func _ready():
begin()

func begin():
$Sprite2D.position = Vector2(-500, 1000)
var center = Vector2(570, 150)
var radial_shot = func(num: int, r: float):
var unit_rad = TAU / num
for i in range(0, num):
var beam = terra_blade_beam.instantiate()
get_parent().add_child.call_deferred(beam)
var rad = r + unit_rad * i
var to = 1500 * Vector2(cos(rad), sin(rad))
beam.straight_move(center, center + to, 1.5, Tween.EASE_IN, Tween.TRANS_CIRC)

tween.tween_callback(radial_shot.bind(24, 0))
tween.tween_interval(0.2)
tween.tween_callback(radial_shot.bind(24, TAU / 48))

10 changes: 8 additions & 2 deletions scenes/weapons/terra_blade/terra_blade.tscn
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
[gd_scene load_steps=2 format=3 uid="uid://clwl2jjjehebp"]
[gd_scene load_steps=4 format=3 uid="uid://clwl2jjjehebp"]

[ext_resource type="Script" path="res://scenes/weapons/terra_blade/terra_blade.gd" id="1_1hrqx"]
[ext_resource type="Texture2D" uid="uid://cykbxj82pu7no" path="res://scenes/weapons/terra_blade/terra_blade.png" id="1_477b2"]
[ext_resource type="PackedScene" uid="uid://1megnlcsse45" path="res://scenes/bullets/terra_blade/TerraBladeBeam.tscn" id="2_yp2sf"]

[node name="TerraBlade" type="Node"]
script = ExtResource("1_1hrqx")
terra_blade_beam = ExtResource("2_yp2sf")

[node name="Sprite2D" type="Sprite2D" parent="."]
position = Vector2(572, 307)
position = Vector2(527.511, 314.206)
rotation = 0.748746
scale = Vector2(2.3, 2.3)
texture = ExtResource("1_477b2")
offset = Vector2(12.0369, -15.4621)
metadata/_edit_group_ = true

0 comments on commit bc5eab7

Please sign in to comment.