From 7cc669e8138d261e9671c15cdd323d80eddbbe67 Mon Sep 17 00:00:00 2001 From: pennyrigate Date: Fri, 24 Nov 2023 21:44:12 -0500 Subject: [PATCH] a NEW game mechanic?? --- graphics/stalactite/stalactite.png | Bin 0 -> 199 bytes graphics/stalactite/stalactite.png.import | 35 +++++ maps/cave_scholar.tscn | 116 +++++++++++++++ maps/test_room.tscn | 15 +- objects/environment/stalactite/stalactite.gd | 34 +++++ .../environment/stalactite/stalactite.tscn | 137 ++++++++++++++++++ 6 files changed, 334 insertions(+), 3 deletions(-) create mode 100644 graphics/stalactite/stalactite.png create mode 100644 graphics/stalactite/stalactite.png.import create mode 100644 maps/cave_scholar.tscn create mode 100644 objects/environment/stalactite/stalactite.gd create mode 100644 objects/environment/stalactite/stalactite.tscn diff --git a/graphics/stalactite/stalactite.png b/graphics/stalactite/stalactite.png new file mode 100644 index 0000000000000000000000000000000000000000..c258803d335c36495d6fcd847e5512641d0bf9c7 GIT binary patch literal 199 zcmeAS@N?(olHy`uVBq!ia0vp^96-#)!3-q#Nxt6%q!^2X+?^QKos)S9^9T5ZxGtGJbMKZ-$B*nkzJCW$jQ!OcYaqp1666>B9|#zJZ{rIF3UC&9 zL>4nJ@ErzW#^d=bQh*uLTiljWo~Fl^oQ;!ZA5FN3G6pUXO@geCx>|3b9@ literal 0 HcmV?d00001 diff --git a/graphics/stalactite/stalactite.png.import b/graphics/stalactite/stalactite.png.import new file mode 100644 index 0000000..5509a03 --- /dev/null +++ b/graphics/stalactite/stalactite.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/stalactite.png-02a1deb0032f5cd17ce906194b047729.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://graphics/stalactite/stalactite.png" +dest_files=[ "res://.import/stalactite.png-02a1deb0032f5cd17ce906194b047729.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 +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/maps/cave_scholar.tscn b/maps/cave_scholar.tscn new file mode 100644 index 0000000..4ab3c53 --- /dev/null +++ b/maps/cave_scholar.tscn @@ -0,0 +1,116 @@ +[gd_scene load_steps=21 format=2] + +[ext_resource path="res://objects/player/player.tscn" type="PackedScene" id=1] +[ext_resource path="res://tilesets/t_cave.tres" type="TileSet" id=2] +[ext_resource path="res://objects/environment/stalactite/stalactite.tscn" type="PackedScene" id=3] +[ext_resource path="res://objects/hud/hud.tscn" type="PackedScene" id=4] +[ext_resource path="res://tilesets/t_death.tres" type="TileSet" id=5] +[ext_resource path="res://objects/Camera2D.tscn" type="PackedScene" id=6] +[ext_resource path="res://graphics/backgrounds/cave.png" type="Texture" id=8] +[ext_resource path="res://maps/map.gd" type="Script" id=11] +[ext_resource path="res://audio/music/smokestack.ogg" type="AudioStream" id=12] +[ext_resource path="res://scripts/delete_on_game_running.gd" type="Script" id=19] +[ext_resource path="res://objects/collectibles/arrow.tscn" type="PackedScene" id=20] +[ext_resource path="res://tilesets/t_ladders.tres" type="TileSet" id=22] +[ext_resource path="res://objects/environment/exit/exit.tscn" type="PackedScene" id=24] +[ext_resource path="res://shaders/can_stain.tres" type="Material" id=25] +[ext_resource path="res://objects/lore/hills/catbat.tscn" type="PackedScene" id=26] +[ext_resource path="res://objects/lore/cave/shedge.tscn" type="PackedScene" id=27] +[ext_resource path="res://objects/lore/cave/the_scrumps_tongue.tscn" type="PackedScene" id=28] +[ext_resource path="res://objects/lore/cave/blue_ray_cavern.tscn" type="PackedScene" id=29] +[ext_resource path="res://objects/lore/mountain/rolling_fiend.tscn" type="PackedScene" id=30] + +[sub_resource type="RectangleShape2D" id=1] +extents = Vector2( 4, 96 ) + +[node name="Map" type="Node2D" groups=["map"]] +pause_mode = 1 +script = ExtResource( 11 ) +target_time_any = 80 +target_time_100 = 180 +music = ExtResource( 12 ) +lore_entries = [ ExtResource( 29 ), ExtResource( 27 ), ExtResource( 28 ), ExtResource( 30 ), ExtResource( 26 ) ] + +[node name="Camera2D" parent="." instance=ExtResource( 6 )] + +[node name="Sprite" type="Sprite" parent="Camera2D"] +position = Vector2( 128, 96 ) +z_index = -2 +texture = ExtResource( 8 ) +__meta__ = { +"_edit_lock_": true +} + +[node name="HUD" parent="." instance=ExtResource( 4 )] +song_name = "♫Smokestack" + +[node name="Ground" type="TileMap" parent="." groups=["can_stain"]] +light_mask = 3 +material = ExtResource( 25 ) +tile_set = ExtResource( 2 ) +cell_size = Vector2( 8, 8 ) +collision_layer = 9 +format = 1 +tile_data = PoolIntArray( 1114121, 2, 1, 1114122, 2, 2, 1114123, 2, 2, 1114124, 2, 2, 1114125, 2, 2, 1114126, 2, 2, 1114127, 2, 3, 1507327, 1, 1, 1441792, 1, 2, 1441793, 1, 2, 1441794, 1, 2, 1441795, 1, 2, 1441796, 1, 2, 1441797, 1, 2, 1441798, 1, 2, 1441799, 1, 2, 1441800, 1, 2, 1441801, 1, 2, 1441802, 1, 2, 1441803, 1, 2, 1441804, 1, 2, 1441805, 1, 2, 1441806, 1, 2, 1441807, 1, 2, 1441808, 1, 2, 1441809, 1, 2, 1441810, 1, 2, 1441811, 1, 2, 1441812, 1, 2, 1441813, 1, 2, 1441814, 1, 2, 1441815, 1, 2, 1441816, 1, 2, 1441817, 1, 2, 1441818, 1, 2, 1441819, 1, 2, 1441820, 1, 2, 1441821, 1, 2, 1441822, 1, 2, 1441823, 1, 2, 1441824, 1, 2, 1441825, 1, 2, 1441826, 1, 2, 1441827, 1, 2, 1441828, 1, 2, 1441829, 1, 2, 1441830, 1, 2, 1441831, 1, 2, 1441832, 1, 2, 1441833, 1, 2, 1441834, 1, 2, 1441835, 1, 2, 1441836, 1, 2, 1441837, 1, 2, 1441838, 1, 2, 1441839, 1, 2, 1441840, 1, 2, 1441841, 1, 2, 1441842, 1, 2, 1441843, 1, 2, 1441844, 1, 2, 1441845, 1, 2, 1441846, 1, 2, 1441847, 1, 2, 1441848, 1, 2, 1441849, 1, 2, 1441850, 1, 2, 1441851, 1, 2, 1441852, 1, 2, 1441853, 1, 2, 1441854, 1, 2, 1441855, 1, 2, 1441856, 1, 2, 1441857, 1, 2, 1441858, 1, 2, 1441859, 1, 2, 1441860, 1, 2, 1441861, 1, 2, 1441862, 1, 2, 1441863, 1, 2, 1441864, 1, 2, 1441865, 1, 2, 1441866, 1, 2, 1441867, 1, 2, 1441868, 1, 2, 1441869, 1, 2, 1441870, 1, 2, 1441871, 1, 2, 1441872, 1, 2, 1441873, 1, 2, 1441874, 1, 2, 1441875, 1, 2, 1441876, 1, 2, 1441877, 1, 2, 1441878, 1, 2, 1441879, 1, 2, 1441880, 1, 2, 1441881, 1, 2, 1441882, 1, 2, 1441883, 1, 2, 1441884, 1, 2, 1441885, 1, 2, 1441886, 1, 2, 1441887, 1, 2, 1441888, 1, 3, 1572863, 1, 65537, 1507328, 1, 65538, 1507329, 1, 65538, 1507330, 1, 65538, 1507331, 1, 65538, 1507332, 1, 65538, 1507333, 1, 65538, 1507334, 1, 65538, 1507335, 1, 65538, 1507336, 1, 65538, 1507337, 1, 65538, 1507338, 1, 65538, 1507339, 1, 65538, 1507340, 1, 65538, 1507341, 1, 65538, 1507342, 1, 65538, 1507343, 1, 65538, 1507344, 1, 65538, 1507345, 1, 65538, 1507346, 1, 65538, 1507347, 1, 65538, 1507348, 1, 65538, 1507349, 1, 65538, 1507350, 1, 65538, 1507351, 1, 65538, 1507352, 1, 65538, 1507353, 1, 65538, 1507354, 1, 65538, 1507355, 1, 65538, 1507356, 1, 65538, 1507357, 1, 65538, 1507358, 1, 65538, 1507359, 1, 65538, 1507360, 1, 65538, 1507361, 1, 65538, 1507362, 1, 65538, 1507363, 1, 65538, 1507364, 1, 65538, 1507365, 1, 65538, 1507366, 1, 65538, 1507367, 1, 65538, 1507368, 1, 65538, 1507369, 1, 65538, 1507370, 1, 65538, 1507371, 1, 65538, 1507372, 1, 65538, 1507373, 1, 65538, 1507374, 1, 65538, 1507375, 1, 65538, 1507376, 1, 65538, 1507377, 1, 65538, 1507378, 1, 65538, 1507379, 1, 65538, 1507380, 1, 65538, 1507381, 1, 65538, 1507382, 1, 65538, 1507383, 1, 65538, 1507384, 1, 65538, 1507385, 1, 65538, 1507386, 1, 65538, 1507387, 1, 65538, 1507388, 1, 65538, 1507389, 1, 65538, 1507390, 1, 65538, 1507391, 1, 65538, 1507392, 1, 65538, 1507393, 1, 65538, 1507394, 1, 65538, 1507395, 1, 65538, 1507396, 1, 65538, 1507397, 1, 65538, 1507398, 1, 65538, 1507399, 1, 65538, 1507400, 1, 65538, 1507401, 1, 65538, 1507402, 1, 65538, 1507403, 1, 65538, 1507404, 1, 65538, 1507405, 1, 65538, 1507406, 1, 65538, 1507407, 1, 65538, 1507408, 1, 65538, 1507409, 1, 65538, 1507410, 1, 65538, 1507411, 1, 65538, 1507412, 1, 65538, 1507413, 1, 65538, 1507414, 1, 65538, 1507415, 1, 65538, 1507416, 1, 65538, 1507417, 1, 65538, 1507418, 1, 65538, 1507419, 1, 65538, 1507420, 1, 65538, 1507421, 1, 65538, 1507422, 1, 65538, 1507423, 1, 65538, 1507424, 1, 65539, 1638399, 1, 131073, 1572864, 1, 131074, 1572865, 1, 131074, 1572866, 1, 131074, 1572867, 1, 131074, 1572868, 1, 131074, 1572869, 1, 131074, 1572870, 1, 131074, 1572871, 1, 131074, 1572872, 1, 131074, 1572873, 1, 131074, 1572874, 1, 131074, 1572875, 1, 131074, 1572876, 1, 131074, 1572877, 1, 131074, 1572878, 1, 131074, 1572879, 1, 131074, 1572880, 1, 131074, 1572881, 1, 131074, 1572882, 1, 131074, 1572883, 1, 131074, 1572884, 1, 131074, 1572885, 1, 131074, 1572886, 1, 131074, 1572887, 1, 131074, 1572888, 1, 131074, 1572889, 1, 131074, 1572890, 1, 131074, 1572891, 1, 131074, 1572892, 1, 131074, 1572893, 1, 131074, 1572894, 1, 131074, 1572895, 1, 131074, 1572896, 1, 131074, 1572897, 1, 131074, 1572898, 1, 131074, 1572899, 1, 131074, 1572900, 1, 131074, 1572901, 1, 131074, 1572902, 1, 131074, 1572903, 1, 131074, 1572904, 1, 131074, 1572905, 1, 131074, 1572906, 1, 131074, 1572907, 1, 131074, 1572908, 1, 131074, 1572909, 1, 131074, 1572910, 1, 131074, 1572911, 1, 131074, 1572912, 1, 131074, 1572913, 1, 131074, 1572914, 1, 131074, 1572915, 1, 131074, 1572916, 1, 131074, 1572917, 1, 131074, 1572918, 1, 131074, 1572919, 1, 131074, 1572920, 1, 131074, 1572921, 1, 131074, 1572922, 1, 131074, 1572923, 1, 131074, 1572924, 1, 131074, 1572925, 1, 131074, 1572926, 1, 131074, 1572927, 1, 131074, 1572928, 1, 131074, 1572929, 1, 131074, 1572930, 1, 131074, 1572931, 1, 131074, 1572932, 1, 131074, 1572933, 1, 131074, 1572934, 1, 131074, 1572935, 1, 131074, 1572936, 1, 131074, 1572937, 1, 131074, 1572938, 1, 131074, 1572939, 1, 131074, 1572940, 1, 131074, 1572941, 1, 131074, 1572942, 1, 131074, 1572943, 1, 131074, 1572944, 1, 131074, 1572945, 1, 131074, 1572946, 1, 131074, 1572947, 1, 131074, 1572948, 1, 131074, 1572949, 1, 131074, 1572950, 1, 131074, 1572951, 1, 131074, 1572952, 1, 131074, 1572953, 1, 131074, 1572954, 1, 131074, 1572955, 1, 131074, 1572956, 1, 131074, 1572957, 1, 131074, 1572958, 1, 131074, 1572959, 1, 131074, 1572960, 1, 131075 ) + +[node name="Player" parent="." instance=ExtResource( 1 )] +position = Vector2( 32, 176 ) + +[node name="Ladder" type="TileMap" parent="."] +tile_set = ExtResource( 22 ) +cell_size = Vector2( 8, 8 ) +collision_layer = 9 +format = 1 + +[node name="Death" type="TileMap" parent="." groups=["death"]] +light_mask = 0 +tile_set = ExtResource( 5 ) +cell_size = Vector2( 8, 8 ) +collision_layer = 32 +format = 1 + +[node name="Platforms" type="Node2D" parent="."] + +[node name="Stalactite" parent="Platforms" instance=ExtResource( 3 )] +position = Vector2( 80, 144 ) + +[node name="Enemies" type="Node2D" parent="."] + +[node name="Collectibles" type="Node2D" parent="."] + +[node name="Arrow" parent="Collectibles" instance=ExtResource( 20 )] +position = Vector2( 49, 165 ) + +[node name="StaticBody2D" type="StaticBody2D" parent="."] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"] +position = Vector2( -4, 96 ) +shape = SubResource( 1 ) + +[node name="CollisionShape2D2" type="CollisionShape2D" parent="StaticBody2D"] +position = Vector2( 772, 96 ) +shape = SubResource( 1 ) + +[node name="ColorRect" type="ColorRect" parent="."] +margin_left = 256.0 +margin_right = 512.0 +margin_bottom = 192.0 +color = Color( 0, 1, 0.180392, 0.0627451 ) +script = ExtResource( 19 ) +__meta__ = { +"_edit_lock_": true +} + +[node name="ColorRect2" type="ColorRect" parent="."] +margin_left = 512.0 +margin_right = 768.0 +margin_bottom = 192.0 +color = Color( 1, 0, 0.890196, 0.0627451 ) +script = ExtResource( 19 ) +__meta__ = { +"_edit_lock_": true +} + +[node name="Exit" parent="." instance=ExtResource( 24 )] +position = Vector2( 752, 116 ) +cost = 25 diff --git a/maps/test_room.tscn b/maps/test_room.tscn index cc58725..e875f64 100644 --- a/maps/test_room.tscn +++ b/maps/test_room.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=30 format=2] +[gd_scene load_steps=32 format=2] [ext_resource path="res://tilesets/t_death.tres" type="TileSet" id=1] [ext_resource path="res://tilesets/t_cave.tres" type="TileSet" id=2] @@ -17,11 +17,13 @@ [ext_resource path="res://audio/music/BBBBBBBB.ogg" type="AudioStream" id=15] [ext_resource path="res://objects/respawn_point.tscn" type="PackedScene" id=16] [ext_resource path="res://shaders/1px_border.gdshader" type="Shader" id=17] +[ext_resource path="res://objects/environment/stalactite/stalactite.tscn" type="PackedScene" id=18] [ext_resource path="res://objects/environment/switches/button.tscn" type="PackedScene" id=19] [ext_resource path="res://objects/enemy/tin.tscn" type="PackedScene" id=20] [ext_resource path="res://graphics/enemy/sawblade.png" type="Texture" id=21] [ext_resource path="res://objects/enemy/rolling_fiend.tscn" type="PackedScene" id=22] [ext_resource path="res://objects/enemy/steam.tscn" type="PackedScene" id=23] +[ext_resource path="res://objects/environment/falling_block/falling_block_cave.tscn" type="PackedScene" id=24] [ext_resource path="res://objects/enemy/cop.tscn" type="PackedScene" id=25] [ext_resource path="res://objects/environment/turret/turret_bullet.tscn" type="PackedScene" id=26] [ext_resource path="res://objects/player/player.tscn" type="PackedScene" id=27] @@ -69,7 +71,7 @@ tile_set = ExtResource( 3 ) cell_size = Vector2( 8, 8 ) collision_layer = 9 format = 1 -tile_data = PoolIntArray( 196630, 1, 0, 262166, 1, 0, 327702, 1, 0, 393238, 1, 0, 458774, 1, 0, 524310, 1, 0, 589846, 1, 0, 655382, 1, 0, 655388, 0, 196609, 983062, 0, 0, 983063, 0, 0, 983064, 0, 0, 983065, 0, 0, 983066, 0, 0, 983067, 0, 0, 983068, 0, 0, 983069, 0, 0, 1048579, 0, 65537, 1048580, 0, 65537, 1048581, 0, 65537, 1048582, 0, 65537, 1048583, 0, 65537, 1441792, 0, 0, 1441793, 0, 0, 1441794, 0, 0, 1441795, 0, 0, 1441796, 0, 0, 1441797, 0, 0, 1441798, 0, 0, 1441801, 0, 0, 1441802, 0, 0, 1441803, 0, 0, 1441804, 0, 0, 1441805, 0, 0, 1441806, 0, 0, 1441807, 0, 0, 1441808, 0, 0, 1441809, 0, 0, 1441810, 0, 0, 1441811, 0, 0, 1441812, 0, 0, 1441813, 0, 0, 1441814, 0, 0, 1441815, 0, 0, 1441818, 0, 0, 1441819, 0, 0, 1441820, 0, 0, 1441821, 0, 0, 1441822, 0, 0, 1441823, 0, 0, 1507328, 0, 1, 1507329, 0, 1, 1507330, 0, 1, 1507331, 0, 1, 1507332, 0, 1, 1507333, 0, 1, 1507334, 0, 1, 1507337, 0, 1, 1507338, 0, 1, 1507339, 0, 1, 1507340, 0, 1, 1507341, 0, 1, 1507342, 0, 1, 1507343, 0, 1, 1507344, 0, 1, 1507345, 0, 1, 1507346, 0, 1, 1507347, 0, 1, 1507348, 0, 1, 1507349, 0, 1, 1507350, 0, 1, 1507351, 0, 1, 1507354, 0, 1, 1507355, 0, 1, 1507356, 0, 1, 1507357, 0, 1, 1507358, 0, 1, 1507359, 0, 1 ) +tile_data = PoolIntArray( 196630, 1, 0, 262166, 1, 0, 327702, 1, 0, 393238, 1, 0, 458774, 1, 0, 524310, 1, 0, 589839, 0, 0, 589840, 0, 0, 589841, 0, 0, 589842, 0, 0, 589843, 0, 0, 589844, 0, 0, 589845, 0, 0, 589846, 1, 0, 655382, 1, 0, 655388, 0, 196609, 983062, 0, 0, 983063, 0, 0, 983064, 0, 0, 983065, 0, 0, 983066, 0, 0, 983067, 0, 0, 983068, 0, 0, 983069, 0, 0, 1048579, 0, 65537, 1048580, 0, 65537, 1048581, 0, 65537, 1048582, 0, 65537, 1048583, 0, 65537, 1441792, 0, 0, 1441793, 0, 0, 1441794, 0, 0, 1441795, 0, 0, 1441796, 0, 0, 1441797, 0, 0, 1441798, 0, 0, 1441801, 0, 0, 1441802, 0, 0, 1441803, 0, 0, 1441804, 0, 0, 1441805, 0, 0, 1441806, 0, 0, 1441807, 0, 0, 1441808, 0, 0, 1441809, 0, 0, 1441810, 0, 0, 1441811, 0, 0, 1441812, 0, 0, 1441813, 0, 0, 1441814, 0, 0, 1441815, 0, 0, 1441818, 0, 0, 1441819, 0, 0, 1441820, 0, 0, 1441821, 0, 0, 1441822, 0, 0, 1441823, 0, 0, 1507328, 0, 1, 1507329, 0, 1, 1507330, 0, 1, 1507331, 0, 1, 1507332, 0, 1, 1507333, 0, 1, 1507334, 0, 1, 1507337, 0, 1, 1507338, 0, 1, 1507339, 0, 1, 1507340, 0, 1, 1507341, 0, 1, 1507342, 0, 1, 1507343, 0, 1, 1507344, 0, 1, 1507345, 0, 1, 1507346, 0, 1, 1507347, 0, 1, 1507348, 0, 1, 1507349, 0, 1, 1507350, 0, 1, 1507351, 0, 1, 1507354, 0, 1, 1507355, 0, 1, 1507356, 0, 1, 1507357, 0, 1, 1507358, 0, 1, 1507359, 0, 1 ) [node name="Slime" parent="." instance=ExtResource( 10 )] position = Vector2( 264, 168 ) @@ -131,6 +133,7 @@ material = SubResource( 4 ) position = Vector2( 4, 4 ) z_index = -3 frames = SubResource( 5 ) +frame = 1 playing = true [node name="Steam" parent="." instance=ExtResource( 23 )] @@ -150,7 +153,7 @@ turn_time = inf position = Vector2( 152, 72 ) [node name="Player2" parent="." instance=ExtResource( 27 )] -position = Vector2( 168, 168 ) +position = Vector2( 128, 72 ) [node name="MovingPlatform" parent="." instance=ExtResource( 6 )] position = Vector2( 96, 144 ) @@ -200,4 +203,10 @@ right_boundary = 3.0 bottom_jumps = [ -2.0 ] top_jumps = [ 3.0 ] +[node name="Stalactite" parent="." instance=ExtResource( 18 )] +position = Vector2( 144, 24 ) + +[node name="FallingBlock" parent="." instance=ExtResource( 24 )] +position = Vector2( 124, 96 ) + [editable path="RollingFiend"] diff --git a/objects/environment/stalactite/stalactite.gd b/objects/environment/stalactite/stalactite.gd new file mode 100644 index 0000000..6c6a95a --- /dev/null +++ b/objects/environment/stalactite/stalactite.gd @@ -0,0 +1,34 @@ +extends Node2D + +onready var cast = $RayCast2D +export var speed = 80 +var fall = false +onready var refresh_timer = $RefreshTimer +onready var anims = $AnimationPlayer +onready var startpos = position + +func _physics_process(delta): + if cast.is_colliding(): + var collider = cast.get_collider() + if collider.is_in_group("player_hitbox") or collider.is_in_group("msx"): + if fall == false: refresh_timer.start() + fall = true + + if fall == true: + position.y += speed * delta + + if !refresh_timer.is_stopped() && refresh_timer.get_time_left() <= 0.6: + anims.play("disappear") + + + +func _on_Hitbox_area_entered(area): + if area.is_in_group("player_hitbox"): + area.get_parent().die() + + +func _on_RefreshTimer_timeout(): + call_deferred("set_position", startpos) + fall = false + anims.play("idle") + anims.play("disappear", -1, -1.0, true) diff --git a/objects/environment/stalactite/stalactite.tscn b/objects/environment/stalactite/stalactite.tscn new file mode 100644 index 0000000..28c7739 --- /dev/null +++ b/objects/environment/stalactite/stalactite.tscn @@ -0,0 +1,137 @@ +[gd_scene load_steps=7 format=2] + +[ext_resource path="res://graphics/stalactite/stalactite.png" type="Texture" id=1] +[ext_resource path="res://objects/environment/stalactite/stalactite.gd" type="Script" id=2] + +[sub_resource type="RectangleShape2D" id=1] +extents = Vector2( 4, 5 ) + +[sub_resource type="Animation" id=4] +length = 0.001 +tracks/0/type = "value" +tracks/0/path = NodePath("Hitbox/CollisionShape2D:disabled") +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": [ true ] +} + +[sub_resource type="Animation" id=2] +resource_name = "disappear" +length = 0.6 +step = 0.05 +tracks/0/type = "value" +tracks/0/path = NodePath("Sprite:visible") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0.00203761, 0.1, 0.2, 0.3, 0.4, 0.5 ), +"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1 ), +"update": 1, +"values": [ true, false, true, false, true, false ] +} +tracks/1/type = "value" +tracks/1/path = NodePath("Hitbox/CollisionShape2D:disabled") +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": 1, +"values": [ false, true ] +} +tracks/2/type = "value" +tracks/2/path = NodePath("RayCast2D:enabled") +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": 1, +"values": [ true, false ] +} + +[sub_resource type="Animation" id=3] +resource_name = "idle" +tracks/0/type = "value" +tracks/0/path = NodePath("Sprite:visible") +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("RayCast2D:enabled") +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": 1, +"values": [ true ] +} +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": 1, +"values": [ false ] +} + +[node name="Stalactite" type="Node2D"] +script = ExtResource( 2 ) + +[node name="Sprite" type="Sprite" parent="."] +position = Vector2( 4, 0 ) +texture = ExtResource( 1 ) + +[node name="RayCast2D" type="RayCast2D" parent="."] +position = Vector2( 3, 0 ) +enabled = true +cast_to = Vector2( 0, 40 ) +collision_mask = 10 +collide_with_areas = true + +[node name="Hitbox" type="Area2D" parent="."] +collision_mask = 2 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"] +position = Vector2( 4, 0 ) +shape = SubResource( 1 ) +disabled = true + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +autoplay = "idle" +anims/RESET = SubResource( 4 ) +anims/disappear = SubResource( 2 ) +anims/idle = SubResource( 3 ) + +[node name="RefreshTimer" type="Timer" parent="."] +wait_time = 2.0 +one_shot = true + +[connection signal="area_entered" from="Hitbox" to="." method="_on_Hitbox_area_entered"] +[connection signal="timeout" from="RefreshTimer" to="." method="_on_RefreshTimer_timeout"]