sfx update

This commit is contained in:
ultrablob 2024-04-20 09:45:17 -04:00
parent bf16dfe508
commit cd361e3338
16 changed files with 682 additions and 105 deletions

View file

@ -10,9 +10,7 @@ func _ready():
# Called every frame. 'delta' is the elapsed time since the previous frame. # Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta): func _process(delta):
var porgres = [] var progress = ResourceLoader.load_threaded_get_status(MAIN_SCENE_PATH)
var progress = ResourceLoader.load_threaded_get_status(MAIN_SCENE_PATH, porgres)
$Layout/Play.text = "Play (%d%%)" % [clampf(remap(porgres[0], 0.46, 0.5, 0, 100), 0, 100)]
if progress == ResourceLoader.THREAD_LOAD_LOADED: if progress == ResourceLoader.THREAD_LOAD_LOADED:
$Layout/Play.disabled = false $Layout/Play.disabled = false
$Layout/Play.text = "Play" $Layout/Play.text = "Play"

View file

@ -85,16 +85,19 @@ func _input(event):
func aquire_quare(): func aquire_quare():
await get_tree().create_timer(3).timeout await get_tree().create_timer(3).timeout
num_quares -= 1 num_quares -= 1
$QuareFX.play()
update_display() update_display()
func aquire_exagon(): func aquire_exagon():
await get_tree().create_timer(15).timeout await get_tree().create_timer(15).timeout
exagons += 1 exagons += 1
$ExagonFX.play()
update_display() update_display()
func update_display(): func update_display():
$"../UI/Quare Count".text = "%d Quares\n%d Exagons" % [(max_quares - num_quares), exagons] $"../UI/Quare Count".text = "%d Quares\n%d Exagons" % [(max_quares - num_quares), exagons]
func destroy(): func destroy():
$DeathFX.play()
get_tree().paused = true get_tree().paused = true
$"../GameOver".visible = true $"../GameOver".visible = true

View file

@ -6,6 +6,9 @@ var max_health = 10.0
func destroy(): func destroy():
health -= 1 health -= 1
if health == 1:
$PowerDownFX.play()
if health <= 0: if health <= 0:
if not is_queued_for_deletion(): if not is_queued_for_deletion():
$"..".queue_free() $"..".queue_free()

View file

@ -1,18 +1,33 @@
extends Marker2D extends Marker2D
@export var item: PackedScene @export var item: PackedScene
@export var random_on_screen = false @export var random_off_screen = false
@export var radius = 100 @export var radius = 100
func spawn(): func spawn():
if get_tree().paused: if get_tree().paused:
return return
var spawn_loc = Vector2.ZERO
if random_off_screen:
var random = randi_range(1, 4)
if random == 1:
spawn_loc = Vector2(-50, 1080 * randf())
elif random == 2:
spawn_loc = Vector2(1950, 1080 * randf())
elif random == 3:
spawn_loc = Vector2(1920 * randf(), -50)
elif random == 4:
spawn_loc = Vector2(1920 * randf(), 1080 + 50)
for i in range(10): for i in range(10):
var test_pos = Vector2(randf(), randf()) * Vector2(1920, 1080) var test_pos = Vector2(randf(), randf()) * Vector2(1920, 1080)
if not $"../CollisionCheck".is_clear(test_pos, radius): if not $"../CollisionCheck".is_clear(test_pos, radius):
continue continue
var node = item.instantiate() spawn_loc = test_pos
node.global_position = test_pos
print(node.global_position)
$/root/Node2D.add_child(node)
break break
var node = item.instantiate()
node.global_position = spawn_loc
node.rotation_degrees = 360 * randf()
print(node.global_position)
$/root/Node2D.add_child(node)

View file

@ -1,14 +1,16 @@
extends Line2D extends Line2D
@export var target_shield = false
func _ready(): func _ready():
$RayCast2D.target_position = $"..".linear_velocity * 5000 $RayCast2D.target_position = $"..".linear_velocity * 5000
$RayCast2D.force_raycast_update() $RayCast2D.force_raycast_update()
func _physics_process(delta): func _physics_process(delta):
#global_rotation = $"..".linear_velocity.angle() #global_rotation = $"..".linear_velocity.angle()
$RayCast2D.target_position = $"..".linear_velocity * 5000 $RayCast2D.target_position = to_local($"..".linear_velocity * 5000)
points[1] = $"..".linear_velocity * 5000 points[1] = to_local($RayCast2D.get_collision_point())
if $RayCast2D.get_collider() != null and $RayCast2D.get_collider().name == "Player": if $RayCast2D.get_collider() != null and ["Player", "Shield" if target_shield else "None"].has($RayCast2D.get_collider().name):
visible = true visible = true
else: else:
visible = false visible = false

View file

@ -39,7 +39,7 @@ offset = Vector2(7.05637, 10.7826)
z_index = -1 z_index = -1
texture_repeat = 2 texture_repeat = 2
position = Vector2(-2, 0) position = Vector2(-2, 0)
points = PackedVector2Array(0, 0, 2000, 2.08165e-12) points = PackedVector2Array(0, 0, 100, 0)
width = 50.0 width = 50.0
default_color = Color(0.909804, 0.717647, 0.337255, 0.529412) default_color = Color(0.909804, 0.717647, 0.337255, 0.529412)
texture = ExtResource("4_h1jno") texture = ExtResource("4_h1jno")

Binary file not shown.

Before

Width:  |  Height:  |  Size: 234 KiB

View file

@ -1,15 +0,0 @@
[remap]
importer="import_gif_to_sprite_frames"
type="SpriteFrames"
uid="uid://8b07jl81sgcb"
path="res://.godot/imported/countdown.gif-98c459a3bd57109c3a7a1994512b90f9.tres"
[deps]
source_file="res://countdown.gif"
dest_files=["res://.godot/imported/countdown.gif-98c459a3bd57109c3a7a1994512b90f9.tres"]
[params]
frames_per_second=30

View file

@ -1,8 +1,10 @@
[gd_scene load_steps=4 format=3 uid="uid://c54oi61t8bvtu"] [gd_scene load_steps=6 format=3 uid="uid://c54oi61t8bvtu"]
[ext_resource type="Script" path="res://Entagon.gd" id="1_726g8"] [ext_resource type="Script" path="res://Entagon.gd" id="1_726g8"]
[ext_resource type="PhysicsMaterial" uid="uid://c5tm7od8mwjjb" path="res://elastic.tres" id="1_pvpk5"] [ext_resource type="PhysicsMaterial" uid="uid://c5tm7od8mwjjb" path="res://elastic.tres" id="1_pvpk5"]
[ext_resource type="SpriteFrames" uid="uid://cffqo7q1ofatc" path="res://entagon.gif" id="3_116st"] [ext_resource type="SpriteFrames" uid="uid://cffqo7q1ofatc" path="res://entagon.gif" id="3_116st"]
[ext_resource type="Texture2D" uid="uid://djfjdlri5xdkn" path="res://dotted line.png" id="4_vixiu"]
[ext_resource type="Script" path="res://TrajectoryDisplay.gd" id="5_w6b4q"]
[node name="Entagon" type="RigidBody2D"] [node name="Entagon" type="RigidBody2D"]
physics_material_override = ExtResource("1_pvpk5") physics_material_override = ExtResource("1_pvpk5")
@ -25,4 +27,20 @@ autoplay = "gif"
scale = Vector2(0.1, 0.1) scale = Vector2(0.1, 0.1)
polygon = PackedVector2Array(-10, -230, 210, -60, 140, 170, -130, 170, -230, -50) polygon = PackedVector2Array(-10, -230, 210, -60, 140, 170, -130, 170, -230, -50)
[node name="TrajectoryDisplay" type="Line2D" parent="."]
z_index = -1
texture_repeat = 2
position = Vector2(-2, 0)
points = PackedVector2Array(0, 0, 100, 0)
width = 50.0
default_color = Color(0.909804, 0.717647, 0.337255, 0.529412)
texture = ExtResource("4_vixiu")
texture_mode = 1
script = ExtResource("5_w6b4q")
target_shield = true
[node name="RayCast2D" type="RayCast2D" parent="TrajectoryDisplay"]
target_position = Vector2(5000, 2.08165e-12)
collision_mask = 3
[connection signal="body_entered" from="." to="." method="hit"] [connection signal="body_entered" from="." to="." method="hit"]

View file

