ready for live testing!

This commit is contained in:
Clevertop 2024-05-18 23:03:14 +10:00
parent 42d238a2f8
commit e3200c8416
5 changed files with 139 additions and 25 deletions

View file

@ -24,6 +24,8 @@ extends Node3D
#Other Variables (please try to separate and organise!)
var current_block : RigidBody3D
var tar_rotation : Vector3
var tar_position : Vector3
#endregion
@ -31,7 +33,15 @@ var current_block : RigidBody3D
func _ready():
#Runs when all children have entered the tree
pass
func _process(delta):
#var target_vector = global_position.direction_to(player_position)
#var target_basis= Basis.looking_at(target_vector)
#basis = basis.slerp(target_basis, 0.5)
rotation_degrees = lerp(rotation_degrees, tar_rotation, 0.1)
position = lerp(position, tar_position, 0.1)
gizmo_node.rotation_degrees = rotation_degrees
#endregion
@ -46,17 +56,20 @@ func _on_twitch_link_move_block(direction, amount):
"east" : dir = Vector3.RIGHT
"south" : dir = Vector3.BACK
"west" : dir = Vector3.LEFT
position += dir * amount * moveScale
tar_position = position
tar_position += dir * amount * moveScale
#position += dir * amount * moveScale
func _on_twitch_link_rotate_block(direction, amount):
var dir : Vector3
match direction:
"x": dir = Vector3.RIGHT
"y" : dir = Vector3.UP
"z" : dir = Vector3.BACK
rotation_degrees += dir * amount
gizmo_node.rotation_degrees = rotation_degrees
"x": dir.x = 1
"y" : dir.y = 1
"z" : dir.z = 1
#rotation_degrees += dir * amount
tar_rotation = rotation_degrees
tar_rotation += dir * amount
func _on_twitch_link_drop_block():
current_block.freeze = false
@ -69,7 +82,9 @@ func _on_twitch_link_start_turn():
current_block = block_scene.instantiate()
current_block.freeze = true
add_child(current_block)
func _on_jenga_panic_drop():
_on_twitch_link_drop_block()
#endregion
@ -83,3 +98,6 @@ func _on_twitch_link_start_turn():