first
This commit is contained in:
commit
b97b3a9ae4
79 changed files with 1729 additions and 0 deletions
18
pas_touche/inter_exo/lana_exo2.gd
Normal file
18
pas_touche/inter_exo/lana_exo2.gd
Normal file
|
@ -0,0 +1,18 @@
|
|||
extends CharacterBody2D
|
||||
class_name LanaExo2
|
||||
|
||||
@export var speed := 100.0
|
||||
@export var gravity := 9.8
|
||||
@export var jump_velocity := -400.0
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
var horizontal : float = Input.get_axis("left", "right")
|
||||
|
||||
if not is_on_floor():
|
||||
velocity.y += gravity
|
||||
|
||||
if Input.is_action_just_pressed("jump") && is_on_floor():
|
||||
velocity.y += jump_velocity
|
||||
|
||||
velocity.x = horizontal * speed
|
||||
move_and_slide()
|
Loading…
Add table
Add a link
Reference in a new issue