Moving block added (buggy)

This commit is contained in:
debugman18 committed 2026-10-18 16:10:14 -05:00
1 parent 0209b1d02e
commit 8fa42abc6f
4 files changed
+35

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
extends RigidBody2D
var max_distance = position + Vector2(1,0)
func _ready() -> void:
print("START POSITION: " + str(position))
pass
func _process(delta: float) -> void:
print("NEW POSITION :" + str(position))
position.x = move_toward(position.x, max_distance.x, 1)
+1
View File
@@ -0,0 +1 @@
uid://yaqgvctkobnq
+19
View File
@@ -0,0 +1,19 @@
[gd_scene format=3 uid="uid://div6quttr84u1"]
[ext_resource type="Script" uid="uid://yaqgvctkobnq" path="res://horizontal_moving_block.gd" id="1_3uo2v"]
[ext_resource type="Texture2D" uid="uid://blbaaqyrt8dtk" path="res://art/block/block.png" id="1_m1vtb"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_f3sb7"]
size = Vector2(16, 14)
[node name="Block" type="RigidBody2D" unique_id=1409784601]
gravity_scale = 0.0
freeze = true
script = ExtResource("1_3uo2v")
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1866755047]
shape = SubResource("RectangleShape2D_f3sb7")
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=1680278216]
texture_filter = 1
texture = ExtResource("1_m1vtb")
+4
View File
@@ -33,6 +33,7 @@
[ext_resource type="Script" uid="uid://b65drnv6461kp" path="res://hidden_spike.gd" id="29_qktwf"]
[ext_resource type="PackedScene" uid="uid://big8haq2m0jxw" path="res://sign_arrow.tscn" id="30_bh8nc"]
[ext_resource type="PackedScene" uid="uid://cue2gfw1bdfh7" path="res://sign_arrow_up.tscn" id="31_jjr1n"]
[ext_resource type="PackedScene" uid="uid://div6quttr84u1" path="res://horizontal_moving_block.tscn" id="34_w44yn"]
[node name="World" type="Node2D" unique_id=1327991900]
process_mode = 1
@@ -936,4 +937,7 @@ position = Vector2(-149, -643.96545)
position = Vector2(-189, -645.93475)
sign_text = "TAKE A LEAP"
[node name="Block20" parent="." unique_id=1489084043 instance=ExtResource("34_w44yn")]
position = Vector2(-4824, 299.3356)
[connection signal="toggled" from="CanvasLayer/MusicButton" to="CanvasLayer/MusicButton" method="_on_toggled"]