Browse Source

Cleanup

pull/1/head
Ryan Reed 1 month ago
parent
commit
7d5a44e727
2 changed files with 7 additions and 6 deletions
  1. +3
    -3
      project.godot
  2. +4
    -3
      scenes/characters/player.gd

+ 3
- 3
project.godot View File

@ -19,7 +19,6 @@ config/icon="res://icon.svg"
gdscript/warnings/untyped_declaration=1 gdscript/warnings/untyped_declaration=1
gdscript/warnings/inferred_declaration=1 gdscript/warnings/inferred_declaration=1
gdscript/warnings/unsafe_property_access=1
gdscript/warnings/unsafe_method_access=1 gdscript/warnings/unsafe_method_access=1
[file_customization] [file_customization]
@ -27,9 +26,10 @@ gdscript/warnings/unsafe_method_access=1
folder_colors={ folder_colors={
"res://assets/": "red", "res://assets/": "red",
"res://assets/ui/": "green", "res://assets/ui/": "green",
"res://data_structure/": "blue",
"res://resources/": "blue",
"res://scenes/": "yellow", "res://scenes/": "yellow",
"res://scenes/ui/": "green",
"res://ui/": "green"
"res://scenes/ui/": "green"
} }
[input] [input]


+ 4
- 3
scenes/characters/player.gd View File

@ -3,8 +3,8 @@ extends CharacterBody3D
@export var jump_velocity: float = 4.5 @export var jump_velocity: float = 4.5
@export var mouse_sensitivity_horizontal: float = 0.003
@export var mouse_sensitivity_vertical: float = 0.003
@export var mouse_sensitivity_horizontal: float = 0.002
@export var mouse_sensitivity_vertical: float = 0.002
@export var speed: float = 5.0 @export var speed: float = 5.0
@ -28,7 +28,8 @@ func apply_gravity(delta: float) -> void:
velocity += get_gravity() * delta velocity += get_gravity() * delta
func handle_jump() -> void: func handle_jump() -> void:
if not Input.is_action_just_pressed("jump") or not is_on_floor(): return
if not Input.is_action_just_pressed("jump"): return
if not is_on_floor(): return
velocity.y = jump_velocity velocity.y = jump_velocity
func handle_mouse_movement(event: InputEvent) -> void: func handle_mouse_movement(event: InputEvent) -> void:


Loading…
Cancel
Save