added new type of falling block

This commit is contained in:
pennyrigate 2023-05-01 04:45:34 -04:00
parent 05339e3ac1
commit fe61dafe6c
8 changed files with 93 additions and 35 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 189 B

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 B

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/woeful_soul.png-965187965bd4c63511479b4beca52f66.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://graphics/falling_block/woeful_soul.png"
dest_files=[ "res://.import/woeful_soul.png-965187965bd4c63511479b4beca52f66.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

View file

@ -17,7 +17,7 @@
[ext_resource path="res://objects/collectibles/star.tscn" type="PackedScene" id=15]
[ext_resource path="res://objects/enemy/tentacle.tscn" type="PackedScene" id=16]
[ext_resource path="res://objects/collectibles/shard.tscn" type="PackedScene" id=17]
[ext_resource path="res://objects/environment/falling_block/falling_block.tscn" type="PackedScene" id=18]
[ext_resource path="res://objects/environment/falling_block/falling_block_cave.tscn" type="PackedScene" id=18]
[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://objects/environment/turniwood/turning_platform.tscn" type="PackedScene" id=21]

File diff suppressed because one or more lines are too long

View file

@ -8,6 +8,13 @@ onready var refresh_timer = $RefreshTimer
onready var crush_area = $CrushArea
onready var collision_shape = $CollisionShape2D
onready var anims = $AnimationPlayer
onready var sprite = $Sprite
func _ready():
#Easy Mode
if Game.is_easy_mode:
fall_speed *= Game.easy_mode_speed_factor
fall_timer.wait_time /= Game.easy_mode_speed_factor
func _physics_process(delta):
#Fall
@ -26,13 +33,15 @@ func _physics_process(delta):
func _on_Area2D_area_entered(area):
if area.is_in_group("player"):
fall_timer.start()
sprite.frame = 1
func _on_VisibilityNotifier2D_screen_exited():
position = startpos
fall = false
refresh_timer.stop()
anims.play("disappear", -1, -1.0, true)
#func _on_VisibilityNotifier2D_screen_exited():
# position = startpos
# fall = false
# refresh_timer.stop()
# anims.play("disappear", -1, -1.0, true)
func _on_RefreshTimer_timeout():
collision_shape.disabled = true # disable collision
@ -42,6 +51,7 @@ func _on_RefreshTimer_timeout():
fall = false
anims.play("idle")
anims.play("disappear", -1, -1.0, true)
sprite.frame = 0
func _on_FallTimer_timeout():
fall = true
@ -49,4 +59,5 @@ func _on_FallTimer_timeout():
#func _on_Area2D_area_exited(area):
# fall_timer.stop()
# if area.is_in_group("player") && graphic == Graphics.GRAVEYARD:
# sprite.frame = 0

View file

@ -52,6 +52,7 @@ fall_speed = 1.0
[node name="Sprite" type="Sprite" parent="."]
texture = ExtResource( 1 )
centered = false
hframes = 2
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2( 4, 2.5 )
@ -93,5 +94,6 @@ anims/idle = SubResource( 5 )
[connection signal="screen_exited" from="VisibilityNotifier2D" to="." method="_on_VisibilityNotifier2D_screen_exited"]
[connection signal="area_entered" from="Area2D" to="." method="_on_Area2D_area_entered"]
[connection signal="area_exited" from="Area2D" to="." method="_on_Area2D_area_exited"]
[connection signal="timeout" from="FallTimer" to="." method="_on_FallTimer_timeout"]
[connection signal="timeout" from="RefreshTimer" to="." method="_on_RefreshTimer_timeout"]

View file

@ -0,0 +1,9 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://objects/environment/falling_block/falling_block_cave.tscn" type="PackedScene" id=1]
[ext_resource path="res://graphics/falling_block/woeful_soul.png" type="Texture" id=2]
[node name="FallingBlock" instance=ExtResource( 1 )]
[node name="Sprite" parent="." index="0"]
texture = ExtResource( 2 )