diff --git a/travail_de_groupe/jeu_appren_par_renfo/src/monstre.c b/travail_de_groupe/jeu_appren_par_renfo/src/monstre.c index 3b720cc80a1c7fc3ceebb85eb499d7f7bd3575a0..7127a40f90b6bd623e232beb6f189741a085c10a 100644 --- a/travail_de_groupe/jeu_appren_par_renfo/src/monstre.c +++ b/travail_de_groupe/jeu_appren_par_renfo/src/monstre.c @@ -1,16 +1,19 @@ -#include "monster.h" +#include "monstre.h" +#include "player.h" monster_t monster; int markov[SIZEMARKOV][SIZEMARKOV]; void initMonster (){ - monster.x= (rand()%((MAPSIZEX-3)/2)+16)*CELLSIZE; - monster.y= (rand()%(MAPSIZEY-2))*CELLSIZE; + srand(time(NULL)); + + monster.x= (rand()%((MAP_WIDTH-3)/2)+16)*BLOCK_SIZE; + monster.y= (rand()%(MAP_HEIGHT-2))*BLOCK_SIZE; monster.state= PEACEFULL; monster.healthPoint= 3; monster.speed=1; - monster.angle=0; + monter.angle=0; //monster.dammage } diff --git a/travail_de_groupe/jeu_appren_par_renfo/src/monstre.h b/travail_de_groupe/jeu_appren_par_renfo/src/monstre.h index 11ebaa51067cca7fa9e48483b548b939cb41dd05..2a57147212e1bdf06fc8da007540b22ead2cd298 100644 --- a/travail_de_groupe/jeu_appren_par_renfo/src/monstre.h +++ b/travail_de_groupe/jeu_appren_par_renfo/src/monstre.h @@ -1,5 +1,5 @@ -#ifndef MONSTER_H -#define MONSTER_H +#ifndef MONSTRE_H +#define MONSTRE_H #include <stdlib.h> #include <time.h> diff --git a/travail_de_groupe/jeu_appren_par_renfo/src/player.c b/travail_de_groupe/jeu_appren_par_renfo/src/player.c index bc2c520c5e1a8714dad8dda10608bf954b18b198..a013abfb1568f7c768d80ccb94b1b49829be846d 100644 --- a/travail_de_groupe/jeu_appren_par_renfo/src/player.c +++ b/travail_de_groupe/jeu_appren_par_renfo/src/player.c @@ -3,8 +3,8 @@ player_t player; void initPlayer(){ - player.x= 8*CELLSIZE; - player.y= 8*CELLSIZE; + player.x= 8*BLOCK_SIZE; + player.y= 8*BLOCK_SIZE; player.speed = 1; player.isMoving = 0; player.HPMax = 3; diff --git a/travail_de_groupe/jeu_appren_par_renfo/src/player.h b/travail_de_groupe/jeu_appren_par_renfo/src/player.h index e9622b47138f5e569b06c4728a38ce7a9c6c979b..3fa04e2d43f1bed93f36c015c7e5f369f2428f16 100644 --- a/travail_de_groupe/jeu_appren_par_renfo/src/player.h +++ b/travail_de_groupe/jeu_appren_par_renfo/src/player.h @@ -1,10 +1,10 @@ #ifndef PLAYER_H #define PLAYER_H -#define PLAYER_UP 0 -#define PLAYER_DOWN 1 -#define PLAYER_LEFT 2 -#define PLAYER_RIGHT 3 +#define ENTITIES_UP 0 +#define ENTITIES_DOWN 1 +#define ENTITIES_LEFT 2 +#define ENTITIES_RIGHT 3 typedef struct player{ int x;