make the steam more fair
This commit is contained in:
parent
8a210d1da1
commit
d518dce44d
2 changed files with 162 additions and 8 deletions
|
@ -6,23 +6,30 @@ export var active = false
|
||||||
|
|
||||||
onready var particles = $SteamParticles
|
onready var particles = $SteamParticles
|
||||||
onready var collision_shape = $Hitbox/CollisionShape2D
|
onready var collision_shape = $Hitbox/CollisionShape2D
|
||||||
|
onready var animation_player = $AnimationPlayer
|
||||||
|
|
||||||
var time = 0.0
|
var time = 0.0
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
if !active:
|
||||||
|
particles.emitting = false
|
||||||
|
collision_shape.disabled = true
|
||||||
|
|
||||||
func _physics_process(delta):
|
func _physics_process(delta):
|
||||||
time += delta
|
time += delta
|
||||||
if active && time >= on_time:
|
if active && time >= on_time:
|
||||||
time -= on_time
|
time -= on_time
|
||||||
active = false
|
active = false
|
||||||
collision_shape.disabled = true
|
animation_player.play("turn_off")
|
||||||
particles.emitting = false
|
|
||||||
elif !active && time >= off_time:
|
elif !active && time >= off_time:
|
||||||
time -= off_time
|
time -= off_time
|
||||||
active = true
|
active = true
|
||||||
collision_shape.disabled = false
|
animation_player.play("turn_on")
|
||||||
particles.emitting = true
|
|
||||||
|
|
||||||
func switch_action():
|
func switch_action():
|
||||||
particles.emitting = false
|
animation_player.play("turn_off")
|
||||||
collision_shape.disabled = true
|
animation_player.connect("animation_finished", self, "_queue_free")
|
||||||
get_tree().create_timer(particles.lifetime).connect("timeout", self, "queue_free")
|
|
||||||
|
#stupidstupidstupidstupidarrrghhhwouldnotneedtodothisshitingodot4grumblegrumble
|
||||||
|
func _queue_free(_anim_name):
|
||||||
|
queue_free()
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
[gd_scene load_steps=5 format=2]
|
[gd_scene load_steps=8 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://objects/enemy/steam.gd" type="Script" id=1]
|
[ext_resource path="res://objects/enemy/steam.gd" type="Script" id=1]
|
||||||
[ext_resource path="res://graphics/particles/dust.png" type="Texture" id=2]
|
[ext_resource path="res://graphics/particles/dust.png" type="Texture" id=2]
|
||||||
|
@ -7,8 +7,150 @@
|
||||||
_data = [ Vector2( 0, 0.291411 ), 0.0, 5.40019, 0, 0, Vector2( 0.263812, 1 ), 0.0, 0.0, 0, 0, Vector2( 1, 0 ), -0.0915322, 0.0, 0, 0 ]
|
_data = [ Vector2( 0, 0.291411 ), 0.0, 5.40019, 0, 0, Vector2( 0.263812, 1 ), 0.0, 0.0, 0, 0, Vector2( 1, 0 ), -0.0915322, 0.0, 0, 0 ]
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id=1]
|
[sub_resource type="RectangleShape2D" id=1]
|
||||||
|
resource_local_to_scene = true
|
||||||
extents = Vector2( 2, 12 )
|
extents = Vector2( 2, 12 )
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id=3]
|
||||||
|
length = 0.001
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/path = NodePath("Hitbox/CollisionShape2D:shape:extents")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PoolRealArray( 0 ),
|
||||||
|
"transitions": PoolRealArray( 1 ),
|
||||||
|
"update": 0,
|
||||||
|
"values": [ Vector2( 2, 12 ) ]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/path = NodePath("Hitbox/CollisionShape2D:position")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PoolRealArray( 0 ),
|
||||||
|
"transitions": PoolRealArray( 1 ),
|
||||||
|
"update": 0,
|
||||||
|
"values": [ Vector2( 4, -12 ) ]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/path = NodePath("Hitbox/CollisionShape2D:disabled")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PoolRealArray( 0 ),
|
||||||
|
"transitions": PoolRealArray( 1 ),
|
||||||
|
"update": 0,
|
||||||
|
"values": [ false ]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id=4]
|
||||||
|
resource_name = "turn_off"
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/path = NodePath("SteamParticles:emitting")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PoolRealArray( 0 ),
|
||||||
|
"transitions": PoolRealArray( 1 ),
|
||||||
|
"update": 1,
|
||||||
|
"values": [ false ]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/path = NodePath("Hitbox/CollisionShape2D:shape:extents")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PoolRealArray( 0, 0.6 ),
|
||||||
|
"transitions": PoolRealArray( 1, 1 ),
|
||||||
|
"update": 0,
|
||||||
|
"values": [ Vector2( 2, 12 ), Vector2( 2, 0 ) ]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/path = NodePath("Hitbox/CollisionShape2D:position")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PoolRealArray( 0, 0.6 ),
|
||||||
|
"transitions": PoolRealArray( 1, 1 ),
|
||||||
|
"update": 0,
|
||||||
|
"values": [ Vector2( 4, -12 ), Vector2( 4, -24 ) ]
|
||||||
|
}
|
||||||
|
tracks/3/type = "value"
|
||||||
|
tracks/3/path = NodePath("Hitbox/CollisionShape2D:disabled")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"times": PoolRealArray( 0, 0.6 ),
|
||||||
|
"transitions": PoolRealArray( 1, 1 ),
|
||||||
|
"update": 1,
|
||||||
|
"values": [ false, true ]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id=5]
|
||||||
|
resource_name = "turn_on"
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/path = NodePath("SteamParticles:emitting")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PoolRealArray( 0 ),
|
||||||
|
"transitions": PoolRealArray( 1 ),
|
||||||
|
"update": 1,
|
||||||
|
"values": [ true ]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/path = NodePath("Hitbox/CollisionShape2D:shape:extents")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PoolRealArray( 0, 0.6 ),
|
||||||
|
"transitions": PoolRealArray( 1, 1 ),
|
||||||
|
"update": 0,
|
||||||
|
"values": [ Vector2( 2, 0 ), Vector2( 2, 12 ) ]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/path = NodePath("Hitbox/CollisionShape2D:position")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PoolRealArray( 0, 0.6 ),
|
||||||
|
"transitions": PoolRealArray( 1, 1 ),
|
||||||
|
"update": 0,
|
||||||
|
"values": [ Vector2( 4, 0 ), Vector2( 4, -12 ) ]
|
||||||
|
}
|
||||||
|
tracks/3/type = "value"
|
||||||
|
tracks/3/path = NodePath("Hitbox/CollisionShape2D:disabled")
|
||||||
|
tracks/3/interp = 1
|
||||||
|
tracks/3/loop_wrap = true
|
||||||
|
tracks/3/imported = false
|
||||||
|
tracks/3/enabled = true
|
||||||
|
tracks/3/keys = {
|
||||||
|
"times": PoolRealArray( 0 ),
|
||||||
|
"transitions": PoolRealArray( 1 ),
|
||||||
|
"update": 1,
|
||||||
|
"values": [ false ]
|
||||||
|
}
|
||||||
|
|
||||||
[node name="Steam" type="Node2D"]
|
[node name="Steam" type="Node2D"]
|
||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
blood = false
|
blood = false
|
||||||
|
@ -35,4 +177,9 @@ scale_amount_curve = SubResource( 2 )
|
||||||
position = Vector2( 4, -12 )
|
position = Vector2( 4, -12 )
|
||||||
shape = SubResource( 1 )
|
shape = SubResource( 1 )
|
||||||
|
|
||||||
|
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||||
|
anims/RESET = SubResource( 3 )
|
||||||
|
anims/turn_off = SubResource( 4 )
|
||||||
|
anims/turn_on = SubResource( 5 )
|
||||||
|
|
||||||
[connection signal="area_entered" from="Hitbox" to="." method="_on_Hitbox_area_entered"]
|
[connection signal="area_entered" from="Hitbox" to="." method="_on_Hitbox_area_entered"]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue