Bug fixes and other fixes. Migration to Godot 4.3 (RC3)
This commit is contained in:
patrick_pluto 2024-08-11 19:43:03 +02:00
commit f3350a462a
50 changed files with 578 additions and 478 deletions

View file

@ -10,7 +10,7 @@
extends CharacterBody3D
var jump_velocity = 12
var jump_velocity = 4.5
var speed = 7
var zoom = 0
var player_no
@ -47,6 +47,12 @@ func _ready():
func _physics_process(delta):
if enabled:
if Input.is_action_just_pressed("jump") and is_on_floor() and $jump_timeout.is_stopped():
if beast:
speed -= 5
$jump_timeout.start()
velocity.y = jump_velocity
if not is_on_floor():
velocity.y -= gravity * delta
@ -62,11 +68,11 @@ func _physics_process(delta):
$cam_y.position.y = 0.5
position.y += 1
if Input.is_action_pressed("click") and $hammer.rotation_degrees.x > -90:
if Input.is_action_pressed("click") and $hammer.rotation_degrees.x > 0:
$hammer.rotation_degrees.x -= 5
for id in Game.player_list:
Client.rpc_id(id,"sync_hammer",name, $hammer.rotation)
elif $hammer.rotation_degrees.x < 0 and !Input.is_action_pressed("click"):
elif $hammer.rotation_degrees.x < 90 and !Input.is_action_pressed("click"):
$hammer.rotation_degrees.x += 5
for id in Game.player_list:
Client.rpc_id(id,"sync_hammer",name, $hammer.rotation)
@ -79,16 +85,7 @@ func _physics_process(delta):
else:
velocity.x = move_toward(velocity.x, 0, speed)
velocity.z = move_toward(velocity.z, 0, speed)
if Input.is_action_just_pressed("jump") and is_on_floor() and $jump_timeout.is_stopped():
if beast:
speed -= 5
$jump_timeout.start()
if velocity.x == 0 or velocity.y == 0:
velocity.y = jump_velocity
else:
velocity.y = jump_velocity/2
move_and_slide()
if !npc:
@ -132,9 +129,9 @@ func beast_init():
beast = true
speed += 2
position.y += 10
$hammer/hammer2/CSGBox3D/detect_hit.monitoring = true
$hammer/hammer2/CSGBox3D/detect_hit.monitorable = true
$hammer/hammer2/CSGBox3D/detect_hit/CollisionShape3D.disabled = false
$hammer/CSGBox3D/detect_hit.monitoring = true
$hammer/CSGBox3D/detect_hit.monitorable = true
$hammer/CSGBox3D/detect_hit/CollisionShape3D.disabled = false
$hammer.show()
$bag.show()
@ -183,6 +180,7 @@ func _on_time_in_bag_timeout():
enabled = true
caught = false
captured_by.lost_one()
captured_by = null
position = position_pre
$in_bag.visible = false