feat: Leash art, hitbox fixes, faster grass, level tweaks
This commit is contained in:
parent
76a13a83dc
commit
79f674dea3
BIN
assets/enemy/leash-hook.aseprite
Normal file
BIN
assets/enemy/leash-hook.aseprite
Normal file
Binary file not shown.
BIN
assets/enemy/leash-hook.png
Normal file
BIN
assets/enemy/leash-hook.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 139 B |
35
assets/enemy/leash-hook.png.import
Normal file
35
assets/enemy/leash-hook.png.import
Normal file
@ -0,0 +1,35 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/leash-hook.png-dab8eda69ebe5d315e7048d7976e56e1.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/enemy/leash-hook.png"
|
||||
dest_files=[ "res://.import/leash-hook.png-dab8eda69ebe5d315e7048d7976e56e1.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=false
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
||||
@ -201,7 +201,6 @@ common/enable_object_picking=false
|
||||
|
||||
[rendering]
|
||||
|
||||
2d/options/use_nvidia_rect_flicker_workaround=true
|
||||
quality/intended_usage/framebuffer_allocation=0
|
||||
quality/intended_usage/framebuffer_allocation.mobile=0
|
||||
2d/snapping/use_gpu_pixel_snap=true
|
||||
|
||||
@ -3283,7 +3283,7 @@ tracks/6/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( 1.0034, -8.97473 ) ]
|
||||
"values": [ Vector2( 1.0, -8.97473 ) ]
|
||||
}
|
||||
tracks/7/type = "value"
|
||||
tracks/7/path = NodePath("../BlobbySkin/CollisionPolygon2D:shape:extents")
|
||||
@ -3307,7 +3307,7 @@ tracks/8/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( 1.0034, -8.97473 ) ]
|
||||
"values": [ Vector2( 1.0, -8.97473 ) ]
|
||||
}
|
||||
tracks/9/type = "value"
|
||||
tracks/9/path = NodePath(".:offset")
|
||||
@ -4236,10 +4236,10 @@ parameters/idling/blend_position = 1.0
|
||||
parameters/jumpToFall/blend_position = 1.0
|
||||
parameters/jumping/blend_position = 1.0
|
||||
parameters/runToJump/blend_position = 1.0
|
||||
parameters/running/blend_position = 1.00239
|
||||
parameters/running/blend_position = 1.0
|
||||
parameters/turnToRun/blend_position = 1.0
|
||||
parameters/walking/blend_position = 1.0
|
||||
parameters/wallslideToJump/blend_position = 0.998613
|
||||
parameters/wallslideToJump/blend_position = 1.0
|
||||
parameters/wallsliding/blend_position = 1.0
|
||||
|
||||
[node name="BlobbymationPlayer" type="AnimationPlayer" parent="BlobbySprite"]
|
||||
|
||||
@ -5,5 +5,5 @@
|
||||
[resource]
|
||||
shader = ExtResource( 1 )
|
||||
shader_param/sensitivity = 0.0
|
||||
shader_param/w_sens = 1.007
|
||||
shader_param/w_sens = 1.0
|
||||
shader_param/scale = 1.0
|
||||
|
||||
@ -65,10 +65,11 @@ func _process(delta: float) -> void:
|
||||
screen_top = screen_center - Vector2(0, screen_rect.y/2)
|
||||
screen_left = screen_center - Vector2(screen_rect.x/2, 0)
|
||||
screen_right = screen_center + Vector2(screen_rect.x/2, 0)
|
||||
var was_adjusted := false
|
||||
if(!levelState.is_dead):
|
||||
_adjust_offset(delta)
|
||||
was_adjusted = _adjust_offset(delta)
|
||||
|
||||
if(anim_player.is_playing()):
|
||||
if(anim_player.is_playing() || was_adjusted):
|
||||
position = blobby.position
|
||||
prev_pos = position
|
||||
_update_lighting_shader()
|
||||
@ -178,15 +179,15 @@ func _adapt_to_input(velocity: Vector2) -> void:
|
||||
|
||||
# TODO This is a regulatory problem, it doesn't adapt fast enough
|
||||
# TODO Maybe just make background black and dont bother
|
||||
func _adjust_offset(delta: float) -> void:
|
||||
func _adjust_offset(delta: float) -> bool:
|
||||
var new_offset = offset
|
||||
if (limit_left - position.x - screen_left.x > 0.1):
|
||||
if (anim_player.is_playing()):
|
||||
anim_player.stop(false)
|
||||
anim_player.stop(true)
|
||||
new_offset.x += (limit_left - position.x - screen_left.x)/2
|
||||
if (limit_right - position.x - screen_right.x < 0.1):
|
||||
if (anim_player.is_playing()):
|
||||
anim_player.stop(false)
|
||||
anim_player.stop(true)
|
||||
new_offset.x += (limit_right - position.x - screen_right.x)/2
|
||||
if (limit_top - position.y - screen_top.y > 0.001):
|
||||
new_offset.y += (limit_top - position.y - screen_top.y)/2
|
||||
@ -194,6 +195,9 @@ func _adjust_offset(delta: float) -> void:
|
||||
new_offset.y += (limit_bottom - position.y - screen_bottom.y)/2
|
||||
if(abs(offset.x) >= abs(new_offset.x) + 1):
|
||||
offset = new_offset
|
||||
return true
|
||||
else:
|
||||
return false
|
||||
|
||||
|
||||
func reset_limits() -> void:
|
||||
|
||||
@ -56,6 +56,7 @@ func disconnect_rope() -> void:
|
||||
func _on_FrogFreeButton_pushed() -> void:
|
||||
$WhatAreFrog.levelState.frees += 1
|
||||
$WhatAreFrog.is_bound = false
|
||||
$WhatAreFrog/LeashAnchor.visible = false
|
||||
$WhatAreFrog.remove_from_group("harmful")
|
||||
disconnect_rope()
|
||||
is_first_signal = false
|
||||
|
||||
@ -14,7 +14,6 @@ position = Vector2( 0, 1 )
|
||||
|
||||
[node name="RopeAnchor" parent="." instance=ExtResource( 2 )]
|
||||
position = Vector2( -80, 6 )
|
||||
scale = Vector2( 1.00167, 1 )
|
||||
|
||||
[connection signal="child_exiting_tree" from="WhatAreFrog" to="." method="_on_WhatAreFrog_child_exiting_tree"]
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
[ext_resource path="res://src/Actors/Enemies/Beings/Caterpillar.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 2.64025, 1.15615 )
|
||||
extents = Vector2( 14.7108, 7.85442 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=2]
|
||||
extents = Vector2( 15, 6 )
|
||||
@ -31,8 +31,8 @@ process_parent = true
|
||||
physics_process_parent = true
|
||||
|
||||
[node name="EnemyBody" type="CollisionShape2D" parent="."]
|
||||
position = Vector2( 6.70552e-07, 6.11815 )
|
||||
scale = Vector2( 5.68128, 5.29182 )
|
||||
position = Vector2( -6.37697e-07, 4.36357 )
|
||||
scale = Vector2( 1, 1 )
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="SlopeRaycastLeft" type="RayCast2D" parent="."]
|
||||
@ -78,7 +78,6 @@ collision_mask = 126
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionShape2D" parent="EnemySkin"]
|
||||
position = Vector2( -5.54991e-05, 0 )
|
||||
scale = Vector2( 1.03, 1.04 )
|
||||
shape = SubResource( 3 )
|
||||
|
||||
[connection signal="body_entered" from="StompDetector" to="." method="_on_StompDetector_body_entered"]
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
[ext_resource path="res://src/Actors/Enemies/Beings/DartingEnemy.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 2.72463, 1.43961 )
|
||||
extents = Vector2( 15, 7.5 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=2]
|
||||
extents = Vector2( 15, 4.51505 )
|
||||
@ -30,8 +30,7 @@ process_parent = true
|
||||
physics_process_parent = true
|
||||
|
||||
[node name="EnemyBody" type="CollisionShape2D" parent="." groups=["harmful"]]
|
||||
position = Vector2( 0, 4.61815 )
|
||||
scale = Vector2( 5.68128, 5.29182 )
|
||||
position = Vector2( -4.76837e-07, 4.5 )
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="StompDetector" type="Area2D" parent="." groups=["weakpoint"]]
|
||||
@ -69,7 +68,6 @@ collision_mask = 126
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionShape2D" parent="EnemySkin"]
|
||||
position = Vector2( -8.07794e-28, 1.5 )
|
||||
scale = Vector2( 1.03, 1.04 )
|
||||
shape = SubResource( 3 )
|
||||
|
||||
[connection signal="body_entered" from="StompDetector" to="." method="_on_StompDetector_body_entered"]
|
||||
|
||||
@ -184,7 +184,7 @@ graph_offset = Vector2( -333, -104 )
|
||||
[sub_resource type="AnimationNodeStateMachinePlayback" id=51]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 11, 9 )
|
||||
extents = Vector2( 10, 7.5 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=2]
|
||||
extents = Vector2( 15, 5.12039 )
|
||||
@ -256,7 +256,7 @@ collision_mask = 56
|
||||
collide_with_areas = true
|
||||
|
||||
[node name="EnemyBody" type="CollisionShape2D" parent="." groups=["harmful"]]
|
||||
visible = false
|
||||
position = Vector2( 0, -0.5 )
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="NavigationAgent2D" type="NavigationAgent2D" parent="."]
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
[ext_resource path="res://src/Actors/Enemies/Beings/SimpleEnemy.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 2.72463, 1.17848 )
|
||||
extents = Vector2( 15, 7.5 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=2]
|
||||
extents = Vector2( 15.4794, 6.68174 )
|
||||
@ -30,8 +30,7 @@ process_parent = true
|
||||
physics_process_parent = true
|
||||
|
||||
[node name="EnemyBody" type="CollisionShape2D" parent="." groups=["harmful"]]
|
||||
position = Vector2( 0, 6.48802 )
|
||||
scale = Vector2( 5.68128, 5.29182 )
|
||||
position = Vector2( -4.76837e-07, 4.5 )
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="StompDetector" type="Area2D" parent="." groups=["weakpoint"]]
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
[ext_resource path="res://src/Actors/Enemies/Beings/SmortEnemy.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 2.64025, 1.38585 )
|
||||
extents = Vector2( 15, 7.5 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=2]
|
||||
extents = Vector2( 15, 4.5301 )
|
||||
@ -30,8 +30,7 @@ process_parent = true
|
||||
physics_process_parent = true
|
||||
|
||||
[node name="EnemyBody" type="CollisionShape2D" parent="." groups=["harmful"]]
|
||||
position = Vector2( -6.85453e-07, 5.42069 )
|
||||
scale = Vector2( 5.56089, 5.35462 )
|
||||
position = Vector2( 0, 4.5 )
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="StompDetector" type="Area2D" parent="." groups=["weakpoint"]]
|
||||
|
||||
@ -60,13 +60,16 @@ func _ready():
|
||||
target_lost_timer.connect("timeout", self, "loose_target")
|
||||
add_child(jump_timer)
|
||||
add_child(target_lost_timer)
|
||||
if(is_bound): add_to_group("harmful")
|
||||
# TODO Stays harmless for now
|
||||
#if(is_bound): add_to_group("harmful")
|
||||
$LeashAnchor.visible = is_bound
|
||||
|
||||
|
||||
func bind_to_anchor(anchor_node: Node2D, radius: float ) -> void:
|
||||
anchor = anchor_node
|
||||
movement_radius = radius * 24
|
||||
is_bound = true
|
||||
$LeashAnchor.visible = true
|
||||
|
||||
|
||||
func _on_StompDetector_body_entered(body: Node) -> void:
|
||||
@ -497,9 +500,8 @@ func check_feeler(v: Vector2, _offset = Vector2(0,0)) -> Object:
|
||||
|
||||
func reverse_facing_direction() -> void:
|
||||
has_reversed = true
|
||||
print("reversing direction")
|
||||
# print("reversing direction")
|
||||
orientation.cast_to.x *= -1
|
||||
pass
|
||||
|
||||
|
||||
func get_facing_direction() -> float:
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
[gd_scene load_steps=47 format=2]
|
||||
[gd_scene load_steps=48 format=2]
|
||||
|
||||
[ext_resource path="res://assets/enemy/froshler.png" type="Texture" id=1]
|
||||
[ext_resource path="res://src/Actors/Enemies/Beings/WhatAreFrog.gd" type="Script" id=2]
|
||||
[ext_resource path="res://src/Actors/Enemies/Beings/WhatAreFrogStateMachine.gd" type="Script" id=3]
|
||||
[ext_resource path="res://assets/meta/new_dynamicfont.tres" type="DynamicFont" id=4]
|
||||
[ext_resource path="res://assets/meta/digits.png" type="Texture" id=5]
|
||||
[ext_resource path="res://assets/enemy/leash-hook.png" type="Texture" id=6]
|
||||
|
||||
[sub_resource type="Animation" id=5]
|
||||
length = 0.001
|
||||
@ -407,18 +408,18 @@ auto_advance = true
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachine" id=10]
|
||||
states/idleHappy/node = SubResource( 9 )
|
||||
states/idleHappy/position = Vector2( -54, 98 )
|
||||
states/idleHappy/position = Vector2( -58.7619, 98.0433 )
|
||||
states/idleMean/node = SubResource( 20 )
|
||||
states/idleMean/position = Vector2( 451, 98 )
|
||||
states/idleMean/position = Vector2( 451.952, 98.0432 )
|
||||
states/liftOff/node = SubResource( 23 )
|
||||
states/liftOff/position = Vector2( 184, -12 )
|
||||
states/midJumping/node = SubResource( 26 )
|
||||
states/midJumping/position = Vector2( 184, -141 )
|
||||
states/midJumping/position = Vector2( 184.091, -141 )
|
||||
states/sleeping/node = SubResource( 54 )
|
||||
states/sleeping/position = Vector2( 176.896, 205.619 )
|
||||
transitions = [ "idleHappy", "liftOff", SubResource( 27 ), "liftOff", "midJumping", SubResource( 28 ), "idleMean", "liftOff", SubResource( 29 ), "midJumping", "liftOff", SubResource( 30 ), "liftOff", "idleMean", SubResource( 31 ), "liftOff", "idleHappy", SubResource( 32 ), "idleHappy", "sleeping", SubResource( 55 ), "idleMean", "sleeping", SubResource( 56 ), "sleeping", "idleHappy", SubResource( 57 ), "sleeping", "idleMean", SubResource( 58 ) ]
|
||||
start_node = "idleHappy"
|
||||
graph_offset = Vector2( -340, -193 )
|
||||
graph_offset = Vector2( -375, -158 )
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachinePlayback" id=11]
|
||||
|
||||
@ -426,7 +427,7 @@ graph_offset = Vector2( -340, -193 )
|
||||
extents = Vector2( 12, 9 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=2]
|
||||
extents = Vector2( 15.7143, 2.14286 )
|
||||
extents = Vector2( 12, 1.5 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=3]
|
||||
extents = Vector2( 18.2143, 13.5955 )
|
||||
@ -460,6 +461,12 @@ z_index = 1
|
||||
texture = ExtResource( 5 )
|
||||
hframes = 10
|
||||
|
||||
[node name="LeashAnchor" type="Sprite" parent="."]
|
||||
position = Vector2( 0, 2 )
|
||||
rotation = 3.92699
|
||||
z_index = 2
|
||||
texture = ExtResource( 6 )
|
||||
|
||||
[node name="FrogSprite" type="Sprite" parent="."]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2( 0, -7 )
|
||||
@ -487,7 +494,7 @@ active = true
|
||||
root_motion_track = NodePath(".:frame")
|
||||
parameters/playback = SubResource( 11 )
|
||||
parameters/idleHappy/blend_position = 1.0
|
||||
parameters/idleMean/blend_position = 0.999614
|
||||
parameters/idleMean/blend_position = 1.0
|
||||
parameters/liftOff/blend_position = 1.0
|
||||
parameters/midJumping/blend_position = 1.0
|
||||
parameters/sleeping/blend_position = 1.0
|
||||
@ -506,7 +513,6 @@ collision_mask = 280
|
||||
collide_with_areas = true
|
||||
|
||||
[node name="Orientation" type="RayCast2D" parent="."]
|
||||
visible = false
|
||||
cast_to = Vector2( -1, 0 )
|
||||
collision_mask = 0
|
||||
collide_with_bodies = false
|
||||
@ -526,17 +532,15 @@ collision_mask = 40
|
||||
collide_with_areas = true
|
||||
|
||||
[node name="VisionRayCast" type="RayCast2D" parent="."]
|
||||
visible = false
|
||||
enabled = true
|
||||
cast_to = Vector2( 0, -1 )
|
||||
collision_mask = 297
|
||||
collide_with_areas = true
|
||||
|
||||
[node name="EnemyBody" type="CollisionShape2D" parent="." groups=["harmful"]]
|
||||
[node name="EnemyBody" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="cshape" type="Node2D" parent="."]
|
||||
position = Vector2( 0, -3.8147e-06 )
|
||||
scale = Vector2( 0.1, 0.1 )
|
||||
|
||||
[node name="pjoint" type="PinJoint2D" parent="cshape"]
|
||||
@ -547,14 +551,12 @@ softness = 0.1
|
||||
[node name="StompDetector" type="Area2D" parent="." groups=["weakpoint"]]
|
||||
modulate = Color( 0, 0.0392157, 1, 1 )
|
||||
position = Vector2( 0, -10 )
|
||||
scale = Vector2( 0.7, 0.7 )
|
||||
collision_layer = 2
|
||||
input_pickable = false
|
||||
monitorable = false
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="StompDetector"]
|
||||
position = Vector2( -5.68434e-14, -2.14286 )
|
||||
scale = Vector2( 0.999999, 0.999999 )
|
||||
position = Vector2( 0, -1 )
|
||||
shape = SubResource( 2 )
|
||||
|
||||
[node name="EnemySkin" type="Area2D" parent="."]
|
||||
|
||||
@ -63,6 +63,8 @@ func _animation_logic():
|
||||
|
||||
func _set_blendspaces_direction():
|
||||
var value = parent.get_facing_direction()
|
||||
# var leash_orientation := sign($"../LeashAnchor".position.x)
|
||||
# $"../LeashAnchor".position.x *= -1 if leash_orientation == value else 1
|
||||
anim_tree.set("parameters/idleHappy/blend_position", value)
|
||||
anim_tree.set("parameters/idleMean/blend_position", value)
|
||||
anim_tree.set("parameters/liftOff/blend_position", value)
|
||||
|
||||
@ -17,7 +17,7 @@ var movement_radius := 1.0
|
||||
|
||||
export var rope_tightness := 0.5
|
||||
|
||||
func _physics_process(_delta: float) -> void:
|
||||
func _process(_delta: float) -> void:
|
||||
# TODO Resize or reinitialize?
|
||||
rope_piece_positions.resize(0)
|
||||
rope_piece_positions = get_piece_positions()
|
||||
@ -41,6 +41,9 @@ func spawn_rope(start_pos: Vector2, end_pos: Vector2, m_radius: float = 100, new
|
||||
anchor_distance = start_pos.distance_to(mock_end_pos)
|
||||
var pieces_amount = round(anchor_distance / piece_length)
|
||||
var spawn_angle = (mock_end_pos-start_pos).angle() - PI/2
|
||||
print(pieces_amount)
|
||||
print(mock_end_pos)
|
||||
print(spawn_angle)
|
||||
create_rope(pieces_amount, rope_start, mock_end_pos, spawn_angle)
|
||||
rope_end.global_position = end_pos
|
||||
|
||||
@ -74,12 +77,10 @@ func add_piece(prev_piece: Object, id: int, spawn_angle:float) -> Object:
|
||||
|
||||
func get_piece_positions() -> Array:
|
||||
var rope_points := []
|
||||
|
||||
rope_points.append(rope_start_joint.global_position)
|
||||
for p in rope_pieces:
|
||||
rope_points.append(p.global_position)
|
||||
rope_points.append(rope_end_joint.global_position)
|
||||
|
||||
return rope_points
|
||||
|
||||
func _draw() -> void:
|
||||
|
||||
@ -3,5 +3,5 @@
|
||||
[ext_resource path="res://src/Contraptions/Rope/Rope.gd" type="Script" id=1]
|
||||
|
||||
[node name="Rope" type="Node2D"]
|
||||
z_index = -1
|
||||
z_index = 1
|
||||
script = ExtResource( 1 )
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://assets/enemy/laserpoint.png" type="Texture" id=1]
|
||||
[ext_resource path="res://assets/enemy/leash-hook.png" type="Texture" id=1]
|
||||
|
||||
[sub_resource type="CircleShape2D" id=5]
|
||||
radius = 2.0
|
||||
|
||||
[node name="RopeAnchor" type="RigidBody2D"]
|
||||
z_index = -1
|
||||
z_index = 1
|
||||
collision_layer = 0
|
||||
collision_mask = 8
|
||||
input_pickable = true
|
||||
@ -25,5 +25,6 @@ bias = 0.1
|
||||
softness = 0.1
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
scale = Vector2( 0.25, 0.245353 )
|
||||
rotation = 0.785398
|
||||
z_index = 1
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
@ -7,6 +7,7 @@ radius = 1.0
|
||||
height = 1.0
|
||||
|
||||
[node name="RigidBody2D" type="RigidBody2D"]
|
||||
z_index = 1
|
||||
collision_layer = 0
|
||||
collision_mask = 8
|
||||
gravity_scale = 3.0
|
||||
|
||||
@ -10,6 +10,7 @@ var radius = 15
|
||||
export var v_radius = 15
|
||||
export var draft_radius = 20
|
||||
export var interact_power = 0.04
|
||||
export var fps_limit := 30
|
||||
var rand = rand_range(1,1.3)
|
||||
var displacement_coeff: Vector2 = Vector2(1.0,0)
|
||||
var saved_displacement
|
||||
@ -17,17 +18,29 @@ var is_idle_swinging
|
||||
var start_swing_time := 0.0
|
||||
var begin_idle
|
||||
var time_since_last_exec := 0.0
|
||||
var fps_limit := 30.0
|
||||
# var thread : Thread
|
||||
|
||||
func _ready():
|
||||
# TODO This could probably fuck something up later? For other randomness based events
|
||||
randomize()
|
||||
# thread = Thread.new()
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
# TODO This should be in the settings and applied to all shaders
|
||||
time_since_last_exec += delta
|
||||
# if thread.is_alive():
|
||||
# print("was_running")
|
||||
# return
|
||||
# if thread.is_active():
|
||||
# thread.wait_to_finish()
|
||||
if time_since_last_exec <= 1.0/fps_limit:
|
||||
return
|
||||
# thread.start(self, "grass_wave_update", delta)
|
||||
grass_wave_update(delta)
|
||||
|
||||
|
||||
func grass_wave_update(delta: float) -> void:
|
||||
time_since_last_exec = 0.0
|
||||
var distance: float = abs(global_position.x - blobby.global_position.x + 6)
|
||||
var v_distance: float = abs(global_position.y - blobby.global_position.y + 11)
|
||||
@ -79,6 +92,7 @@ func _process(delta: float) -> void:
|
||||
for polygon in get_children():
|
||||
if polygon is Polygon2D:
|
||||
polygon.material.set_shader_param("displacement_coefficient_x", displacement_coeff.x)
|
||||
break
|
||||
|
||||
last_distance = Vector2(distance, v_distance)
|
||||
time += delta
|
||||
|
||||
@ -1,55 +1,20 @@
|
||||
[gd_scene load_steps=16 format=2]
|
||||
[gd_scene load_steps=9 format=2]
|
||||
|
||||
[ext_resource path="res://assets/environment/decor/straight_straw.png" type="Texture" id=1]
|
||||
[ext_resource path="res://src/Environment/ShaderGrass.gd" type="Script" id=2]
|
||||
[ext_resource path="res://src/Environment/ShaderGrassMaterial.tres" type="Material" id=3]
|
||||
[ext_resource path="res://assets/environment/decor/short_straw.png" type="Texture" id=4]
|
||||
[ext_resource path="res://assets/environment/decor/bent_straw.png" type="Texture" id=5]
|
||||
[ext_resource path="res://assets/environment/decor/bent_straw_2.png" type="Texture" id=6]
|
||||
[ext_resource path="res://assets/environment/decor/bent_straw_leftt.png" type="Texture" id=7]
|
||||
[ext_resource path="res://assets/environment/decor/bent_straw_left_2.png" type="Texture" id=8]
|
||||
[ext_resource path="res://src/Environment/ShaderGrass.gdshader" type="Shader" id=9]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id=1]
|
||||
resource_local_to_scene = true
|
||||
shader = ExtResource( 9 )
|
||||
shader_param/displacement_coefficient_x = 0.0
|
||||
|
||||
[sub_resource type="ShaderMaterial" id=2]
|
||||
resource_local_to_scene = true
|
||||
shader = ExtResource( 9 )
|
||||
shader_param/displacement_coefficient_x = 0.0
|
||||
|
||||
[sub_resource type="ShaderMaterial" id=3]
|
||||
resource_local_to_scene = true
|
||||
shader = ExtResource( 9 )
|
||||
shader_param/displacement_coefficient_x = 0.0
|
||||
|
||||
[sub_resource type="ShaderMaterial" id=4]
|
||||
resource_local_to_scene = true
|
||||
shader = ExtResource( 9 )
|
||||
shader_param/displacement_coefficient_x = 0.0
|
||||
|
||||
[sub_resource type="ShaderMaterial" id=5]
|
||||
resource_local_to_scene = true
|
||||
shader = ExtResource( 9 )
|
||||
shader_param/displacement_coefficient_x = 0.0
|
||||
|
||||
[sub_resource type="ShaderMaterial" id=6]
|
||||
resource_local_to_scene = true
|
||||
shader = ExtResource( 9 )
|
||||
shader_param/displacement_coefficient_x = 0.0
|
||||
|
||||
[sub_resource type="ShaderMaterial" id=7]
|
||||
resource_local_to_scene = true
|
||||
shader = ExtResource( 9 )
|
||||
shader_param/displacement_coefficient_x = 0.0
|
||||
|
||||
[node name="ShaderGrass" type="Node2D"]
|
||||
script = ExtResource( 2 )
|
||||
interact_power = 0.055
|
||||
|
||||
[node name="StraightStraw" type="Polygon2D" parent="."]
|
||||
material = SubResource( 1 )
|
||||
material = ExtResource( 3 )
|
||||
position = Vector2( -2, 0 )
|
||||
texture = ExtResource( 1 )
|
||||
polygon = PoolVector2Array( 4.9375, 4.5625, 5, 1.6875, 8.125, 1.6875, 8.0625, 4.875, 8.0625, 8.4375, 8.125, 12.125, 4.8125, 12.0625, 4.8125, 8.5 )
|
||||
@ -57,7 +22,7 @@ uv = PoolVector2Array( 4.9375, 4.5625, 5, 1.6875, 8.125, 1.6875, 8.0625, 4.875,
|
||||
polygons = [ PoolIntArray( 1, 3, 0 ), PoolIntArray( 2, 3, 1 ), PoolIntArray( 0, 4, 3 ), PoolIntArray( 0, 7, 4 ), PoolIntArray( 6, 7, 5 ), PoolIntArray( 4, 5, 7 ) ]
|
||||
|
||||
[node name="ShortStraw" type="Polygon2D" parent="."]
|
||||
material = SubResource( 2 )
|
||||
material = ExtResource( 3 )
|
||||
position = Vector2( -4, -1 )
|
||||
texture = ExtResource( 4 )
|
||||
polygon = PoolVector2Array( 5, 12.0625, 4.9375, 10.0625, 4.875, 8, 5.0625, 5.9375, 8.1875, 6, 8.0625, 8.0625, 8.0625, 10.1875, 8.0625, 12.125 )
|
||||
@ -65,7 +30,7 @@ uv = PoolVector2Array( 5, 12.0625, 4.9375, 10.0625, 4.875, 8, 5.0625, 5.9375, 8.
|
||||
polygons = [ PoolIntArray( 3, 5, 4 ), PoolIntArray( 2, 3, 5 ), PoolIntArray( 1, 2, 6 ), PoolIntArray( 5, 6, 2 ), PoolIntArray( 6, 0, 7 ), PoolIntArray( 6, 1, 0 ) ]
|
||||
|
||||
[node name="ShortStraw2" type="Polygon2D" parent="."]
|
||||
material = SubResource( 3 )
|
||||
material = ExtResource( 3 )
|
||||
position = Vector2( 1, -2 )
|
||||
texture = ExtResource( 4 )
|
||||
polygon = PoolVector2Array( 5, 12.0625, 4.9375, 10.0625, 4.875, 8, 5.0625, 5.9375, 8.1875, 6, 8.0625, 8.0625, 8.0625, 10.1875, 8.0625, 12.125 )
|
||||
@ -73,7 +38,7 @@ uv = PoolVector2Array( 5, 12.0625, 4.9375, 10.0625, 4.875, 8, 5.0625, 5.9375, 8.
|
||||
polygons = [ PoolIntArray( 3, 5, 4 ), PoolIntArray( 2, 3, 5 ), PoolIntArray( 1, 2, 6 ), PoolIntArray( 5, 6, 2 ), PoolIntArray( 6, 0, 7 ), PoolIntArray( 6, 1, 0 ) ]
|
||||
|
||||
[node name="BentStrawRight" type="Polygon2D" parent="."]
|
||||
material = SubResource( 4 )
|
||||
material = ExtResource( 3 )
|
||||
position = Vector2( 5, 0 )
|
||||
texture = ExtResource( 5 )
|
||||
polygon = PoolVector2Array( 1, 12, 0.9375, 9.0625, 2.75, 7.0625, 5, 5.75, 9.1875, 5.75, 9.125, 9.1875, 6, 10, 5.0625, 12.0625 )
|
||||
@ -81,14 +46,14 @@ uv = PoolVector2Array( 1, 12, 0.9375, 9.0625, 2.75, 7.0625, 5, 5.75, 9.1875, 5.7
|
||||
polygons = [ PoolIntArray( 1, 7, 0 ), PoolIntArray( 2, 7, 1 ), PoolIntArray( 6, 7, 2 ), PoolIntArray( 6, 3, 2 ), PoolIntArray( 3, 5, 6 ), PoolIntArray( 3, 4, 5 ) ]
|
||||
|
||||
[node name="BentStraw2Right" type="Polygon2D" parent="."]
|
||||
material = SubResource( 5 )
|
||||
material = ExtResource( 3 )
|
||||
position = Vector2( 4, 0 )
|
||||
texture = ExtResource( 6 )
|
||||
polygon = PoolVector2Array( 0.875, 12, 0.875, 7.9375, 2.13287, 6.45765, 3, 5.4375, 4.625, 3.6875, 6.9375, 1.6875, 9.375, 4.25, 7, 6.25, 5.5625, 7.5, 4.75, 8.25, 4.6875, 11.875 )
|
||||
uv = PoolVector2Array( 0.875, 12, 0.875, 7.9375, 3, 5.4375, 4.625, 3.6875, 6.9375, 1.6875, 9.375, 4.25, 7, 6.25, 5.5625, 7.5, 4.75, 8.25, 4.6875, 11.8125 )
|
||||
|
||||
[node name="BentStrawLeft" type="Polygon2D" parent="."]
|
||||
material = SubResource( 6 )
|
||||
material = ExtResource( 3 )
|
||||
position = Vector2( -6, 0 )
|
||||
texture = ExtResource( 7 )
|
||||
polygon = PoolVector2Array( 5.0625, 11.9375, 3.9375, 10, 1, 8.9375, 0.875, 5.8125, 5.1875, 5.6875, 6.8125, 7.25, 8.9375, 8.6875, 8.875, 11.9375 )
|
||||
@ -96,7 +61,7 @@ uv = PoolVector2Array( 5.0625, 11.9375, 3.9375, 10, 1, 8.9375, 0.875, 5.8125, 5.
|
||||
polygons = [ PoolIntArray( 0, 6, 7 ), PoolIntArray( 1, 6, 0 ), PoolIntArray( 1, 5, 6 ), PoolIntArray( 1, 4, 5 ), PoolIntArray( 2, 1, 4 ), PoolIntArray( 3, 4, 2 ) ]
|
||||
|
||||
[node name="BentStraw2Left" type="Polygon2D" parent="."]
|
||||
material = SubResource( 7 )
|
||||
material = ExtResource( 3 )
|
||||
position = Vector2( -4, 0 )
|
||||
texture = ExtResource( 8 )
|
||||
polygon = PoolVector2Array( 4.9375, 11.875, 5, 8.8125, 2.8125, 7, -0.375, 4.0625, 2.25, 1.9375, 4.75, 4.625, 8.0625, 7.9375, 8, 12.0625 )
|
||||
|
||||
8
src/Environment/ShaderGrassMaterial.tres
Normal file
8
src/Environment/ShaderGrassMaterial.tres
Normal file
@ -0,0 +1,8 @@
|
||||
[gd_resource type="ShaderMaterial" load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://src/Environment/ShaderGrass.gdshader" type="Shader" id=1]
|
||||
|
||||
[resource]
|
||||
resource_local_to_scene = true
|
||||
shader = ExtResource( 1 )
|
||||
shader_param/displacement_coefficient_x = 0.0
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -36,39 +36,17 @@ unique_name_in_owner = true
|
||||
drag_margin_bottom = 0.3
|
||||
|
||||
[node name="AnimatedSprite" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="4"]
|
||||
frame = 9
|
||||
frame = 4
|
||||
|
||||
[node name="AnimatedSprite2" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="5"]
|
||||
frame = 4
|
||||
frame = 13
|
||||
|
||||
[node name="Blobby" parent="." instance=ExtResource( 8 )]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="CollisionPolygon2D" parent="Blobby/BlobbySkin" index="0"]
|
||||
position = Vector2( 0.0286326, -10.0053 )
|
||||
|
||||
[node name="BlobbySprite" parent="Blobby" index="3"]
|
||||
scale = Vector2( -1, 1 )
|
||||
frame = 5
|
||||
|
||||
[node name="AnimationTree" parent="Blobby/BlobbySprite" index="0"]
|
||||
parameters/playback = SubResource( 4 )
|
||||
|
||||
[node name="BlobbyBody" parent="Blobby" index="8"]
|
||||
position = Vector2( 0.0392303, -10.002 )
|
||||
|
||||
[node name="Left_Wallcast1" parent="Blobby/WallRaycasts/LeftWallRaycast" index="0"]
|
||||
position = Vector2( -11.9763, -5 )
|
||||
|
||||
[node name="Left_Wallcast2" parent="Blobby/WallRaycasts/LeftWallRaycast" index="1"]
|
||||
position = Vector2( -11.9763, 5 )
|
||||
|
||||
[node name="Right_Wallcast1" parent="Blobby/WallRaycasts/RightWallRaycast" index="0"]
|
||||
position = Vector2( 12.0551, -5 )
|
||||
|
||||
[node name="Right_Wallcast2" parent="Blobby/WallRaycasts/RightWallRaycast" index="1"]
|
||||
position = Vector2( 12.0551, 5 )
|
||||
|
||||
[node name="TileMap" type="TileMap" parent="."]
|
||||
unique_name_in_owner = true
|
||||
tile_set = ExtResource( 1 )
|
||||
|
||||
@ -23,7 +23,7 @@ tracks/0/keys = {
|
||||
extents = Vector2( 11.4921, 11.9129 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=4]
|
||||
extents = Vector2( 3.067, 10.5 )
|
||||
extents = Vector2( 3.067, 10 )
|
||||
|
||||
[node name="FlyingLaserCutter" type="Node2D"]
|
||||
script = ExtResource( 2 )
|
||||
|
||||
@ -20,7 +20,7 @@ tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 3 ),
|
||||
"transitions": PoolRealArray( 1.33, 1.33 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( 0, 0 ), Vector2( 0, 48 ) ]
|
||||
"values": [ Vector2( 0, 0 ), Vector2( 48, 0 ) ]
|
||||
}
|
||||
|
||||
[node name="FlyingPlatformClean" type="Node2D"]
|
||||
|
||||
@ -45,10 +45,11 @@ animations = [ {
|
||||
[node name="Spring" type="Node2D"]
|
||||
|
||||
[node name="SpringPlatform" parent="." instance=ExtResource( 1 )]
|
||||
scale = Vector2( 1.5, 1 )
|
||||
|
||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
|
||||
position = Vector2( 0, 1.5 )
|
||||
z_index = -1
|
||||
frames = SubResource( 1 )
|
||||
frame = 5
|
||||
frame = 1
|
||||
playing = true
|
||||
|
||||
2
src/ThirdParty/Demo/IridescenceBall.tscn
vendored
2
src/ThirdParty/Demo/IridescenceBall.tscn
vendored
@ -12,7 +12,7 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 3 )
|
||||
far = 150.0
|
||||
|
||||
[node name="MeshInstance" type="MeshInstance" parent="."]
|
||||
transform = Transform( 0.99997, -0.00767937, 0, 0.00767937, 0.99997, 0, 0, 0, 1, 0, 0, 0 )
|
||||
transform = Transform( 1.0, -0.00767937, 0, 0.00767937, 1.0, 0, 0, 0, 1, 0, 0, 0 )
|
||||
mesh = SubResource( 1 )
|
||||
material/0 = ExtResource( 2 )
|
||||
script = ExtResource( 1 )
|
||||
|
||||
@ -15,8 +15,8 @@ anchor_bottom = 1.0
|
||||
theme = ExtResource( 7 )
|
||||
|
||||
[node name="background" type="TextureRect" parent="."]
|
||||
anchor_left = 0.00195313
|
||||
anchor_right = 1.00195
|
||||
anchor_left = 0.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
texture = ExtResource( 1 )
|
||||
expand = true
|
||||
|
||||
@ -60,6 +60,7 @@ size_flags_horizontal = 3
|
||||
[node name="PlayButton" parent="MenuContainer/Buttons" instance=ExtResource( 3 )]
|
||||
margin_right = 296.0
|
||||
margin_bottom = 48.0
|
||||
next_scene_path = "res://src/Levels/Actual Level 1.tscn"
|
||||
|
||||
[node name="QuitButton" parent="MenuContainer/Buttons" instance=ExtResource( 1 )]
|
||||
anchor_left = 0.0
|
||||
|
||||
Loading…
Reference in New Issue
Block a user