Compare commits

..

No commits in common. "4b21259716755ccdb3d189a752d8a22ae1c208e6" and "55ae507421fd9919c3654d6ec5441a5204462769" have entirely different histories.

11 changed files with 9 additions and 35 deletions

Binary file not shown.

Binary file not shown.

BIN
godot/Models/grape_man.glb (Stored with Git LFS)

Binary file not shown.

View File

@ -136,15 +136,18 @@ xfade_time = 0.3
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_y2dr5"] [sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_y2dr5"]
xfade_time = 0.3 xfade_time = 0.3
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_ubbuf"]
xfade_time = 0.3
[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_6mfdu"] [sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_6mfdu"]
states/IdleEmpty/node = SubResource("AnimationNodeBlendTree_ojr1k") states/IdleEmpty/node = SubResource("AnimationNodeBlendTree_ojr1k")
states/IdleEmpty/position = Vector2(315, 186) states/IdleEmpty/position = Vector2(315, 186)
states/IdleHold/node = SubResource("AnimationNodeBlendTree_v72vt") states/IdleHold/node = SubResource("AnimationNodeBlendTree_v72vt")
states/IdleHold/position = Vector2(592, 349) states/IdleHold/position = Vector2(592, 349)
states/Pickup/node = SubResource("AnimationNodeAnimation_rrdxi") states/Pickup/node = SubResource("AnimationNodeAnimation_rrdxi")
states/Pickup/position = Vector2(734, 117) states/Pickup/position = Vector2(711, 105)
states/WalkEmpty/node = SubResource("AnimationNodeBlendTree_6rmmo") states/WalkEmpty/node = SubResource("AnimationNodeBlendTree_6rmmo")
states/WalkEmpty/position = Vector2(548, 208) states/WalkEmpty/position = Vector2(619, 219)
states/WalkHold/node = SubResource("AnimationNodeBlendTree_kalnq") states/WalkHold/node = SubResource("AnimationNodeBlendTree_kalnq")
states/WalkHold/position = Vector2(351, 323) states/WalkHold/position = Vector2(351, 323)
transitions = ["Start", "IdleEmpty", SubResource("AnimationNodeStateMachineTransition_8sw6d"), "IdleEmpty", "WalkHold", SubResource("AnimationNodeStateMachineTransition_71rn8"), "WalkHold", "IdleEmpty", SubResource("AnimationNodeStateMachineTransition_cp7lp"), "WalkEmpty", "IdleEmpty", SubResource("AnimationNodeStateMachineTransition_27n2r"), "IdleEmpty", "WalkEmpty", SubResource("AnimationNodeStateMachineTransition_v26jl"), "IdleHold", "WalkHold", SubResource("AnimationNodeStateMachineTransition_u0rau"), "IdleHold", "WalkEmpty", SubResource("AnimationNodeStateMachineTransition_1hqga"), "WalkEmpty", "IdleHold", SubResource("AnimationNodeStateMachineTransition_uekhs"), "WalkHold", "IdleHold", SubResource("AnimationNodeStateMachineTransition_652wi"), "IdleEmpty", "Pickup", SubResource("AnimationNodeStateMachineTransition_sdgve"), "Pickup", "IdleEmpty", SubResource("AnimationNodeStateMachineTransition_otprv"), "IdleEmpty", "IdleHold", SubResource("AnimationNodeStateMachineTransition_fbwhh"), "IdleHold", "IdleEmpty", SubResource("AnimationNodeStateMachineTransition_4rq7a"), "WalkHold", "WalkEmpty", SubResource("AnimationNodeStateMachineTransition_oange"), "WalkEmpty", "WalkHold", SubResource("AnimationNodeStateMachineTransition_et4tx"), "Pickup", "IdleHold", SubResource("AnimationNodeStateMachineTransition_y2dr5"), "IdleHold", "Pickup", SubResource("AnimationNodeStateMachineTransition_ubbuf")] transitions = ["Start", "IdleEmpty", SubResource("AnimationNodeStateMachineTransition_8sw6d"), "IdleEmpty", "WalkHold", SubResource("AnimationNodeStateMachineTransition_71rn8"), "WalkHold", "IdleEmpty", SubResource("AnimationNodeStateMachineTransition_cp7lp"), "WalkEmpty", "IdleEmpty", SubResource("AnimationNodeStateMachineTransition_27n2r"), "IdleEmpty", "WalkEmpty", SubResource("AnimationNodeStateMachineTransition_v26jl"), "IdleHold", "WalkHold", SubResource("AnimationNodeStateMachineTransition_u0rau"), "IdleHold", "WalkEmpty", SubResource("AnimationNodeStateMachineTransition_1hqga"), "WalkEmpty", "IdleHold", SubResource("AnimationNodeStateMachineTransition_uekhs"), "WalkHold", "IdleHold", SubResource("AnimationNodeStateMachineTransition_652wi"), "IdleEmpty", "Pickup", SubResource("AnimationNodeStateMachineTransition_sdgve"), "Pickup", "IdleEmpty", SubResource("AnimationNodeStateMachineTransition_otprv"), "IdleEmpty", "IdleHold", SubResource("AnimationNodeStateMachineTransition_fbwhh"), "IdleHold", "IdleEmpty", SubResource("AnimationNodeStateMachineTransition_4rq7a"), "WalkHold", "WalkEmpty", SubResource("AnimationNodeStateMachineTransition_oange"), "WalkEmpty", "WalkHold", SubResource("AnimationNodeStateMachineTransition_et4tx"), "Pickup", "IdleHold", SubResource("AnimationNodeStateMachineTransition_y2dr5"), "IdleHold", "Pickup", SubResource("AnimationNodeStateMachineTransition_ubbuf")]

