make exit collision match more with graphics
This commit is contained in:
parent
aa00590334
commit
a03a1d8f6d
2 changed files with 9 additions and 12 deletions
|
@ -5,7 +5,6 @@ export var cost: int = 0
|
|||
var open: bool = false
|
||||
|
||||
onready var label: Label = $Label
|
||||
onready var detect_shape: CollisionShape2D = $DetectPlayer/CollisionShape2D
|
||||
onready var sprite: Sprite = $Sprite
|
||||
onready var closed_collision: CollisionShape2D = $"%ClosedCollision"
|
||||
|
||||
|
@ -15,11 +14,10 @@ func _ready():
|
|||
func _physics_process(delta):
|
||||
if Game.keys >= cost and not open:
|
||||
open = true
|
||||
detect_shape.disabled = false
|
||||
closed_collision.disabled = true
|
||||
label.visible = false
|
||||
var tween = create_tween()
|
||||
tween.tween_property(sprite, "frame", 3, 0.25)
|
||||
tween.tween_property(closed_collision, "disabled", true, 0.0)
|
||||
|
||||
func _on_Area2D_area_entered(area):
|
||||
if area.is_in_group("player_hitbox"):
|
||||
|
|
|
@ -8,26 +8,26 @@
|
|||
[ext_resource path="res://graphics/exit/exit_back.png" type="Texture" id=6]
|
||||
[ext_resource path="res://shaders/can_stain.tres" type="Material" id=7]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id=4]
|
||||
[sub_resource type="ShaderMaterial" id=9]
|
||||
shader = ExtResource( 4 )
|
||||
shader_param/speed = 5.0
|
||||
shader_param/cycle_offset = 0.0
|
||||
shader_param/wave_length = 8.0
|
||||
shader_param/thickness = 0.1
|
||||
|
||||
[sub_resource type="ShaderMaterial" id=5]
|
||||
[sub_resource type="ShaderMaterial" id=10]
|
||||
shader = ExtResource( 4 )
|
||||
shader_param/speed = -6.0
|
||||
shader_param/cycle_offset = 3.0
|
||||
shader_param/wave_length = 5.0
|
||||
shader_param/thickness = 0.1
|
||||
|
||||
[sub_resource type="Gradient" id=6]
|
||||
[sub_resource type="Gradient" id=11]
|
||||
interpolation_mode = 1
|
||||
offsets = PoolRealArray( 0, 0.5 )
|
||||
colors = PoolColorArray( 0.345098, 0.74902, 0.878431, 1, 0.396078, 1, 1, 1 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=2]
|
||||
[sub_resource type="RectangleShape2D" id=12]
|
||||
extents = Vector2( 1, 1 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=7]
|
||||
|
@ -53,7 +53,7 @@ hframes = 4
|
|||
show_behind_parent = true
|
||||
|
||||
[node name="Wave1" type="ColorRect" parent="Sprite/Energy"]
|
||||
material = SubResource( 4 )
|
||||
material = SubResource( 9 )
|
||||
margin_left = -7.0
|
||||
margin_top = -3.0
|
||||
margin_right = 7.0
|
||||
|
@ -61,7 +61,7 @@ margin_bottom = 12.0
|
|||
color = Color( 0.396078, 1, 1, 1 )
|
||||
|
||||
[node name="Wave2" type="ColorRect" parent="Sprite/Energy"]
|
||||
material = SubResource( 5 )
|
||||
material = SubResource( 10 )
|
||||
margin_left = -7.0
|
||||
margin_top = -3.0
|
||||
margin_right = 7.0
|
||||
|
@ -79,7 +79,7 @@ spread = 0.0
|
|||
gravity = Vector2( 0, 0 )
|
||||
initial_velocity = 12.0
|
||||
damping = 4.0
|
||||
color_initial_ramp = SubResource( 6 )
|
||||
color_initial_ramp = SubResource( 11 )
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
material = ExtResource( 5 )
|
||||
|
@ -95,8 +95,7 @@ z_index = -3
|
|||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="DetectPlayer"]
|
||||
position = Vector2( 0, 11 )
|
||||
shape = SubResource( 2 )
|
||||
disabled = true
|
||||
shape = SubResource( 12 )
|
||||
|
||||
[node name="Collision" type="StaticBody2D" parent="." groups=["can_stain"]]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue