Skip to content
Snippets Groups Projects
Commit c0d71498 authored by Corto.Cabantous's avatar Corto.Cabantous
Browse files

ajout de prof.c et modification de prof.h

parent cceb06cc
No related branches found
No related tags found
4 merge requests!8Modele,!7Modele,!6Modele,!5Modele Version 1
...@@ -26,11 +26,11 @@ ...@@ -26,11 +26,11 @@
typedef struct { typedef struct {
int x_prof; /**< Position : abscissa */ int x_prof; /**< Position : abscissa */
int y_prof; /**< Position : ordinate */ int y_prof; /**< Position : ordinate */
int long_porf; /**< Size : length */ int long_prof; /**< Size : length */
int larg_prof; /**< Size : width */ int larg_prof; /**< Size : width */
int speed_prof; /**< Charater speed */ int speed_prof; /**< Charater speed */
char * image_prof; /**< Source image of the character. */ char * image_prof; /**< Source image of the character. */
} prof; } Prof;
#endif /*GAME_INSA_PROJECT_Prof_H*/ #endif /*GAME_INSA_PROJECT_Prof_H*/
......
//
// Created by CABANTOUS corto on 25/02/2021.
//
/*!
* \file prof.c
* \brief professor Source File
* \authors corto
* \version 1
* \date 02/03/2021
*
* professor function implementation.
*
*/
#include <stdio.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include "prof.h"
/*!
* \fn int init_pers(Prof * professor, int x, int y, int length, int width, int speed, char * path)
* \brief This function initialize the character : position of the professor's top left corner (x,y), size (length, width), speed and also the path to the character's image.
*
* \param [in] professor a pointer on the character
* \param [in] x the professor's abscissa
* \param [in] y the professor's ordinate
* \param [in] length the professor's length
* \param [in] width the professor's width
* \param [in] path the path to the professor's image
* \return 1 if the initialization went right.
*/
int init_pers(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