Sokoban 1.1.2
Le fameux jeu Sokoban, poussez les boîtes !
Chargement...
Recherche...
Aucune correspondance
player.h
Aller à la documentation de ce fichier.
1/*
2Player and player movement related data structures for Sokoban
3Copyright (C) 2022, 2023 Efe ERKEN
4
5This file is part of Sokoban
6
7Sokoban is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation, either version 3 of the License, or
10(at your option) any later version.
11
12Sokoban is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with Sokoban. If not, see <https://www.gnu.org/licenses/>.
19
20SPDX-License-Identifier: GPL-3.0-or-later
21*/
22
23#ifndef PLAYER_HEADER
24#define PLAYER_HEADER
25
37struct Grid;
38typedef struct Grid grid;
39
45typedef struct Player
46{
47 int x;
48 int y;
50
60{
61 LEFT = 'h',
62 BOTTOM = 'j',
63 TOP = 'k',
64 RIGHT = 'l'
65};
66
67void move_player(grid *G, enum Direction D);
68
69void move_player_error(grid* G);
70
71#endif
void move_player(grid *G, enum Direction D)
Fonction qui bouge le joueur dans la direction voulue dans le niveau.
Definition: player.c:65
void move_player_error(grid *G)
Fonction qui affiche un message d'erreur et quitte le jeu.
Definition: player.c:169
Direction
Cette structure contient les directions possibles dans le jeu.
Definition: player.h:60
@ TOP
La direction haute.
Definition: player.h:63
@ BOTTOM
La direction basse.
Definition: player.h:62
@ LEFT
La direction gauche.
Definition: player.h:61
@ RIGHT
La direction droite.
Definition: player.h:64
struct Player player
Cette structure contient la position du joueur dans le niveau.
Cette structure contient les informations concernant le niveau du jeu et son contenu.
Definition: grid.h:84
Cette structure contient la position du joueur dans le niveau.
Definition: player.h:46
int y
Coordonnée y du joueur.
Definition: player.h:48
int x
Coordonnée x du joueur.
Definition: player.h:47