From 26fe0173e4776f1253c1d2d2f0f6a60aa13cef7a Mon Sep 17 00:00:00 2001 From: Haze Weathers Date: Tue, 24 Jan 2023 16:42:18 -0500 Subject: [PATCH] switch to GLES2 renderer --- objects/enemy/death_particles.tscn | 40 +++++--------- objects/environment/turret/turret.tscn | 38 +++++-------- objects/player/arrow_projectile.gd | 18 +++--- objects/player/arrow_projectile.tscn | 66 ++++++++-------------- objects/player/player.tscn | 76 ++++++++++---------------- project.godot | 1 + 6 files changed, 90 insertions(+), 149 deletions(-) diff --git a/objects/enemy/death_particles.tscn b/objects/enemy/death_particles.tscn index 0dffa47..52c3390 100644 --- a/objects/enemy/death_particles.tscn +++ b/objects/enemy/death_particles.tscn @@ -1,37 +1,27 @@ -[gd_scene load_steps=5 format=2] +[gd_scene load_steps=3 format=2] [ext_resource path="res://graphics/particles/blood.png" type="Texture" id=1] [sub_resource type="Curve" id=43] _data = [ Vector2( 0, 1 ), 0.0, -0.113537, 0, 0, Vector2( 1, 0 ), -3.35032, 0.0, 0, 0 ] -[sub_resource type="CurveTexture" id=42] -width = 128 -curve = SubResource( 43 ) - -[sub_resource type="ParticlesMaterial" id=44] -emission_shape = 2 -emission_box_extents = Vector3( 4, 4, 0 ) -flag_disable_z = true -direction = Vector3( 0, -1, 0 ) -spread = 180.0 -gravity = Vector3( 0, 50, 0 ) -initial_velocity = 60.0 -initial_velocity_random = 0.9 -orbit_velocity = 0.0 -orbit_velocity_random = 0.0 -damping = 2.0 -angle = 720.0 -angle_random = 1.0 -scale = 0.5 -scale_random = 1.0 -scale_curve = SubResource( 42 ) - -[node name="DeathSplatter" type="Particles2D"] +[node name="DeathSplatter" type="CPUParticles2D"] emitting = false lifetime = 0.2 one_shot = true explosiveness = 0.9 local_coords = false -process_material = SubResource( 44 ) texture = ExtResource( 1 ) +emission_shape = 2 +emission_rect_extents = Vector2( 4, 4 ) +direction = Vector2( 0, -1 ) +spread = 180.0 +gravity = Vector2( 0, 50 ) +initial_velocity = 60.0 +initial_velocity_random = 0.9 +damping = 2.0 +angle = 720.0 +angle_random = 1.0 +scale_amount = 0.5 +scale_amount_random = 1.0 +scale_amount_curve = SubResource( 43 ) diff --git a/objects/environment/turret/turret.tscn b/objects/environment/turret/turret.tscn index b8c1998..860be13 100644 --- a/objects/environment/turret/turret.tscn +++ b/objects/environment/turret/turret.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=21 format=2] +[gd_scene load_steps=19 format=2] [ext_resource path="res://objects/environment/turret/turret.gd" type="Script" id=1] [ext_resource path="res://graphics/enemy/turret.png" type="Texture" id=2] @@ -306,27 +306,6 @@ graph_offset = Vector2( -880, -243 ) [sub_resource type="Curve" id=15] _data = [ Vector2( 0, 1 ), 0.0, -2.23455, 0, 0, Vector2( 1, 0 ), 0.0, 0.0, 0, 0 ] -[sub_resource type="CurveTexture" id=16] -width = 32 -curve = SubResource( 15 ) - -[sub_resource type="ParticlesMaterial" id=17] -emission_shape = 2 -emission_box_extents = Vector3( 2, 0, 0 ) -flag_disable_z = true -direction = Vector3( 0, 1, 0 ) -spread = 60.0 -gravity = Vector3( 0, 0, 0 ) -initial_velocity = 50.0 -orbit_velocity = 0.0 -orbit_velocity_random = 0.0 -angle = 720.0 -angle_random = 1.0 -scale = 0.25 -scale_random = 0.5 -scale_curve = SubResource( 16 ) -color = Color( 1, 0.968627, 0.431373, 1 ) - [node name="Turret" type="Node2D"] script = ExtResource( 1 ) fire_rate = 20.0 @@ -365,10 +344,21 @@ __meta__ = { "_gizmo_extents_": 2.0 } -[node name="MuzzleFlash" type="Particles2D" parent="BarrelStart/BarrelEnd"] +[node name="MuzzleFlash" type="CPUParticles2D" parent="BarrelStart/BarrelEnd"] z_index = -1 emitting = false lifetime = 0.15 explosiveness = 0.5 -process_material = SubResource( 17 ) texture = ExtResource( 3 ) +emission_shape = 2 +emission_rect_extents = Vector2( 2, 0 ) +direction = Vector2( 0, 1 ) +spread = 60.0 +gravity = Vector2( 0, 0 ) +initial_velocity = 50.0 +angle = 720.0 +angle_random = 1.0 +scale_amount = 0.25 +scale_amount_random = 0.5 +scale_amount_curve = SubResource( 15 ) +color = Color( 1, 0.968627, 0.431373, 1 ) diff --git a/objects/player/arrow_projectile.gd b/objects/player/arrow_projectile.gd index bc945c5..d2fde6e 100644 --- a/objects/player/arrow_projectile.gd +++ b/objects/player/arrow_projectile.gd @@ -23,15 +23,6 @@ func _physics_process(delta): if Game.get_sector(global_position + cull_edge) != initial_sector: queue_free() -func _exit_tree(): - # make sure particles node sticks around until particles decay - var particles = $DustParticles - remove_child(particles) - particles.global_position = global_position - particles.emitting = false - get_parent().call_deferred("add_child", particles) - get_tree().create_timer(particles.lifetime, false).connect("timeout", particles, "queue_free") - #Wall Collision func _on_Hitbox_body_entered(body): if body is TileMap or body is StaticBody2D: @@ -59,6 +50,15 @@ func _on_Hitbox_area_entered(area): _make_sparks() queue_free() +func _exit_tree(): + # make sure particles node sticks around until particles decay + var particles = $DustParticles + remove_child(particles) + get_parent().add_child(particles) + particles.global_position = global_position + particles.emitting = false + get_tree().create_timer(particles.lifetime, false).connect("timeout", particles, "queue_free") + func _make_sparks(): var particles = $SparkParticles remove_child(particles) diff --git a/objects/player/arrow_projectile.tscn b/objects/player/arrow_projectile.tscn index dd624ab..54d3f9f 100644 --- a/objects/player/arrow_projectile.tscn +++ b/objects/player/arrow_projectile.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=13 format=2] +[gd_scene load_steps=9 format=2] [ext_resource path="res://scripts/1px_border.gdshader" type="Shader" id=1] [ext_resource path="res://graphics/player/arrow.png" type="Texture" id=2] @@ -13,50 +13,12 @@ shader_param/border_corners = true [sub_resource type="Curve" id=3] _data = [ Vector2( 0, 1 ), 0.0, -0.139481, 0, 0, Vector2( 1, 0 ), -2.82064, 0.0, 0, 0 ] -[sub_resource type="CurveTexture" id=4] -width = 32 -curve = SubResource( 3 ) - -[sub_resource type="ParticlesMaterial" id=5] -flag_disable_z = true -spread = 180.0 -gravity = Vector3( 0, 0, 0 ) -initial_velocity = 8.0 -initial_velocity_random = 0.18 -orbit_velocity = 0.0 -orbit_velocity_random = 0.0 -damping = 1.0 -angle = 720.0 -angle_random = 1.0 -scale = 0.25 -scale_random = 0.25 -scale_curve = SubResource( 4 ) - [sub_resource type="RectangleShape2D" id=2] extents = Vector2( 5.5, 3.5 ) [sub_resource type="Curve" id=6] _data = [ Vector2( 0, 1 ), 0.0, -1.45746, 0, 0, Vector2( 1, 0 ), 0.00323196, 0.0, 0, 0 ] -[sub_resource type="CurveTexture" id=7] -width = 32 -curve = SubResource( 6 ) - -[sub_resource type="ParticlesMaterial" id=8] -flag_disable_z = true -spread = 180.0 -gravity = Vector3( 0, 0, 0 ) -initial_velocity = 30.0 -initial_velocity_random = 0.5 -orbit_velocity = 0.0 -orbit_velocity_random = 0.0 -damping = 50.0 -angle = 720.0 -angle_random = 1.0 -scale = 0.3 -scale_curve = SubResource( 7 ) -color = Color( 1, 1, 0.290196, 1 ) - [node name="ArrowProjectile" type="Node2D"] script = ExtResource( 3 ) @@ -65,14 +27,23 @@ material = SubResource( 1 ) z_index = -1 texture = ExtResource( 2 ) -[node name="DustParticles" type="Particles2D" parent="."] +[node name="DustParticles" type="CPUParticles2D" parent="."] show_behind_parent = true position = Vector2( -4, 0 ) z_index = -1 amount = 24 local_coords = false -process_material = SubResource( 5 ) texture = ExtResource( 4 ) +spread = 180.0 +gravity = Vector2( 0, 0 ) +initial_velocity = 8.0 +initial_velocity_random = 0.18 +damping = 1.0 +angle = 720.0 +angle_random = 1.0 +scale_amount = 0.25 +scale_amount_random = 0.25 +scale_amount_curve = SubResource( 3 ) [node name="Hitbox" type="Area2D" parent="." groups=["arrow"]] @@ -80,15 +51,24 @@ texture = ExtResource( 4 ) position = Vector2( -0.5, -0.5 ) shape = SubResource( 2 ) -[node name="SparkParticles" type="Particles2D" parent="."] +[node name="SparkParticles" type="CPUParticles2D" parent="."] position = Vector2( 4, 0 ) emitting = false amount = 16 lifetime = 0.5 one_shot = true explosiveness = 1.0 -process_material = SubResource( 8 ) texture = ExtResource( 4 ) +spread = 180.0 +gravity = Vector2( 0, 0 ) +initial_velocity = 30.0 +initial_velocity_random = 0.5 +damping = 50.0 +angle = 720.0 +angle_random = 1.0 +scale_amount = 0.3 +scale_amount_curve = SubResource( 6 ) +color = Color( 1, 1, 0.290196, 1 ) [connection signal="area_entered" from="Hitbox" to="." method="_on_Hitbox_area_entered"] [connection signal="body_entered" from="Hitbox" to="." method="_on_Hitbox_body_entered"] diff --git a/objects/player/player.tscn b/objects/player/player.tscn index ada6f7b..267f8de 100644 --- a/objects/player/player.tscn +++ b/objects/player/player.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=36 format=2] +[gd_scene load_steps=32 format=2] [ext_resource path="res://objects/player/player.gd" type="Script" id=1] [ext_resource path="res://graphics/player/sg_walk.png" type="Texture" id=2] @@ -604,52 +604,9 @@ extents = Vector2( 6, 7 ) [sub_resource type="Curve" id=41] _data = [ Vector2( 0, 1 ), 0.0, -0.113537, 0, 0, Vector2( 1, 0 ), -3.35032, 0.0, 0, 0 ] -[sub_resource type="CurveTexture" id=42] -width = 128 -curve = SubResource( 41 ) - -[sub_resource type="ParticlesMaterial" id=40] -emission_shape = 2 -emission_box_extents = Vector3( 4, 4, 0 ) -flag_disable_z = true -direction = Vector3( 0, -1, 0 ) -spread = 180.0 -gravity = Vector3( 0, 50, 0 ) -initial_velocity = 60.0 -initial_velocity_random = 0.9 -orbit_velocity = 0.0 -orbit_velocity_random = 0.0 -damping = 2.0 -angle = 720.0 -angle_random = 1.0 -scale = 0.5 -scale_random = 1.0 -scale_curve = SubResource( 42 ) - [sub_resource type="Curve" id=43] _data = [ Vector2( 0, 1 ), 0.0, -0.0636948, 0, 0, Vector2( 1, 0 ), -3.43886, 0.0, 0, 0 ] -[sub_resource type="CurveTexture" id=44] -width = 32 -curve = SubResource( 43 ) - -[sub_resource type="ParticlesMaterial" id=45] -emission_shape = 2 -emission_box_extents = Vector3( 5, 0, 0 ) -flag_disable_z = true -direction = Vector3( 0, -1, 0 ) -spread = 60.0 -gravity = Vector3( 0, 0, 0 ) -initial_velocity = 10.0 -initial_velocity_random = 0.8 -orbit_velocity = 0.0 -orbit_velocity_random = 0.0 -angle = 720.0 -angle_random = 1.0 -scale = 0.25 -scale_random = 0.5 -scale_curve = SubResource( 44 ) - [node name="Player" type="KinematicBody2D"] collision_layer = 2 collision_mask = 5 @@ -706,7 +663,7 @@ position = Vector2( 0, 3 ) shape = SubResource( 34 ) disabled = true -[node name="DeathSplatter" type="Particles2D" parent="."] +[node name="DeathSplatter" type="CPUParticles2D" parent="."] pause_mode = 2 emitting = false amount = 16 @@ -714,10 +671,22 @@ lifetime = 0.3 one_shot = true explosiveness = 0.9 local_coords = false -process_material = SubResource( 40 ) texture = ExtResource( 15 ) +emission_shape = 2 +emission_rect_extents = Vector2( 4, 4 ) +direction = Vector2( 0, -1 ) +spread = 180.0 +gravity = Vector2( 0, 50 ) +initial_velocity = 60.0 +initial_velocity_random = 0.9 +damping = 2.0 +angle = 720.0 +angle_random = 1.0 +scale_amount = 0.5 +scale_amount_random = 1.0 +scale_amount_curve = SubResource( 41 ) -[node name="DustParticles" type="Particles2D" parent="."] +[node name="DustParticles" type="CPUParticles2D" parent="."] position = Vector2( 0, 12 ) z_index = 1 emitting = false @@ -727,8 +696,19 @@ one_shot = true explosiveness = 0.9 fract_delta = false local_coords = false -process_material = SubResource( 45 ) texture = ExtResource( 16 ) +emission_shape = 2 +emission_rect_extents = Vector2( 5, 0 ) +direction = Vector2( 0, -1 ) +spread = 60.0 +gravity = Vector2( 0, 0 ) +initial_velocity = 10.0 +initial_velocity_random = 0.8 +angle = 720.0 +angle_random = 1.0 +scale_amount = 0.25 +scale_amount_random = 0.5 +scale_amount_curve = SubResource( 43 ) [connection signal="animation_finished" from="AnimationPlayer" to="." method="_on_AnimationPlayer_animation_finished"] [connection signal="area_entered" from="SwordArea" to="." method="_on_SwordArea_area_entered"] diff --git a/project.godot b/project.godot index f8ef003..163a7ea 100644 --- a/project.godot +++ b/project.godot @@ -152,5 +152,6 @@ common/enable_pause_aware_picking=true [rendering] +quality/driver/driver_name="GLES2" 2d/snapping/use_gpu_pixel_snap=true environment/default_environment="res://default_env.tres"