fun
This commit is contained in:
parent
5cfdd34e96
commit
13ccecad19
25 changed files with 730 additions and 53 deletions
BIN
Player/GrappleHook/GrappleHookProjectile/Grapple.png
Normal file
BIN
Player/GrappleHook/GrappleHookProjectile/Grapple.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 164 B |
34
Player/GrappleHook/GrappleHookProjectile/Grapple.png.import
Normal file
34
Player/GrappleHook/GrappleHookProjectile/Grapple.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bncu47o5ynskj"
|
||||
path="res://.godot/imported/Grapple.png-feaba7449a5f3ea3aa251c5a08ccef36.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Player/GrappleHook/GrappleHookProjectile/Grapple.png"
|
||||
dest_files=["res://.godot/imported/Grapple.png-feaba7449a5f3ea3aa251c5a08ccef36.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
|
@ -0,0 +1,37 @@
|
|||
extends CharacterBody2D
|
||||
|
||||
var lifeTime = 0.6
|
||||
|
||||
@onready var parent = get_parent()
|
||||
|
||||
var lastPos = null
|
||||
|
||||
var detecting = true
|
||||
|
||||
func objectHit(body):
|
||||
if body != self:
|
||||
velocity = Vector2.ZERO
|
||||
parent.grappleStart()
|
||||
|
||||
func _physics_process(delta):
|
||||
if not lastPos:
|
||||
lastPos = position
|
||||
|
||||
move_and_slide()
|
||||
|
||||
if detecting:
|
||||
if lifeTime <= 0:
|
||||
velocity = Vector2.ZERO
|
||||
parent.retracting = true
|
||||
parent.retractStart = position
|
||||
lifeTime -= delta
|
||||
var space_state = get_world_2d().direct_space_state
|
||||
|
||||
var query = PhysicsRayQueryParameters2D.create(lastPos, position, 3, [parent.get_parent().get_parent()])
|
||||
var result = space_state.intersect_ray(query)
|
||||
|
||||
if result:
|
||||
detecting = false
|
||||
position = result.position
|
||||
objectHit(result.collider)
|
||||
print(result.position)
|
|
@ -0,0 +1,43 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://dmgf8fsvy1wjh"]
|
||||
|
||||
[ext_resource type="Script" path="res://Player/GrappleHook/GrappleHookProjectile/GrappleHookProjectile.gd" id="1_nba88"]
|
||||
[ext_resource type="Texture2D" uid="uid://bncu47o5ynskj" path="res://Player/GrappleHook/GrappleHookProjectile/Grapple.png" id="2_sst4t"]
|
||||
[ext_resource type="Texture2D" uid="uid://gn347ng3iu02" path="res://Player/GrappleHook/GrappleHookProjectile/GrappleTether.png" id="2_xkdsl"]
|
||||
|
||||
[node name="GrappleHook" type="CharacterBody2D"]
|
||||
top_level = true
|
||||
disable_mode = 2
|
||||
collision_layer = 4
|
||||
collision_mask = 0
|
||||
motion_mode = 1
|
||||
platform_floor_layers = 4294967040
|
||||
script = ExtResource("1_nba88")
|
||||
|
||||
[node name="Sprite" type="Sprite2D" parent="."]
|
||||
z_index = 2
|
||||
texture = ExtResource("2_sst4t")
|
||||
|
||||
[node name="GrappleLine" type="Line2D" parent="."]
|
||||
top_level = true
|
||||
z_index = 1
|
||||
texture_repeat = 2
|
||||
points = PackedVector2Array(0, 0, 33, 0)
|
||||
width = 4.0
|
||||
texture = ExtResource("2_xkdsl")
|
||||
texture_mode = 1
|
||||
joint_mode = 2
|
||||
begin_cap_mode = 2
|
||||
end_cap_mode = 2
|
||||
round_precision = 4
|
||||
|
||||
[node name="GrappleBord" type="Line2D" parent="."]
|
||||
modulate = Color(0, 0, 0, 1)
|
||||
top_level = true
|
||||
texture_repeat = 2
|
||||
points = PackedVector2Array(0, 0, 33, 0)
|
||||
width = 6.0
|
||||
texture_mode = 1
|
||||
joint_mode = 2
|
||||
begin_cap_mode = 2
|
||||
end_cap_mode = 2
|
||||
round_precision = 4
|
BIN
Player/GrappleHook/GrappleHookProjectile/GrappleTether.kra
Normal file
BIN
Player/GrappleHook/GrappleHookProjectile/GrappleTether.kra
Normal file
Binary file not shown.
BIN
Player/GrappleHook/GrappleHookProjectile/GrappleTether.png
Normal file
BIN
Player/GrappleHook/GrappleHookProjectile/GrappleTether.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 133 B |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://gn347ng3iu02"
|
||||
path="res://.godot/imported/GrappleTether.png-070f72f0eebbe08ec00dac245679c61b.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Player/GrappleHook/GrappleHookProjectile/GrappleTether.png"
|
||||
dest_files=["res://.godot/imported/GrappleTether.png-070f72f0eebbe08ec00dac245679c61b.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
BIN
Player/GrappleHook/GrappleHookProjectile/GrappleTether.png~
Normal file
BIN
Player/GrappleHook/GrappleHookProjectile/GrappleTether.png~
Normal file
Binary file not shown.
After Width: | Height: | Size: 143 B |
Loading…
Add table
Add a link
Reference in a new issue