Created swinging spike
This commit is contained in:
parent
97fcc5fef4
commit
2019f5dec5
6 changed files with 163 additions and 14 deletions
BIN
assets/Traps/trap_suspended_anim_strip_18.png
Normal file
BIN
assets/Traps/trap_suspended_anim_strip_18.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.2 KiB |
34
assets/Traps/trap_suspended_anim_strip_18.png.import
Normal file
34
assets/Traps/trap_suspended_anim_strip_18.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/trap_suspended_anim_strip_18.png-14a10def026f8ebbe66a58a26d106fb8.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/Traps/trap_suspended_anim_strip_18.png"
|
||||
dest_files=[ "res://.import/trap_suspended_anim_strip_18.png-14a10def026f8ebbe66a58a26d106fb8.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=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
19
src/Hazards/SwingingSpike.gd
Normal file
19
src/Hazards/SwingingSpike.gd
Normal file
|
@ -0,0 +1,19 @@
|
|||
extends Node2D
|
||||
|
||||
|
||||
# Declare member variables here. Examples:
|
||||
# var a = 2
|
||||
# var b = "text"
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
|
||||
func _on_StaticBody2D_body_entered(body):
|
||||
if body.name == "Player":
|
||||
var player:Player = body
|
||||
player.die()
|
||||
pass # Replace with function body.
|
69
src/Hazards/SwingingSpike.tscn
Normal file
69
src/Hazards/SwingingSpike.tscn
Normal file
|
@ -0,0 +1,69 @@
|
|||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://assets/Traps/trap_suspended_anim_strip_18.png" type="Texture" id=1]
|
||||
[ext_resource path="res://src/Hazards/SwingingSpike.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="Animation" id=1]
|
||||
resource_name = "swing"
|
||||
length = 1.8
|
||||
loop = true
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("Sprite:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ),
|
||||
"update": 1,
|
||||
"values": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 ]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/path = NodePath("StaticBody2D/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, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ),
|
||||
"update": 1,
|
||||
"values": [ Vector2( -0.187294, 15.5449 ), Vector2( 11.6119, 12.7356 ), Vector2( 20.8441, 8.03137 ), Vector2( 26.6466, -1.42532 ), Vector2( 26.7305, -3.29058 ), Vector2( 26.7305, -3.29058 ), Vector2( 26.6466, -1.42532 ), Vector2( 20.4774, 7.10583 ), Vector2( 11.4818, 12.3679 ), Vector2( 0.201323, 15.3077 ), Vector2( -12.0156, 12.5247 ), Vector2( -21.2125, 7.47087 ), Vector2( -25.8877, -1.30197 ), Vector2( -27.7848, -3.92551 ), Vector2( -27.7848, -3.92551 ), Vector2( -26.6914, -1.49265 ), Vector2( -21.0406, 7.18316 ), Vector2( -10.9885, 12.8624 ) ]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/path = NodePath("StaticBody2D/CollisionShape2D:rotation_degrees")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/keys = {
|
||||
"times": PoolRealArray( 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ),
|
||||
"update": 1,
|
||||
"values": [ 0.0, -26.0, -45.0, -60.0, -65.0, -65.0, -60.0, -45.0, -25.0, 0.0, 20.0, 45.0, 60.0, 65.0, 65.0, 60.0, 45.0, 22.5 ]
|
||||
}
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=2]
|
||||
extents = Vector2( 9.90336, 14.8331 )
|
||||
|
||||
[node name="SwingingSpike" type="Node2D"]
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
texture = ExtResource( 1 )
|
||||
hframes = 18
|
||||
frame = 9
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
autoplay = "swing"
|
||||
anims/swing = SubResource( 1 )
|
||||
|
||||
[node name="StaticBody2D" type="Area2D" parent="."]
|
||||
collision_layer = 4
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"]
|
||||
position = Vector2( 0.201323, 15.3077 )
|
||||
scale = Vector2( 1, 1 )
|
||||
shape = SubResource( 2 )
|
||||
[connection signal="body_entered" from="StaticBody2D" to="." method="_on_StaticBody2D_body_entered"]
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=48 format=2]
|
||||
[gd_scene load_steps=49 format=2]
|
||||
|
||||
[ext_resource path="res://assets/Tiles/tileset.png" type="Texture" id=1]
|
||||
[ext_resource path="res://assets/Tiles/root_props.png" type="Texture" id=2]
|
||||
|
@ -10,6 +10,7 @@
|
|||
[ext_resource path="res://assets/Tiles/SemiSolidsTileMap.tscn" type="PackedScene" id=8]
|
||||
[ext_resource path="res://src/Hazards/Spike.tscn" type="PackedScene" id=9]
|
||||
[ext_resource path="res://src/Actors/Player.tscn" type="PackedScene" id=10]
|
||||
[ext_resource path="res://src/Hazards/SwingingSpike.tscn" type="PackedScene" id=11]
|
||||
|
||||
[sub_resource type="TileSet" id=1]
|
||||
0/name = "tileset.png 0"
|
||||
|
@ -375,6 +376,9 @@ position = Vector2( 945.375, 396 )
|
|||
[node name="Spike" parent="Hazards" instance=ExtResource( 9 )]
|
||||
position = Vector2( 344, 256 )
|
||||
|
||||
[node name="SwingingSpike" parent="Hazards" instance=ExtResource( 11 )]
|
||||
position = Vector2( 207.715, 238.906 )
|
||||
|
||||
[node name="World" type="Node2D" parent="."]
|
||||
|
||||
[node name="SemiSolidsTileMap" parent="World" instance=ExtResource( 8 )]
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue