Advertisement
patas99

Untitled

Jan 22nd, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.25 KB | None | 0 0
  1. #Vytvorte hraci drahu o 3 polich a libovolne delce. Na draze pobezi panacek, ktery bude umet pohyb doleva, doprava, nahoru(skoko), dolu(skrceni). Draha bude mit prekazky, kterym se bude muset panacek vyhybat.
  2.  
  3. #Vytvorte tridu pro panacka tak, aby bylo mozne pridat nove typy panacku. Zakladne jsou 2 typy(normalni a nesmrtelny). Pri stredu s prekazkou se vyhodnoti, zda se panacek vyhnul, pokud ne, tak se zjisti, zda je nesmrtelny a pokud neni, tak umre.
  4.  
  5. #Vytvorte tridu pro prekazdy tak, aby bylo mozne pridat nove typy prekazek. Zakladne budou 3 typy(lze obejit, lze podlest,lzepreskocit).
  6.  
  7. #IMPLEMENTOVAT - napiste overeni, zda jsou panacek a prekazka na stejne souradnici
  8.  
  9. #Vytvorte tridu pro nacteni skinnu(treba barvy),panacka,prekazky,...
  10.  
  11. #include <iostream>
  12. #include <string>
  13. using namespace std;
  14.  
  15. class prekazka
  16. {
  17. private:
  18.     string typ;
  19.     int x;
  20.     int y;
  21. public:
  22.     prekazka(int _x, int _y) : x(_x), y(_y) { ; }
  23. };
  24.  
  25. class lze_obejit :public prekazka
  26. {
  27. private:
  28.     string typ = "lze obejit";
  29.     int x;
  30.     int y;
  31. public:
  32.     lze_obejit(int _x, int _y) : prekazka(_x, _y) { ; }
  33. };
  34.  
  35. class lze_podlest : public prekazka
  36. {
  37. private:
  38.     string typ = "lze podlest";
  39.     int x;
  40.     int y;
  41. public:
  42.     lze_podlest(int _x, int _y) : prekazka(_x, _y) { ; }
  43. };
  44.  
  45. class lze_preskocit : public prekazka
  46. {
  47. private:
  48.     string typ = "lze preskocit";
  49.     int x;
  50.     int y;
  51. public:
  52.     lze_preskocit(int _x, int _y) : prekazka(_x, _y) { ; }
  53. };
  54. class panacek
  55. {
  56. private:
  57.     int nesmrtelnost;
  58.     string pohyb;
  59.     int x;
  60.     int y;
  61. public:
  62.     panacek(int _x,int _y) : x(_x),y(_y) { ; }
  63.     virtual void posun(int _x, int _y, string _pohyb)
  64.     {
  65.         this->x = _x;
  66.         this->y = _y;
  67.         this->pohyb = _pohyb;
  68.     }
  69. };
  70. class normalni : public panacek
  71. {
  72. private:
  73.     int nesmrtelnost = 0;
  74.     int x;
  75.     int y;
  76.     string pohyb;
  77. public:
  78.     normalni(int _x, int _y) : panacek(_x,_y) { ; }
  79.     void posun(int _x, int _y, string _pohyb)
  80.     {
  81.         this->x = _x;
  82.         this->y = _y;
  83.         this->pohyb = _pohyb;
  84.     }
  85. };
  86. class nesmrtelny : public panacek
  87. {
  88. private:
  89.     int nesmrtelnost = 1;
  90.     int x;
  91.     int y;
  92.     string pohyb;
  93. public:
  94.     nesmrtelny(int _x, int _y) : panacek(_x, _y) { ; }
  95.     void posun(int _x, int _y, string _pohyb)
  96.     {
  97.         this->x = _x;
  98.         this->y = _y;
  99.         this->pohyb = _pohyb;
  100.     }
  101. };
  102.  
  103. int main(void)
  104. {
  105.    
  106. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement