trop de chose jpp

This commit is contained in:
2025-01-18 10:43:11 +01:00
parent 913a455d33
commit 309496c900
19 changed files with 546 additions and 21 deletions

View File

@@ -3,19 +3,15 @@ extends CharacterBody3D
@export var SPEED: float = 10.0
@export var SENSI : float = 0.005
@export var SPEED_PARTICULES: float = 1;
@export var checkpoint:Node3D = null
@export_group("Children")
@export var head: Node3D
@export var anim: AnimationPlayer
@export var particules: GPUParticles3D
var life: float = 100
var delay_shot:float = 0
var bullets:int = 11
var reloading:bool = false
var current_time_reloading: float = 0
var bump: Vector3 = Vector3.ZERO
var current_song = 0
func _ready() -> void:
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
@@ -35,6 +31,15 @@ func _physics_process(delta: float) -> void:
velocity += get_gravity() * delta * 2
else:
velocity += get_gravity() * delta * 3
if (Input.is_action_just_pressed("interact")):
var vect
if(checkpoint == null):
vect = Vector3.DOWN * SPEED_PARTICULES
else:
vect = (checkpoint.position - position).normalized() * SPEED_PARTICULES
particules.process_material.set("gravity", vect)
anim.play("finger")
var input_dir := Input.get_vector("left", "right", "up", "down")
var direction := (transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()