@ -1,9 +1,10 @@
[gd_scene load_steps=6 format=3 uid="uid://c87easb8570vd"] [gd_scene load_steps=7 format=3 uid="uid://c87easb8570vd"]
[ext_resource type="PhysicsMaterial" uid="uid://c5tm7od8mwjjb" path="res://elastic.tres" id="1_1oplx"] [ext_resource type="PhysicsMaterial" uid="uid://c5tm7od8mwjjb" path="res://elastic.tres" id="1_1oplx"]
[ext_resource type="Script" path="res://Shield.gd" id="2_q7qjq"] [ext_resource type="Script" path="res://Shield.gd" id="2_q7qjq"]
[ext_resource type="Texture2D" uid="uid://xq1dd6w22i6f" path="res://Hexagon outline.png" id="2_x53yb"] [ext_resource type="Texture2D" uid="uid://xq1dd6w22i6f" path="res://Hexagon outline.png" id="2_x53yb"]
[ext_resource type="SpriteFrames" uid="uid://6oj6l7lnsjhi" path="res://exagon.gif" id="4_cfpay"] [ext_resource type="SpriteFrames" uid="uid://6oj6l7lnsjhi" path="res://exagon.gif" id="4_cfpay"]
[ext_resource type="AudioStream" uid="uid://b73ik24u615jc" path="res://phaserDown1.ogg" id="5_8ceda"]
[sub_resource type="CircleShape2D" id="CircleShape2D_evq3y"] [sub_resource type="CircleShape2D" id="CircleShape2D_evq3y"]
radius = 25.0 radius = 25.0
@ -24,6 +25,10 @@ texture = ExtResource("2_x53yb")
position = Vector2(13, 194) position = Vector2(13, 194)
polygon = PackedVector2Array(-13, -443, 204, -317, 206, -69, -12, 57, -231, -71, -231, -316) polygon = PackedVector2Array(-13, -443, 204, -317, 206, -69, -12, 57, -231, -71, -231, -316)
[node name="PowerDownFX" type="AudioStreamPlayer2D" parent="Shield"]
stream = ExtResource("5_8ceda")
pitch_scale = 0.95
[node name="Generator" type="StaticBody2D" parent="."] [node name="Generator" type="StaticBody2D" parent="."]
[node name="Sprite" type="AnimatedSprite2D" parent="Generator"] [node name="Sprite" type="AnimatedSprite2D" parent="Generator"]

View file

@ -1,9 +1,10 @@
[gd_scene load_steps=6 format=3 uid="uid://4lc6bvf7b8a0"] [gd_scene load_steps=7 format=3 uid="uid://4lc6bvf7b8a0"]
[ext_resource type="Texture2D" uid="uid://djfjdlri5xdkn" path="res://dotted line.png" id="2_3i0n3"] [ext_resource type="Texture2D" uid="uid://djfjdlri5xdkn" path="res://dotted line.png" id="2_3i0n3"]
[ext_resource type="Script" path="res://laser_enemy.gd" id="2_lyi2i"] [ext_resource type="Script" path="res://laser_enemy.gd" id="2_lyi2i"]
[ext_resource type="Script" path="res://Laser.gd" id="3_hosl5"] [ext_resource type="Script" path="res://Laser.gd" id="3_hosl5"]
[ext_resource type="SpriteFrames" uid="uid://d320lntdiw2kj" path="res://ircle.gif" id="3_ys12y"] [ext_resource type="SpriteFrames" uid="uid://d320lntdiw2kj" path="res://ircle.gif" id="3_ys12y"]
[ext_resource type="AudioStream" uid="uid://fyudre3xo1j2" path="res://laser4.ogg" id="5_1qck7"]
[sub_resource type="CircleShape2D" id="CircleShape2D_yns8h"] [sub_resource type="CircleShape2D" id="CircleShape2D_yns8h"]
radius = 128.0 radius = 128.0
@ -47,5 +48,8 @@ autostart = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="."] [node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_yns8h") shape = SubResource("CircleShape2D_yns8h")
[node name="LaserFX" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("5_1qck7")
[connection signal="timeout" from="Line2D/VisibleTimer" to="Line2D" method="hide_self"] [connection signal="timeout" from="Line2D/VisibleTimer" to="Line2D" method="hide_self"]
[connection signal="timeout" from="Timer" to="." method="fire_laser"] [connection signal="timeout" from="Timer" to="." method="fire_laser"]

View file

@ -32,6 +32,7 @@ func fire_laser():
tween.set_parallel(true) tween.set_parallel(true)
tween.tween_callback(set_laser_texture.bind(aiming_texture)) tween.tween_callback(set_laser_texture.bind(aiming_texture))
tween.tween_property($Line2D, "modulate", Color.WHITE, 1).set_ease(Tween.EASE_IN) tween.tween_property($Line2D, "modulate", Color.WHITE, 1).set_ease(Tween.EASE_IN)
tween.tween_callback(play_with_delay)
tween.set_parallel(false) tween.set_parallel(false)
tween.tween_callback(can_shoot.bind(true)) 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))
@ -47,6 +48,10 @@ func fire_laser():
tween.tween_callback(start_aim) tween.tween_callback(start_aim)
tween.tween_callback(set_laser_texture.bind(idle_texture)) tween.tween_callback(set_laser_texture.bind(idle_texture))
func play_with_delay():
await get_tree().create_timer(0.75).timeout
$LaserFX.play()
func set_laser_texture(texture): func set_laser_texture(texture):
$Line2D.texture = texture $Line2D.texture = texture
@ -55,10 +60,3 @@ func start_aim():
func can_shoot(yn): func can_shoot(yn):
can_damage = yn can_damage = yn
func hit(body: Node2D):
if body.name == "Clock":
queue_free()
elif body.name == "Bullet":
body.queue_free()
queue_free()

579
main.tscn

File diff suppressed because one or more lines are too long

View file

@ -1,16 +1,11 @@
[gd_scene load_steps=8 format=3 uid="uid://ck1db6d8whbac"] [gd_scene load_steps=6 format=3 uid="uid://ck1db6d8whbac"]
[ext_resource type="Script" path="res://MainMenu.gd" id="1_omrmt"] [ext_resource type="Script" path="res://MainMenu.gd" id="1_omrmt"]
[ext_resource type="Gradient" uid="uid://c41berdx2rqpw" path="res://gradient.tres" id="2_fq3us"] [ext_resource type="Texture2D" uid="uid://bfuxwsctqat2v" path="res://main_menu.png" id="2_vrg41"]
[ext_resource type="Script" path="res://InfiniteGradient.gd" id="3_7u2sq"]
[ext_resource type="FontFile" uid="uid://bnguin7bsyx6e" path="res://Kenney Future.ttf" id="4_ybv7t"] [ext_resource type="FontFile" uid="uid://bnguin7bsyx6e" path="res://Kenney Future.ttf" id="4_ybv7t"]
[ext_resource type="Script" path="res://Settings.gd" id="5_sarwv"] [ext_resource type="Script" path="res://Settings.gd" id="5_sarwv"]
[ext_resource type="Script" path="res://EmojiValidator.gd" id="6_ojb71"] [ext_resource type="Script" path="res://EmojiValidator.gd" id="6_ojb71"]
[sub_resource type="GradientTexture1D" id="GradientTexture1D_jya8r"]
gradient = ExtResource("2_fq3us")
width = 16384
[node name="MainMenu" type="Control"] [node name="MainMenu" type="Control"]
layout_mode = 3 layout_mode = 3
anchors_preset = 15 anchors_preset = 15
@ -21,18 +16,14 @@ grow_vertical = 2
script = ExtResource("1_omrmt") script = ExtResource("1_omrmt")
[node name="TextureRect" type="TextureRect" parent="."] [node name="TextureRect" type="TextureRect" parent="."]
texture_filter = 1
layout_mode = 1 layout_mode = 1
anchors_preset = 15 anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
offset_left = -152.0
offset_right = 14312.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
texture = SubResource("GradientTexture1D_jya8r") texture = ExtResource("2_vrg41")
stretch_mode = 1
script = ExtResource("3_7u2sq")
speed = 100
[node name="Title" type="Label" parent="."] [node name="Title" type="Label" parent="."]
layout_mode = 1 layout_mode = 1

View file