View File

@ -6,7 +6,6 @@ const JUMP_VELOCITY = 4.5
@export var horiz_sens = 0.25 @export var horiz_sens = 0.25
@export var vert_sens = 0.25 @export var vert_sens = 0.25
var holding: WeakRef = weakref(null) var holding: WeakRef = weakref(null)
# Get the gravity from the project settings to be synced with RigidBody nodes. # Get the gravity from the project settings to be synced with RigidBody nodes.
@ -31,20 +30,8 @@ func _input(event):
$grape_man.rotate_y(deg_to_rad(event.relative.x * horiz_sens)) $grape_man.rotate_y(deg_to_rad(event.relative.x * horiz_sens))
$CameraMount.global_rotation.x = clampf($CameraMount.global_rotation.x, deg_to_rad(-60), deg_to_rad(-11)) $CameraMount.global_rotation.x = clampf($CameraMount.global_rotation.x, deg_to_rad(-60), deg_to_rad(-11))
if Input.is_action_just_pressed("ui_accept"):
var obj = holding.get_ref()
if obj:
holding = weakref(null)
else:
$grape_man.pickup()
func _physics_process(delta): func _physics_process(delta):
if $grape_man.pickup_animation_in_progress:
return
# Add the gravity. # Add the gravity.
if not is_on_floor(): if not is_on_floor():
velocity.y -= gravity * delta velocity.y -= gravity * delta
@ -53,10 +40,6 @@ func _physics_process(delta):
# Get the input direction and handle the movement/deceleration. # Get the input direction and handle the movement/deceleration.
# As good practice, you should replace UI actions with custom gameplay actions. # As good practice, you should replace UI actions with custom gameplay actions.
var input_dir = Input.get_vector("ui_left", "ui_right", "ui_up", "ui_down") var input_dir = Input.get_vector("ui_left", "ui_right", "ui_up", "ui_down")
var direction = (transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized() var direction = (transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()
if direction: if direction:
velocity.x = direction.x * SPEED velocity.x = direction.x * SPEED
@ -66,20 +49,10 @@ func _physics_process(delta):
$grape_man.global_position.y, $grape_man.global_position.y,
$grape_man.global_position.z - velocity.z, $grape_man.global_position.z - velocity.z,
)) ))
if holding.get_ref():
$grape_man.walk_hold()
else:
$grape_man.walk_empty() $grape_man.walk_empty()
else:
if holding.get_ref():
$grape_man.idle_hold()
else: else:
$grape_man.idle_empty() $grape_man.idle_empty()
velocity.x = move_toward(velocity.x, 0, SPEED) velocity.x = move_toward(velocity.x, 0, SPEED)
velocity.z = move_toward(velocity.z, 0, SPEED) velocity.z = move_toward(velocity.z, 0, SPEED)
move_and_slide() move_and_slide()
func _on_grape_man_anim_check_grab(_position):
holding = weakref(self)

View File

@ -20,5 +20,3 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.3, 0)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1.39043) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1.39043)
current = true current = true
fov = 50.0 fov = 50.0
[connection signal="anim_check_grab" from="grape_man" to="." method="_on_grape_man_anim_check_grab"]