After imagees

This commit is contained in:
Bingus_Violet 2024-02-29 10:38:22 -06:00
parent 421220e763
commit 279b5e5599
8 changed files with 91 additions and 35 deletions

View file

@ -3,7 +3,7 @@ extends Node2D
@onready var player = $"../../"
@onready var sprite = $"../"
@onready var grappleCore = $"../GrappleCore"
@onready var grappleCore = $"GrappleCore"
@onready var Smoother = $"../../../Smoother"
@ -63,6 +63,8 @@ func _physics_process(delta):
if player.is_on_floor():
grapples = 2
#$"parti".emitting = grappling
if Input.is_action_just_pressed("pullGrapple") and not proj and grapples:
grapples -= 1
@ -70,23 +72,25 @@ func _physics_process(delta):
proj.position = player.position
proj.rotation = moveVector.angle()
proj.modulate = Color8(0, 255, 0)
modulate = Color8(0, 255, 0)
proj.modulate = modulate
proj.velocity = (moveVector * 1500) + player.velocity
proj.velocity = (moveVector * 1000) + player.velocity
#grappleDur = 10
add_child(proj)
var parti = grappleShootParti.instantiate()
parti.rotation = proj.rotation
parti.position = proj.position
parti.process_material.initial_velocity_min = (proj.velocity.length() + player.velocity.length()) / 6
add_child(parti)
#var parti = grappleShootParti.instantiate()
#parti.rotation = proj.rotation
#parti.position = proj.position
#parti.process_material.initial_velocity_min = (proj.velocity.length() + player.velocity.length()) / 6
#add_child(parti)
#else:
if proj and grappleDur > 0 and (player.position - proj.position).length() > 15 and not Input.is_action_just_pressed("jump"):
launch(delta)
elif proj and grappling:
player.jumps += 1
player.jumps = player.MAX_JUMPS
player.falling = false
#player.velocity.y = player.JUMP_VELOCITY
grappleDur = 0
@ -103,10 +107,10 @@ func _process(delta):
projData.retractDur += delta * 4 / ((projData.retractStart - player.position).length() / 300)
renderLine(proj)
if projData.retractDur >= 1:
var parti = proj.get_node("parti")
parti.emitting = false
parti.modulate = proj.modulate
parti.reparent(player)
if proj.find_child("parti"):
var parti = proj.get_node("parti")
parti.emitting = false
parti.reparent(self)
proj.queue_free()
proj = null
retractDur = 0

View file

@ -21,7 +21,8 @@ func _physics_process(delta):
move_and_slide()
$"parti".emitting = (lastPos - position).length() > 0
if find_child("parti"):
$"parti".emitting = (lastPos - position).length() > 0
if detecting:
if lifeTime <= 0:
@ -40,4 +41,5 @@ func _physics_process(delta):
detecting = false
position = result.position
objectHit(result.collider)
lastPos = position

View file

@ -8,21 +8,23 @@
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), -2.51429, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_f4r8k"]
[sub_resource type="CurveTexture" id="CurveTexture_h7vvv"]
curve = SubResource("Curve_qnwwb")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_tkwr2"]
particle_flag_align_y = true
particle_flag_disable_z = true
inherit_velocity_ratio = 0.1
inherit_velocity_ratio = -0.1
direction = Vector3(0, 1, 0)
spread = 180.0
flatness = 1.0
initial_velocity_min = 50.0
initial_velocity_max = 50.0
gravity = Vector3(0, 0, 0)
damping_min = 50.0
damping_max = 50.0
scale_max = 2.0
scale_curve = SubResource("CurveTexture_f4r8k")
scale_curve = SubResource("CurveTexture_h7vvv")
[node name="GrappleHook" type="CharacterBody2D"]
top_level = true
@ -39,7 +41,7 @@ texture = ExtResource("2_sst4t")
[node name="GrappleLine" type="Line2D" parent="."]
top_level = true
z_index = 1
z_index = 2
texture_repeat = 2
points = PackedVector2Array(0, 0, 33, 0)
width = 4.0
@ -53,6 +55,7 @@ round_precision = 4
[node name="GrappleBord" type="Line2D" parent="."]
modulate = Color(0, 0, 0, 1)
top_level = true
z_index = 1
texture_repeat = 2
points = PackedVector2Array(0, 0, 33, 0)
width = 6.0
@ -63,7 +66,7 @@ end_cap_mode = 2
round_precision = 4
[node name="parti" type="GPUParticles2D" parent="."]
amount = 100
amount = 200
process_material = SubResource("ParticleProcessMaterial_tkwr2")
lifetime = 2.0
fixed_fps = 0