Better lava
This commit is contained in:
parent
4f70414ed9
commit
d0d7899340
82 changed files with 1747 additions and 738 deletions
28
Objects/MovingPlatform/MovingPlatform.gd
Normal file
28
Objects/MovingPlatform/MovingPlatform.gd
Normal file
|
@ -0,0 +1,28 @@
|
|||
extends AnimatableBody2D
|
||||
|
||||
@export var endPoint : Vector2
|
||||
var velocity = Vector2.ZERO
|
||||
|
||||
var moving = false
|
||||
|
||||
func _on_area_2d_body_shape_entered(body_rid, body, bod_shape_index, local_shape_index):
|
||||
if not moving:
|
||||
moving = true
|
||||
var tween = create_tween()
|
||||
|
||||
tween.set_parallel(true)
|
||||
|
||||
tween.set_ease(Tween.EASE_IN_OUT).set_trans(Tween.TRANS_SINE)
|
||||
|
||||
var dur = position.distance_to(position + endPoint) / 750
|
||||
|
||||
tween.tween_property(self, "position", position + endPoint, dur)
|
||||
tween.tween_property(self, "velocity", endPoint / dur / 3, dur / 2)
|
||||
tween.tween_property(self, "velocity", Vector2.ZERO, 1.25).set_delay((dur / 2))
|
||||
tween.chain()
|
||||
tween.tween_property(self, "position", position, dur).set_delay(2)
|
||||
tween.tween_property(self, "velocity", -endPoint / 3, 1).set_delay(2)
|
||||
tween.tween_property(self, "velocity", Vector2.ZERO, 1.25).set_delay(3)
|
||||
|
||||
await tween.finished
|
||||
moving = false
|
29
Objects/MovingPlatform/MovingPlatform.tscn
Normal file
29
Objects/MovingPlatform/MovingPlatform.tscn
Normal file
|
@ -0,0 +1,29 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://vfpfao4e18vn"]
|
||||
|
||||
[ext_resource type="Script" path="res://Objects/MovingPlatform/MovingPlatform.gd" id="1_01pul"]
|
||||
[ext_resource type="Texture2D" uid="uid://bwj4inpj7mawo" path="res://Objects/MovingPlatform/Sprite.png" id="1_1t8bc"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_o874y"]
|
||||
size = Vector2(128, 32)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_yhojp"]
|
||||
size = Vector2(128, 30)
|
||||
|
||||
[node name="MovingPlatform" type="AnimatableBody2D"]
|
||||
script = ExtResource("1_01pul")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = ExtResource("1_1t8bc")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("RectangleShape2D_o874y")
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
position = Vector2(0, -10)
|
||||
collision_layer = 2
|
||||
collision_mask = 2
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
shape = SubResource("RectangleShape2D_yhojp")
|
||||
|
||||
[connection signal="body_shape_entered" from="Area2D" to="." method="_on_area_2d_body_shape_entered"]
|
BIN
Objects/MovingPlatform/Sprite.kra
Normal file
BIN
Objects/MovingPlatform/Sprite.kra
Normal file
Binary file not shown.
BIN
Objects/MovingPlatform/Sprite.kra~
Normal file
BIN
Objects/MovingPlatform/Sprite.kra~
Normal file
Binary file not shown.
BIN
Objects/MovingPlatform/Sprite.png
Normal file
BIN
Objects/MovingPlatform/Sprite.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 242 B |
34
Objects/MovingPlatform/Sprite.png.import
Normal file
34
Objects/MovingPlatform/Sprite.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bwj4inpj7mawo"
|
||||
path="res://.godot/imported/Sprite.png-4d12e4f0bdc35ccba20a205fded1dede.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Objects/MovingPlatform/Sprite.png"
|
||||
dest_files=["res://.godot/imported/Sprite.png-4d12e4f0bdc35ccba20a205fded1dede.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
|
Loading…
Add table
Add a link
Reference in a new issue