Ajout de mélodie, des murs et des notes #tropBeau #melodieLaBest #slay #lesGaufresDeMrLanoix
This commit is contained in:
commit
52022128af
8 changed files with 31 additions and 2 deletions
|
@ -2,7 +2,11 @@
|
||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
|
<<<<<<< HEAD
|
||||||
uid="uid://2o4w65so8ahw"
|
uid="uid://2o4w65so8ahw"
|
||||||
|
=======
|
||||||
|
uid="uid://iwrdb61rkpsx"
|
||||||
|
>>>>>>> 9819eb73e1e97eb41a466d3202753cc9f8b5b0de
|
||||||
path="res://.godot/imported/cgj_default_tile.svg-6f24db072965547b576ce8b63fbe7ec8.ctex"
|
path="res://.godot/imported/cgj_default_tile.svg-6f24db072965547b576ce8b63fbe7ec8.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
|
|
|
@ -2,7 +2,11 @@
|
||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
|
<<<<<<< HEAD
|
||||||
uid="uid://crl12jj80ttb3"
|
uid="uid://crl12jj80ttb3"
|
||||||
|
=======
|
||||||
|
uid="uid://d1d462gptgad8"
|
||||||
|
>>>>>>> 9819eb73e1e97eb41a466d3202753cc9f8b5b0de
|
||||||
path="res://.godot/imported/cgj_tile_1.svg-6f1497fb2775a0586cdf5be113ac6ba6.ctex"
|
path="res://.godot/imported/cgj_tile_1.svg-6f1497fb2775a0586cdf5be113ac6ba6.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
|
|
|
@ -2,7 +2,11 @@
|
||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
|
<<<<<<< HEAD
|
||||||
uid="uid://drnrvixq01dqp"
|
uid="uid://drnrvixq01dqp"
|
||||||
|
=======
|
||||||
|
uid="uid://rey6oul5tla0"
|
||||||
|
>>>>>>> 9819eb73e1e97eb41a466d3202753cc9f8b5b0de
|
||||||
path="res://.godot/imported/cgj_tile_2.svg-1008c878b662a507cf2fef633a6dc4aa.ctex"
|
path="res://.godot/imported/cgj_tile_2.svg-1008c878b662a507cf2fef633a6dc4aa.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
|
|
BIN
ressources/sons/flute-1.mp3
Normal file
BIN
ressources/sons/flute-1.mp3
Normal file
Binary file not shown.
BIN
ressources/sons/flute-2.mp3
Normal file
BIN
ressources/sons/flute-2.mp3
Normal file
Binary file not shown.
BIN
ressources/sons/flute-3.mp3
Normal file
BIN
ressources/sons/flute-3.mp3
Normal file
Binary file not shown.
BIN
ressources/sons/flute-4.mp3
Normal file
BIN
ressources/sons/flute-4.mp3
Normal file
Binary file not shown.
|
@ -1,6 +1,12 @@
|
||||||
extends CharacterBody2D
|
extends CharacterBody2D
|
||||||
|
|
||||||
const move_speed = 400
|
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:
|
func _physics_process(delta: float) -> void:
|
||||||
move_and_slide()
|
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.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")
|
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
|
pass
|
||||||
|
|
Loading…
Add table
Reference in a new issue