Compare commits

...

6 Commits

Author SHA1 Message Date
Félix MARQUET
52a6e9bdf3 Update README.md 2025-01-05 18:35:22 +01:00
Félix MARQUET
909f075695 Merge pull request #35 from BreizhHardware/fix-patch-535414755
fix: update player sprite timing and tick threshold
2024-12-19 15:57:08 +01:00
StevSpotted
3033f56820 fix: update player sprite timing and tick threshold 2024-12-19 15:55:42 +01:00
565dd66b02 Fix player speed 2024-12-19 13:49:10 +01:00
b72aceb55f Fix player speed 2024-12-19 13:46:23 +01:00
933fa18cc6 hvbjabfa 2024-12-19 12:38:42 +01:00
9 changed files with 31 additions and 15 deletions

View File

@@ -25,17 +25,17 @@ void Player::draw(SDL_Renderer* renderer) {
case 0:
this->currentSprite = PLAYER_SPRITE_1;
break;
case 5:
case 50:
this->currentSprite = PLAYER_SPRITE_2;
break;
case 8:
case 150:
this->currentSprite = PLAYER_SPRITE_3;
break;
default:
break;
}
if (this->ticks >= 8) {
if (this->ticks >= 150) {
this->ticks = 0;
} else {
this->ticks++;
@@ -55,11 +55,12 @@ void Player::handlePlayerMovement(int ENV_WIDTH, int ENV_HEIGHT, int windowWidth
int tempY = this->y;
int speed = this->playerSpeed;
bool isSprinting = false;
/*
if (keystate[SDL_SCANCODE_LSHIFT]) {
speed = this->playerSpeed * 2;
isSprinting = true;
}
*/
bool moved = false;
if (this->energy != 0) {
if (isPlayingOnline) {

View File

@@ -56,7 +56,7 @@ int pas_la_fontion_main_enfin_ce_nest_pas_la_fontion_principale_du_programme_mai
//std::thread quit_thread = createThread("Quit thread", handleQuitThread);
// Offline
players.emplace_back(Player(windowWidth / 2, windowHeight / 2, 5, renderer, 0));
players.emplace_back(Player(windowWidth / 2, windowHeight / 2, 3, renderer, 0));
std::thread player_thread = createThread("Player thread", playerMovementThread, std::ref(players[0]));

View File

@@ -6,7 +6,6 @@ Le jeu est codé en C++ avec la librairie SDL2.
# 🌱 Branches en développement
- `main` : La branche principale du projet
- `WII-U` : La branche pour la version Wii-U du jeu
- `SDL3-2.0` : La branche pour la version SDL3 du jeu
# 🚀 Installation et configuration
## Prérequis
@@ -20,15 +19,6 @@ Le jeu est codé en C++ avec la librairie SDL2.
- [GCC](https://gcc.gnu.org/)
- [Make](https://www.gnu.org/software/make/)
## Lancement avec la binaire
1. Téléchargez la dernière version de l'application
```bash
https://github.com/BreizhHardware/bloubloulespoissons/releases
```
2. Executez le fichier .exe
3. Jouez
## Compilation et lancement
1. Clonez le dépôt
```bash

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 60 KiB

25
xxd_convert.sh Normal file
View File

@@ -0,0 +1,25 @@
#!/bin/bash
# Vérifie si un argument de dossier est fourni
if [ $# -ne 1 ]; then
echo "Usage: $0 <dossier>"
exit 1
fi
# Vérifie si le dossier existe
DIR=$1
if [ ! -d "$DIR" ]; then
echo "Erreur : Le dossier '$DIR' n'existe pas."
exit 1
fi
# Parcourt tous les fichiers .png du dossier et sous-dossiers
find "$DIR" -type f -name "*.ttf" | while read -r file; do
# Récupère le nom du fichier sans extension
base_name=$(basename "$file" .ttf)
# Définit le nom de sortie avec extension .h
output_file="${file%/*}/${base_name}.h"
# Exécute la commande xxd -i
xxd -i "$file" > "$output_file"
echo "Converti : $file -> $output_file"
done