@ -1,7 +1,13 @@
[gd_scene load_steps=3 format=3 uid="uid://cgcjicue76wsr"] [gd_scene load_steps=7 format=3 uid="uid://cgcjicue76wsr"]
[ext_resource type="Script" path="res://Player.gd" id="1_bu0dg"] [ext_resource type="Script" path="res://Player.gd" id="1_bu0dg"]
[ext_resource type="SpriteFrames" uid="uid://cmkptgd3k37bl" path="res://player_idle.gif" id="2_c8tq3"] [ext_resource type="SpriteFrames" uid="uid://cmkptgd3k37bl" path="res://player_idle.gif" id="2_c8tq3"]
[ext_resource type="AudioStream" uid="uid://cuu1qqskoqabg" path="res://Taco_Bell_Bong.ogg" id="3_urvwh"]
[ext_resource type="AudioStream" uid="uid://cbghiy80qmaa0" path="res://powerUp6.ogg" id="4_i2tip"]
[ext_resource type="AudioStream" uid="uid://mond5sdmukan" path="res://powerUp7.ogg" id="5_bu8ku"]
[sub_resource type="CircleShape2D" id="CircleShape2D_nxtxc"]
radius = 16.0
[node name="Player" type="RigidBody2D" groups=["destructible"]] [node name="Player" type="RigidBody2D" groups=["destructible"]]
position = Vector2(-42, 74) position = Vector2(-42, 74)
@ -16,8 +22,14 @@ sprite_frames = ExtResource("2_c8tq3")
animation = &"gif" animation = &"gif"
speed_scale = 0.75 speed_scale = 0.75
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."] [node name="CollisionShape2D" type="CollisionShape2D" parent="."]
visible = false shape = SubResource("CircleShape2D_nxtxc")
rotation = 1.5708
scale = Vector2(0.1, 0.1) [node name="DeathFX" type="AudioStreamPlayer2D" parent="."]
polygon = PackedVector2Array(0, -155, 23, -147, 249, 89, 259, 113, 246, 142, 216, 155, 178, 148, 0, 52, -187, 150, -232, 148, -257, 116, -250, 89, -38, -136, -21, -147) stream = ExtResource("3_urvwh")
[node name="QuareFX" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("4_i2tip")
[node name="ExagonFX" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("5_bu8ku")

View file

@ -1,26 +1,46 @@
[gd_scene load_steps=4 format=3 uid="uid://chn8kuplnjxik"] [gd_scene load_steps=7 format=3 uid="uid://chn8kuplnjxik"]
[ext_resource type="SpriteFrames" uid="uid://cejgerinde63x" path="res://portal-sprite.gif" id="1_17yb8"] [ext_resource type="Texture2D" uid="uid://baaak3ooc6rvq" path="res://Hexagon.png" id="1_lhm7s"]
[ext_resource type="SpriteFrames" uid="uid://bhut2leth5pcl" path="res://portal-mask.gif" id="2_pxlsc"]
[ext_resource type="PackedScene" uid="uid://yu50iyftoyaj" path="res://riangle.tscn" id="3_r3mwi"]
[node name="Portal" type="Node2D"] [sub_resource type="Gradient" id="Gradient_ejv0r"]
interpolation_mode = 2
offsets = PackedFloat32Array(0, 0.278689, 0.737705, 1)
colors = PackedColorArray(1, 0.6, 0, 0, 1, 0.6, 0, 1, 1, 0.6, 0, 1, 1, 0.6, 0, 0)
[node name="Sprite" type="AnimatedSprite2D" parent="."] [sub_resource type="GradientTexture1D" id="GradientTexture1D_mfh8i"]
texture_filter = 1 gradient = SubResource("Gradient_ejv0r")
position = Vector2(-3, 0)
scale = Vector2(3, 3)
sprite_frames = ExtResource("1_17yb8")
animation = &"gif"
autoplay = "gif"
[node name="Mask" type="AnimatedSprite2D" parent="."] [sub_resource type="Curve" id="Curve_imaul"]
clip_children = 1 min_value = -10.0
texture_filter = 1 max_value = 10.0
scale = Vector2(3, 3) _data = [Vector2(0, -10), 0.0, 0.0, 0, 0, Vector2(1, 2.74725), 0.0, 0.0, 0, 0]
sprite_frames = ExtResource("2_pxlsc") point_count = 2
animation = &"gif"
autoplay = "gif"
[node name="Riangle" parent="Mask" instance=ExtResource("3_r3mwi")] [sub_resource type="CurveTexture" id="CurveTexture_6sfnf"]
scale = Vector2(0.083, 0.083) curve = SubResource("Curve_imaul")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_e6bpl"]
particle_flag_disable_z = true
emission_shape = 1
emission_sphere_radius = 200.0
spread = 0.0
gravity = Vector3(0, 0, 0)
radial_accel_min = 1.0
radial_accel_max = 2.0
radial_accel_curve = SubResource("CurveTexture_6sfnf")
tangential_accel_min = 1.0
tangential_accel_max = 5.0
scale_min = 0.02
scale_max = 0.02
color_ramp = SubResource("GradientTexture1D_mfh8i")
[node name="Spawner" type="Node2D"]
[node name="GPUParticles2D" type="GPUParticles2D" parent="."]
z_index = 10
emitting = false
amount = 1000
process_material = SubResource("ParticleProcessMaterial_e6bpl")
texture = ExtResource("1_lhm7s")
lifetime = 5.0
one_shot = true