Compare commits

...

2 Commits

Author SHA1 Message Date
Spencer Killen 4b21259716
Merge branch 'master' of https://git.sjkillen.ca/sjkillen/ABGJ-23 2023-08-19 15:48:53 -06:00
Spencer Killen 5d7d4e90bc
a 2023-08-19 15:42:56 -06:00
11 changed files with 35 additions and 9 deletions

Binary file not shown.

BIN
blends/giant.blend1 Normal file

Binary file not shown.

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

Binary file not shown.

View File

@ -136,18 +136,15 @@ xfade_time = 0.3
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_y2dr5"]
xfade_time = 0.3
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_ubbuf"]
xfade_time = 0.3
[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_6mfdu"]
states/IdleEmpty/node = SubResource("AnimationNodeBlendTree_ojr1k")
states/IdleEmpty/position = Vector2(315, 186)
states/IdleHold/node = SubResource("AnimationNodeBlendTree_v72vt")
states/IdleHold/position = Vector2(592, 349)
states/Pickup/node = SubResource("AnimationNodeAnimation_rrdxi")
states/Pickup/position = Vector2(711, 105)
states/Pickup/position = Vector2(734, 117)
states/WalkEmpty/node = SubResource("AnimationNodeBlendTree_6rmmo")
states/WalkEmpty/position = Vector2(619, 219)
states/WalkEmpty/position = Vector2(548, 208)
states/WalkHold/node = SubResource("AnimationNodeBlendTree_kalnq")
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")]

View File

@ -6,6 +6,7 @@ const JUMP_VELOCITY = 4.5
@export var horiz_sens = 0.25
@export var vert_sens = 0.25
var holding: WeakRef = weakref(null)
# Get the gravity from the project settings to be synced with RigidBody nodes.
@ -29,9 +30,21 @@ func _input(event):
$CameraMount.rotate_x(deg_to_rad(-event.relative.y * vert_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))
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):
if $grape_man.pickup_animation_in_progress:
return
# Add the gravity.
if not is_on_floor():
velocity.y -= gravity * delta
@ -40,6 +53,10 @@ func _physics_process(delta):
# Get the input direction and handle the movement/deceleration.
# 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 direction = (transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()
if direction:
velocity.x = direction.x * SPEED
@ -49,10 +66,20 @@ func _physics_process(delta):
$grape_man.global_position.y,
$grape_man.global_position.z - velocity.z,
))
$grape_man.walk_empty()
if holding.get_ref():
$grape_man.walk_hold()
else:
$grape_man.walk_empty()
else:
$grape_man.idle_empty()
if holding.get_ref():
$grape_man.idle_hold()
else:
$grape_man.idle_empty()
velocity.x = move_toward(velocity.x, 0, SPEED)
velocity.z = move_toward(velocity.z, 0, SPEED)
move_and_slide()
func _on_grape_man_anim_check_grab(_position):
holding = weakref(self)

View File

@ -20,3 +20,5 @@ 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)
current = true
fov = 50.0
[connection signal="anim_check_grab" from="grape_man" to="." method="_on_grape_man_anim_check_grab"]