first
This commit is contained in:
commit
b97b3a9ae4
79 changed files with 1729 additions and 0 deletions
19
pas_touche/inter_exo/lana.tscn
Normal file
19
pas_touche/inter_exo/lana.tscn
Normal file
|
@ -0,0 +1,19 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://hb5qh45e6x1s"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b45k3pjypqcv2" path="res://pas_touche/scripts/lana.gd" id="1_7rpys"]
|
||||
[ext_resource type="Texture2D" uid="uid://4g6qnykfjdba" path="res://exo1/assets/logo-CELL.png" id="2_ge1bf"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_disjo"]
|
||||
radius = 71.0282
|
||||
|
||||
[node name="Lana" type="CharacterBody2D"]
|
||||
script = ExtResource("1_7rpys")
|
||||
speed = 150.0
|
||||
|
||||
[node name="Logo-cell" type="Sprite2D" parent="."]
|
||||
rotation = 3.14159
|
||||
scale = Vector2(0.05, 0.05)
|
||||
texture = ExtResource("2_ge1bf")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("CircleShape2D_disjo")
|
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()
|
1
pas_touche/inter_exo/lana_exo2.gd.uid
Normal file
1
pas_touche/inter_exo/lana_exo2.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://dgakeqjbc0eyv
|
11
pas_touche/scripts/lana.gd
Normal file
11
pas_touche/scripts/lana.gd
Normal file
|
@ -0,0 +1,11 @@
|
|||
extends CharacterBody2D
|
||||
class_name Lana
|
||||
|
||||
@export var speed := 100.0
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
var horizontal : float = Input.get_axis("left", "right")
|
||||
var vertical : float = Input.get_axis("top", "bottom")
|
||||
|
||||
velocity = Vector2(horizontal, vertical).normalized() * speed
|
||||
move_and_slide()
|
1
pas_touche/scripts/lana.gd.uid
Normal file
1
pas_touche/scripts/lana.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://b45k3pjypqcv2
|
Loading…
Add table
Add a link
Reference in a new issue