Better lava

This commit is contained in:
bingus_violet 2024-03-17 21:56:16 -05:00
parent 4f70414ed9
commit d0d7899340
82 changed files with 1747 additions and 738 deletions

37
Objects/Lava/Lava.gd Normal file
View file

@ -0,0 +1,37 @@
extends Node2D
@export var enabled = false
@onready var player = $"../../Character"
func _ready():
visible = false
func _physics_process(delta):
if enabled:
#position.y -= delta * (35 + clamp(abs(player.global_position.y) - abs(global_position.y) - 500, 0, INF))
global_position.y = lerpf(global_position.y, max(player.global_position.y - 100, -8425), delta / 5)
visible = true
$Particles.emitting = true
if global_position.y <= -8425:
enabled = false
var alarmSync = roundi(fmod(Music.get_playback_position(), 1.86))
if player.global_position.y < -8425 and Music.get_playback_position() < 59.1 and alarmSync == 2 and (Music.get_playback_position() < 33 or Music.get_playback_position() > 54):
Music.seek(59)
elif player.global_position.y > -8425 and Music.get_playback_position() > 59.1:
Music.seek(18.5)
#if enabled:
#enabled = false
#var tween = create_tween()
#tween.tween_property(self, "global_position", global_position - Vector2(0, 000), 68)
#visible = true
#$Particles.emitting = true
#print(tween)
func _process(delta):
$LavaSprite.region_rect.position.x = fmod($LavaSprite.region_rect.position.x + delta * 100, 64)
func _on_area_2d_body_shape_entered(body_rid, body, body_shape_index, local_shape_index):
if body.has_method("die"):
Music.stop()
body.die()

BIN
Objects/Lava/Lava.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c0whh5ogd1d6u"
path="res://.godot/imported/Lava.png-12ee5be03fffb3ac1b8fafd48d63e347.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Objects/Lava/Lava.png"
dest_files=["res://.godot/imported/Lava.png-12ee5be03fffb3ac1b8fafd48d63e347.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1