Trim whitespaces

This commit is contained in:
Stanislas Dolcini 2018-10-04 17:14:36 +02:00
parent 9a853aad42
commit 1739361cda

View file

@ -22,7 +22,7 @@ func _ready():
camera = $Character/Camera_rotation_helper/Camera
camera.make_current()
flashlight = $Character/MeshInstance/Flashlight
func _process(delta):
process_input(delta)
process_movement(delta)
@ -34,10 +34,10 @@ func process_input(delta):
# Walking
dir = Vector3()
var cam_xform = camera.get_global_transform()
var input_movement_vector = Vector3()
var cam_scroll = 0.0
if Input.is_action_pressed("move_up"):
input_movement_vector.z += 1
if Input.is_action_pressed("move_down"):
@ -46,12 +46,12 @@ func process_input(delta):
input_movement_vector.x -= 1
if Input.is_action_pressed("move_right"):
input_movement_vector.x += 1
input_movement_vector = input_movement_vector.normalized()
dir += -cam_xform.basis.z.normalized() * input_movement_vector.z
dir += cam_xform.basis.x.normalized() * input_movement_vector.x
if Input.is_action_pressed("fly_up"):
vel.y = FLY_SPEED
elif Input.is_action_pressed("fly_down"):
@ -60,27 +60,27 @@ func process_input(delta):
vel.y = 0
func process_movement(delta):
if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
dir.y = 0
dir = dir.normalized()
# vel.y += delta*GRAVITY
var hvel = vel
hvel.y = 0
var target = dir
target *= MAX_SPEED
var accel
if dir.dot(hvel) > 0:
accel = ACCEL
else:
accel = DEACCEL
hvel = hvel.linear_interpolate(target, accel*delta)
vel.x = hvel.x
vel.z = hvel.z
@ -99,8 +99,8 @@ func process_movement(delta):
$Character.get_node( "../../GUI/HUD/Jauges/trauma/ProgressBar" ).value += 0.25
if $Character.get_node( "../../GUI/HUD/Jauges/trauma/ProgressBar" ).value >= 100:
$Character.get_node( "../../GUI/HUD/Jauges/oubli/ProgressBar" ).value += 0.25
func _input(event):
if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
@ -130,7 +130,7 @@ func _input(event):
camera.translation.x = old_x_translation
camera.translation.y = old_y_translation
camera.translation.z = clamp(camera.translation.z, 0, 5)
# TODO trouver pourquoi cela ne se fait plus:
if Input.is_action_just_pressed("game_flashlight"):
# flashlight.visible = not flashlight.visible