diff --git a/cpp11/maze-chunk.cpp b/cpp11/maze-chunk.cpp index a7a6905..4f00972 100644 --- a/cpp11/maze-chunk.cpp +++ b/cpp11/maze-chunk.cpp @@ -12,7 +12,7 @@ chunk::chunk(const chunk &other){ w=other.w; } chunk::~chunk(){ - player=nullptr; + if(player!=nullptr)delete player; } void chunk::putchunk(){ for(unsigned short i=0;ix=line; player->y=c; + player->health=10; + player->id=0; blocks[line][c].id=air; } else{ diff --git a/cpp11/maze-chunk.h b/cpp11/maze-chunk.h index 6585b88..d7b76f8 100644 --- a/cpp11/maze-chunk.h +++ b/cpp11/maze-chunk.h @@ -9,6 +9,7 @@ class chunk { public: entity *player; + vectormonsters; array,16>blocks; unsigned short l,w; chunk(); diff --git a/cpp11/maze-game.cpp b/cpp11/maze-game.cpp index 89b01d3..a3cce41 100644 --- a/cpp11/maze-game.cpp +++ b/cpp11/maze-game.cpp @@ -94,10 +94,10 @@ void game::clear(){ void level_menu(){ game all; while(true){ - for(unsigned short i=1;i!=5;++i){ + for(unsigned short i=1;i!=6;++i){ string te="1-"+tos(i); cout<<"1-"<