Skip to content
Snippets Groups Projects
Commit 0342bdc7 authored by Le-Bao-Tin.Ha's avatar Le-Bao-Tin.Ha
Browse files
parents bf74831c 4c49cf6f
No related branches found
No related tags found
4 merge requests!8Modele,!7Modele,!6Modele,!5Modele Version 1
...@@ -92,6 +92,7 @@ REPARTITION DES ROLES ...@@ -92,6 +92,7 @@ REPARTITION DES ROLES
*****Réunion du 11/02/2021 à 16h***** *****Réunion du 11/02/2021 à 16h*****
Finalisation du diagramme de Gantt Finalisation du diagramme de Gantt
...@@ -118,4 +119,20 @@ Pour le controleur, plusieurs options : une branche s ...@@ -118,4 +119,20 @@ Pour le controleur, plusieurs options : une branche s
*****Réunion du 18/02/2021 à 13h30*****
\ No newline at end of file *****Réunion du 18/02/2021 à 13h30*****
Répartiton du travail dans chaque sous-équipe
Mise en accord sur les normes (position personnage etc) entre les 2 sous-équipes
=> Prochaine réunion de l'équipe : jeudi 25 février à 13h30
*****Réunion du 25/02/2021 à 13h30*****
Matrice fonctionnelle opérationnelle
Fonctions d'initialisation en cours.
=> Prochaine réunion de l'équipe :
\ No newline at end of file
...@@ -2,12 +2,30 @@ ...@@ -2,12 +2,30 @@
// Created by Lucile on 18/02/2021. // Created by Lucile on 18/02/2021.
*/ */
/*!
* \file DS.h
* \brief DS Header File
* \authors Lucile
* \version 1
* \date 25/02/2021
*
* DS structure definiton.
*
*/
#ifndef INSAGAME_DS_H #ifndef INSAGAME_DS_H
#define INSAGAME_DS_H #define INSAGAME_DS_H
struct DS { /*!
int door; * \struct DS
char * image_DS; * \brief DS structure
}; */
typedef struct {
int door; /**< Integer representing the door number i.e. the DS location. */
char * image_DS; /**< Source image of the DS. */
} DS;
int init_DS(DS * exam, int door_DS, char * path);
#endif /*INSAGAME_DS_H*/ #endif /*INSAGAME_DS_H*/
...@@ -2,18 +2,34 @@ ...@@ -2,18 +2,34 @@
// Created by Tiny on 2/16/2021. // Created by Tiny on 2/16/2021.
*/ */
/*!
* \file map.h
* \brief Map Header File
* \authors Tin
* \version 1
* \date 16/02/2021
*
* Map structure and functions definiton.
*
*/
#ifndef INSAGAME_MAP_H #ifndef INSAGAME_MAP_H
#define INSAGAME_MAP_H #define INSAGAME_MAP_H
/*!
* \struct MAP
* \brief Map structure
*/
typedef struct { typedef struct {
char *path; //path of image bmp of map char *path; /**< Path of image bmp of map */
int width; int width; /**< Map's width */
int height; int height; /**< Map's height */
int **functional; //2D functional matrix int **functional; /**< 2D functional matrix */
} MAP; } MAP;
int initmap(MAP *map,char *path); //allocate the map's name and call the maptomatrix int initmap(MAP *map,char *path);
int **maptomatrix(MAP *map); //get matrix'length and width => create a functional matrix from the bmp matrix int **maptomatrix(MAP *map);
......
...@@ -2,16 +2,34 @@ ...@@ -2,16 +2,34 @@
// Created by Lucile on 18/02/2021. // Created by Lucile on 18/02/2021.
*/ */
/*!
* \file personnage.h
* \brief Character Header File
* \authors Lucile
* \version 1
* \date 25/02/2021
*
* Character structure and functions definiton.
*
*/
#ifndef GAME_INSA_PROJECT_PERSONNAGE_H #ifndef GAME_INSA_PROJECT_PERSONNAGE_H
#define GAME_INSA_PROJECT_PERSONNAGE_H #define GAME_INSA_PROJECT_PERSONNAGE_H
struct personnage { /*!
int x_pers; * \struct Personnage
int y_pers; * \brief Character structure
int long_pers; */
int larg_pers;
int speed_pers; typedef struct {
char * image_pers; int x_pers; /**< Position : abscissa */
}; int y_pers; /**< Position : ordinate */
int long_pers; /**< Size : length */
int larg_pers; /**< Size : width */
int speed_pers; /**< Charater speed */
char * image_pers; /**< Source image of the character. */
}Personnage;
int init_pers(Personnage * character, int x, int y, int length, int width, int speed, char * path);
#endif /*GAME_INSA_PROJECT_PERSONNAGE_H*/ #endif /*GAME_INSA_PROJECT_PERSONNAGE_H*/
...@@ -2,7 +2,37 @@ ...@@ -2,7 +2,37 @@
// Created by CABANTOUS corto on 18/02/2021. // Created by CABANTOUS corto on 18/02/2021.
// //
#ifndef PROJET_PROF_H
#define PROJET_PROF_H
#endif //PROJET_PROF_H
/*!
* \file prof.h
* \brief Teacher Header File
* \authors Corto
* \version 1
* \date 25/02/2021
*
* Teacher structure and functions definiton.
*
*/
#ifndef GAME_INSA_PROJECT_PROF_H
#define GAME_INSA_PROJECT_PROF_H
/*!
* \struct Prof
* \brief Teacher structure
*/
typedef struct {
int x_prof; /**< Position : abscissa */
int y_prof; /**< Position : ordinate */
int long_prof; /**< Size : length */
int larg_prof; /**< Size : width */
int speed_prof; /**< Teacher speed */
char * image_prof; /**< Source image of the character. */
} Prof;
#endif /*GAME_INSA_PROJECT_Prof_H*/
/*
// Created by Lucile on 02/03/2021.
*/
/*!
* \file DS.c
* \brief Exam Source File
* \authors Lucile
* \version 1
* \date 02/03/2021
*
* Character function implementation.
*
*/
#include <stdio.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include "DS.h"
/*!
* \fn int init_DS(DS * exam, int door_DS, char * path)
* \brief This function initialize a DS : position (the door number) and the path to the DS's image.
*
* \param [in] exam a DS pointer
* \param [in] door_DS a door number corresponding to the DS location
* \param [in] path the DS image path
* \return 1 if the initialization went right.
*/
int init_DS(DS * exam, int door_DS, char * path){
exam->door=door_DS;
exam->image_DS = malloc(strlen(path));
strcpy(exam->image_DS, path);
return 1;
}
\ No newline at end of file
...@@ -2,11 +2,32 @@ ...@@ -2,11 +2,32 @@
// Created by Tiny on 2/16/2021. // Created by Tiny on 2/16/2021.
*/ */
/*!
* \file map.c
* \brief Map Source File
* \authors Tin
* \version 1
* \date 16/02/2021
*
* Map function implementation.
*
*/
#include "map.h" #include "map.h"
#include <stdio.h> #include <stdio.h>
#include <stdint.h> #include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
/*!
* \fn int initmap(MAP *map,char *path)
* \brief This function initialize the map : allocate the map's name and call the maptomatrix
*
* \param [in] map the map pointer
* \param [in] path the map image path
* \return 0 if the initialization went right.
*/
int initmap(MAP *map,char *path){ int initmap(MAP *map,char *path){
int lenpath = strlen(path); //get the path lenght int lenpath = strlen(path); //get the path lenght
map->path = (char *)malloc((lenpath)*sizeof(char)); //allocate the path map->path = (char *)malloc((lenpath)*sizeof(char)); //allocate the path
...@@ -15,6 +36,13 @@ int initmap(MAP *map,char *path){ ...@@ -15,6 +36,13 @@ int initmap(MAP *map,char *path){
return 0; return 0;
} }
/*!
* \fn int **maptomatrix(MAP *map)
* \brief This function gets the matrix's length and width and creates a functional matrix from the bmp matrix.
*
* \param [in] map the map pointer
* \return NULL if there is an error when opening the map, fonc otherwise.
*/
int **maptomatrix(MAP *map){ int **maptomatrix(MAP *map){
......
/*
// Created by Lucile on 25/02/2021.
*/
/*!
* \file personnage.c
* \brief Character Source File
* \authors Lucile
* \version 1
* \date 02/03/2021
*
* Character function implementation.
*
*/
#include <stdio.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include "personnage.h"
/*!
* \fn int init_pers(Personnage * character, int x, int y, int length, int width, int speed, char * path)
* \brief This function initialize the character : position of the character's top left corner (x,y), size (length, width), speed and also the path to the character's image.
*
* \param [in] character a pointer on the character
* \param [in] x the character's abscissa
* \param [in] y the character's ordinate
* \param [in] length the character's length
* \param [in] width the character's width
* \param [in] path the path to the character's image
* \return 1 if the initialization went right.
*/
int init_pers(Personnage * character, int x, int y, int length, int width, int speed, char * path){
character->x_pers=x;
character->y_pers=y;
character->long_pers=length;
character->larg_pers=width;
character->speed_pers=speed;
character->image_pers = malloc(strlen(path));
strcpy(character->image_pers, path);
return 1;
}
\ No newline at end of file
//
// Created by CABANTOUS corto on 25/02/2021.
//
/*!
* \file prof.c
* \brief Teacher Source File
* \authors corto
* \version 1
* \date 02/03/2021
*
* Teacher function implementation.
*
*/
#include <stdio.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include "prof.h"
/*!
* \fn int init_prof(Prof * prof, int x, int y, int length, int width, int speed, char * path)
* \brief This function initialize the Teacher : position of the Teacher's top left corner (x,y), size (length, width), speed and also the path to the Teacher's image.
*
* \param [in] Teacher a pointer on the character
* \param [in] x the Teacher's abscissa
* \param [in] y the Teacher's ordinate
* \param [in] length the Teacher's length
* \param [in] width the Teacher's width
* \param [in] path the path to the Teacher's image
* \return 1 if the initialization went right.
*/
int init_prof(Prof * prof, int x, int y, int length, int width, int speed, char * path){
prof->x_prof=x;
prof->y_prof=y;
prof->long_prof=length;
prof->larg_prof=width;
prof->speed_prof=speed;
prof->image_prof = malloc(strlen(path));
strcpy(prof->image_prof, path);
return 1;
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment