forked from team-sg/hero-mark-2
scrump sounds and more work on stg2600
This commit is contained in:
parent
ba12787fcb
commit
8b831ea616
38 changed files with 804 additions and 153 deletions
14
objects/environment/collapse_block/collapse_block.gd
Normal file
14
objects/environment/collapse_block/collapse_block.gd
Normal file
|
@ -0,0 +1,14 @@
|
|||
extends RigidBody2D
|
||||
|
||||
onready var start_position = Vector2(position.x,position.y)
|
||||
onready var sound = $AudioStreamPlayer
|
||||
|
||||
func _ready():
|
||||
for node in get_tree().get_nodes_in_group("delete_on_collapse"):
|
||||
node.queue_free()
|
||||
|
||||
func _on_AnimationPlayer_animation_finished(anim_name):
|
||||
queue_free()
|
||||
|
||||
func _on_Timer_timeout():
|
||||
$AnimationPlayer.play("die")
|
57
objects/environment/collapse_block/collapse_block.tscn
Normal file
57
objects/environment/collapse_block/collapse_block.tscn
Normal file
|
@ -0,0 +1,57 @@
|
|||
[gd_scene load_steps=7 format=2]
|
||||
|
||||
[ext_resource path="res://tilesets/t_factory.tres" type="TileSet" id=1]
|
||||
[ext_resource path="res://objects/environment/collapse_block/collapse_block.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="PhysicsMaterial" id=2]
|
||||
bounce = 0.07
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 4, 4 )
|
||||
|
||||
[sub_resource type="Animation" id=3]
|
||||
length = 0.001
|
||||
|
||||
[sub_resource type="Animation" id=4]
|
||||
resource_name = "die"
|
||||
length = 1.5
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("TileMap:visible")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.2, 0.4, 0.6, 0.8, 1, 1.2, 1.4 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1, 1 ),
|
||||
"update": 1,
|
||||
"values": [ true, false, true, false, true, false, true, false ]
|
||||
}
|
||||
|
||||
[node name="CollapseBlock" type="RigidBody2D" groups=["collapse_block"]]
|
||||
physics_material_override = SubResource( 2 )
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="TileMap" type="TileMap" parent="."]
|
||||
tile_set = ExtResource( 1 )
|
||||
collision_layer = 0
|
||||
collision_mask = 0
|
||||
format = 1
|
||||
tile_data = PoolIntArray( 0, 0, 0 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2( 4, 4 )
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
anims/RESET = SubResource( 3 )
|
||||
anims/die = SubResource( 4 )
|
||||
|
||||
[node name="Timer" type="Timer" parent="."]
|
||||
wait_time = 3.0
|
||||
one_shot = true
|
||||
autostart = true
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_CollapseBlock_body_entered"]
|
||||
[connection signal="animation_finished" from="AnimationPlayer" to="." method="_on_AnimationPlayer_animation_finished"]
|
||||
[connection signal="timeout" from="Timer" to="." method="_on_Timer_timeout"]
|
Loading…
Add table
Add a link
Reference in a new issue