Solve conflict (Incoming first)

This commit is contained in:
Renarde-dev 2025-01-24 13:24:17 +01:00
commit 3a68d2d5e6
Signed by: renarde
GPG key ID: 5B8FE0B3816369DE
8 changed files with 22 additions and 5 deletions

View file

@ -2,7 +2,7 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://d3781jh436rv5"
uid="uid://iwrdb61rkpsx"
path="res://.godot/imported/cgj_default_tile.svg-6f24db072965547b576ce8b63fbe7ec8.ctex"
metadata={
"vram_texture": false

View file

@ -2,7 +2,7 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://bx7y5g64mwddk"
uid="uid://d1d462gptgad8"
path="res://.godot/imported/cgj_tile_1.svg-6f1497fb2775a0586cdf5be113ac6ba6.ctex"
metadata={
"vram_texture": false

View file

@ -2,7 +2,7 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://3gcqt2o2g5yu"
uid="uid://rey6oul5tla0"
path="res://.godot/imported/cgj_tile_2.svg-1008c878b662a507cf2fef633a6dc4aa.ctex"
metadata={
"vram_texture": false

BIN
ressources/sons/flute-1.mp3 Normal file

Binary file not shown.

BIN
ressources/sons/flute-2.mp3 Normal file

Binary file not shown.

BIN
ressources/sons/flute-3.mp3 Normal file

Binary file not shown.

BIN
ressources/sons/flute-4.mp3 Normal file

Binary file not shown.

View file

@ -1,6 +1,12 @@
extends CharacterBody2D
const move_speed = 400
const acceleration = 0.25
const max_boost_speed = 800
var previous_direction = Vector2.ZERO
var boost_speed = 0
func _physics_process(delta: float) -> void:
move_and_slide()
@ -10,6 +16,17 @@ func _process(delta: float) -> void:
direction.x = Input.get_action_raw_strength("BOUGER_DROITE") - Input.get_action_raw_strength("BOUGER_GAUCHE")
direction.y = Input.get_action_raw_strength("BOUGER_BAS") - Input.get_action_raw_strength("BOUGER_HAUT")
velocity = direction * move_speed
if direction != Vector2.ZERO:
if direction.normalized() == previous_direction.normalized():
if direction.x != 0 and direction.y != 0:
boost_speed = min(boost_speed + acceleration / 8, (max_boost_speed - move_speed) / 8)
else:
boost_speed = min(boost_speed + acceleration, max_boost_speed - move_speed)
else:
boost_speed = 0
previous_direction = direction
velocity = direction * (move_speed + boost_speed)
print(velocity)
pass