fix a something idk

This commit is contained in:
Ultrablob 2024-05-07 16:02:28 -04:00
parent 45a8e21c04
commit 2228a84086
4 changed files with 8 additions and 4 deletions

View file

@ -12,3 +12,7 @@ func fire():
func _process(delta):
#print(points)
points[1] = to_local($RayCast2D.get_collision_point())
func set_transparent():
modulate = Color.TRANSPARENT

View file

@ -67,7 +67,7 @@ func spawn(item: WaveEnemy):
var portal_effect = portal.instantiate()
portal_effect.global_position = spawn_loc
portal_effect.sprite_frames = item.portal_texture
$/root/Node2D.add_child(portal_effect)
$/root/Node2D.add_child.call_deferred(portal_effect)
await get_tree().create_timer((item.portal_texture.get_frame_count("default") / 2) * (1 / item.portal_texture.get_animation_speed("default"))).timeout
var node = item.enemy.instantiate()
node.global_position = spawn_loc

View file

@ -155,5 +155,5 @@ shape = SubResource("CircleShape2D_yns8h")
[node name="LaserFX" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("5_tkxjf")
[connection signal="timeout" from="Line2D/VisibleTimer" to="Line2D" method="hide_self"]
[connection signal="timeout" from="Line2D/VisibleTimer" to="Line2D" method="set_transparent"]
[connection signal="timeout" from="Timer" to="." method="fire_laser"]

View file

@ -3,7 +3,7 @@ extends StaticBody2D
@onready var player = $"../Player"
var idle_texture = preload("res://dotted line.png")
var aiming_texture = preload("res://laser_idle.png")
var active_texture = preload("res://laser_idle.png")
#var active_texture = preload("res://laser_idle.png")
var aiming = true
var can_damage = false
@ -35,7 +35,7 @@ func fire_laser():
tween.tween_callback(play_with_delay)
tween.set_parallel(false)
tween.tween_callback(can_shoot.bind(true))
tween.tween_callback(set_laser_texture.bind(active_texture))
#tween.tween_callback(set_laser_texture.bind(active_texture))
tween.tween_callback($Sprite2D.pause)
tween.tween_callback($Line2D.fire)
tween.tween_interval(0.2)