fixed jump pad, started work on machete

This commit is contained in:
derek
2025-01-27 16:55:45 -06:00
parent f1c5b08c38
commit 61dad77f04
86 changed files with 1787 additions and 148 deletions

View File

@@ -2,6 +2,9 @@ extends Area3D
@onready var collision_midpoint: Node3D = $CollisionMidpoint
var player
var player_on_ladder = false
# Called when the node enters the scene tree for the first time.
func _ready():
pass
@@ -10,15 +13,27 @@ func _ready():
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
#if player != null:
#if player.is_climbing:
#hold_player()
func _on_body_entered(body):
if body.is_in_group("player"):
body.is_climbing = true
if body.global_position.y < collision_midpoint.global_position.y:
body.global_position.y += .2
#else:
#body.velocity = Vector3(0,0,0)
#body.global_position = Vector3(global_position.x,body.global_position.y,global_position.z)
func _on_body_exited(body):
if body.is_in_group("player"):
body.is_climbing = false
player_on_ladder = false
body.velocity.y = .1
body.gravity = body.default_gravity
func hold_player():
var direction_to_ladder = player.global_position.direction_to(self.global_position)
player.velocity = Vector3(direction_to_ladder.x * 10,player.velocity.y,direction_to_ladder.z * 10)