diff --git a/sem2/Benko A/Dino/button.h b/sem2/Benko A/Dino/button.h new file mode 100644 index 00000000..4ba2598f --- /dev/null +++ b/sem2/Benko A/Dino/button.h @@ -0,0 +1,44 @@ +#pragma once + +class Button { +private: + sf::RectangleShape sh; + sf::Texture t; + std::string st; + +public: + Button(const sf::Vector2f& size, const sf::Vector2f& position, const sf::Color& color, const std::string& str) + { + sh.setSize(size); + sh.setPosition(position); + sh.setOutlineColor(color); + sh.setOutlineThickness(4); + sh.setFillColor(color); + t.loadFromFile(str); + st = str; + } + + void draw(sf::RenderWindow& window) + { + window.draw(sh); + sh.setTexture(&t); + } + + bool clicked(const sf::Vector2i& mousePos) + { + return sh.getGlobalBounds().contains(static_cast(mousePos)); + } + + void color(const sf::Color& color, sf::RenderWindow& window) + { + sh.setFillColor(color); + } + void img(const std::string& str, sf::RenderWindow& window) + { + t.loadFromFile(str); + } + std::string getImg(sf::RenderWindow& window) + { + return st; + } +}; \ No newline at end of file diff --git a/sem2/Benko A/Dino/dino.h b/sem2/Benko A/Dino/dino.h new file mode 100644 index 00000000..3cfabb5d --- /dev/null +++ b/sem2/Benko A/Dino/dino.h @@ -0,0 +1,44 @@ +#pragma once + +int LIM; +int cD; + +class Dino { +protected: + int st = rand() % 8 + 10; + int ag = rand() % 10 + 10; + int in = rand() % 20 + 5; +public: + virtual double damage() = 0; +}; + +class DinoStr : public Dino { +public: + double damage() override { + cD = cD + st * 1.1; + return cD; + } +}; + +class DinoDex : public Dino { +public: + double damage() override { + cD = cD + ag * 1.3; + return cD; + } +}; + +class DinoInt : public Dino { +public: + double damage() override { + cD = cD + in * 1.5; + return cD; + } +}; + +class Player { +public: + double damage(Dino* dino) { + return dino->damage(); + } +}; \ No newline at end of file diff --git a/sem2/Benko A/Dino/inventory.h b/sem2/Benko A/Dino/inventory.h new file mode 100644 index 00000000..c67870f4 --- /dev/null +++ b/sem2/Benko A/Dino/inventory.h @@ -0,0 +1,294 @@ +#pragma once + +enum class Inven { slt1, slt2, slt3, slt4, slt5, slt6, back }; +Inven inven(sf::RenderWindow& window, sf::Font& font) +{ + std::string a; + std::string M[6]; + for (int i = 0; i < 6; i++) + { + M[i] = ""; + MASS[i] = 0; + } + int tmp = 0; + + Button slot1({ 550, 550 }, { 200, 100 }, sf::Color(20, 230, 230), ""); + Button slot2({ 550, 550 }, { 1000, 100 }, sf::Color(20, 230, 230), ""); + Button slot3({ 550, 550 }, { 1800, 100 }, sf::Color(20, 230, 230), ""); + Button slot4({ 550, 550 }, { 200, 700 }, sf::Color(20, 230, 230), ""); + Button slot5({ 550, 550 }, { 1000, 700 }, sf::Color(20, 230, 230), ""); + Button slot6({ 550, 550 }, { 1800, 700 }, sf::Color(20, 230, 230), ""); + Button back({ 410, 125 }, { 1000, 1300 }, sf::Color(20, 230, 230), "back.png"); + + std::string line, ln; + std::ifstream in("dino_numbers.txt"); + if (in.is_open()) + { + while (getline(in, line)) + { + ln = line; + } + } + if (ln.length() == 0) + { + UI alert1({ 1000, 100 }, { 800, 1100 }, sf::Color(20, 230, 230), 60, "You have no dino", font); + alert1.draw(window); + window.display(); + Sleep(1000); + return Inven::back; + } + + for (int i = 0; i < ln.length(); ++i) + { + a = ln[i]; + MASS[i] = std::stoi(a); + } + + for (int i = 0; i < 6; ++i) + { + if (MASS[i] == 1) + { + M[i] = "ter.jpg"; + } + else if (MASS[i] == 2) + { + M[i] = "dip.jpg"; + } + else if (MASS[i] == 3) + { + M[i] = "tri.jpg"; + } + else + { + M[i] = ""; + } + } + + if (stsl1 == true) { + slot1.color(sf::Color(20, 230, 20), window); + } + if (stsl2 == true) { + slot2.color(sf::Color(20, 230, 20), window); + } + if (stsl3 == true) { + slot3.color(sf::Color(20, 230, 20), window); + } + if (stsl4 == true) { + slot4.color(sf::Color(20, 230, 20), window); + } + if (stsl5 == true) { + slot5.color(sf::Color(20, 230, 20), window); + } + if (stsl6 == true) { + slot6.color(sf::Color(20, 230, 20), window); + } + slot1.img(M[0], window); + slot2.img(M[1], window); + slot3.img(M[2], window); + slot4.img(M[3], window); + slot5.img(M[4], window); + slot6.img(M[5], window); + + while (window.isOpen()) + { + + sf::Vector2i mPos = sf::Mouse::getPosition(window); + sf::Event event; + while (window.pollEvent(event)) + { + if (event.type == sf::Event::Closed) window.close(); + + if (event.type == sf::Event::MouseButtonPressed) + { + if (event.mouseButton.button == sf::Mouse::Left) + { + if (slot1.clicked(mPos) && (MASS[0] == 1 || MASS[0] == 2 || MASS[0] == 3)) + { + if (stsl1 == false) + { + if (tem < 3) + { + slot1.color(sf::Color(20, 230, 20), window); + ++tem; + stsl1 = true; + } + } + else + { + slot1.color(sf::Color(20, 230, 230), window); + --tem; + stsl1 = false; + } + } + if (slot2.clicked(mPos) && (MASS[1] == 1 || MASS[1] == 2 || MASS[1] == 3)) + { + if (stsl2 == false) + { + if (tem < 3) + { + slot2.color(sf::Color(20, 230, 20), window); + tem += 1; + stsl2 = true; + } + } + else + { + slot2.color(sf::Color(20, 230, 230), window); + tem -= 1; + stsl2 = false; + } + } + if (slot3.clicked(mPos) && (MASS[2] == 1 || MASS[2] == 2 || MASS[2] == 3)) + { + if (stsl3 == false) + { + if (tem < 3) + { + slot3.color(sf::Color(20, 230, 20), window); + tem += 1; + stsl3 = true; + } + } + else + { + slot3.color(sf::Color(20, 230, 230), window); + tem -= 1; + stsl3 = false; + } + + } + if (slot4.clicked(mPos) && (MASS[3] == 1 || MASS[3] == 2 || MASS[3] == 3)) + { + if (stsl4 == false) + { + if (tem < 3) + { + slot4.color(sf::Color(20, 230, 20), window); + tem += 1; + stsl4 = true; + } + } + else + { + slot4.color(sf::Color(20, 230, 230), window); + tem -= 1; + stsl4 = false; + } + } + if (slot5.clicked(mPos) && (MASS[4] == 1 || MASS[4] == 2 || MASS[4] == 3)) + { + if (stsl5 == false) + { + if (tem < 3) + { + slot5.color(sf::Color(20, 230, 20), window); + tem += 1; + stsl5 = true; + } + } + else + { + slot5.color(sf::Color(20, 230, 230), window); + tem -= 1; + stsl5 = false; + } + } + if (slot6.clicked(mPos) && (MASS[5] == 1 || MASS[5] == 2 || MASS[5] == 3)) + { + if (stsl6 == false) + { + if (tem < 3) + { + slot6.color(sf::Color(20, 230, 20), window); + tem += 1; + stsl6 = true; + } + } + else + { + slot6.color(sf::Color(20, 230, 230), window); + tem -= 1; + stsl6 = false; + } + + } + if (back.clicked(mPos)) + { + back.color(sf::Color(20, 180, 180), window); + back.draw(window); + window.display(); + Sleep(250); + tmp = 0; + std::ofstream out; + out.open("pull.txt"); + if (out.is_open()) + { + if (stsl1 == true) { + out << MASS[0]; + } else { + ++tmp; + } + if (stsl2 == true) { + out << MASS[1]; + } else { + ++tmp; + } + if (stsl3 == true) { + out << MASS[2]; + } else { + ++tmp; + } + if (stsl4 == true) { + out << MASS[3]; + } else { + ++tmp; + } + if (stsl5 == true) { + out << MASS[4]; + } else { + ++tmp; + } + if (stsl6 == true) { + out << MASS[5]; + } else { + ++tmp; + } + } + out.close(); + if (tmp != 6) { + slot1.img("", window); + slot2.img("", window); + slot3.img("", window); + slot4.img("", window); + slot5.img("", window); + slot6.img("", window); + return Inven::back; + } else { + UI alert1({ 1000, 100 }, { 800, 1100 }, sf::Color(20, 230, 230), 60, "Chose 1-3 dino", font); + alert1.draw(window); + window.display(); + Sleep(1000); + } + } + } + } + } + sf::Texture start; + start.loadFromFile("font.png"); + sf::RectangleShape HAHAShape(sf::Vector2f(window.getSize())); + HAHAShape.setTexture(&start); + HAHAShape.setPosition(0, 0); + window.draw(HAHAShape); + + slot1.draw(window); + slot2.draw(window); + slot3.draw(window); + slot4.draw(window); + slot5.draw(window); + slot6.draw(window); + back.draw(window); + + window.display(); + + } +} \ No newline at end of file diff --git a/sem2/Benko A/Dino/main.cpp b/sem2/Benko A/Dino/main.cpp new file mode 100644 index 00000000..30d60174 --- /dev/null +++ b/sem2/Benko A/Dino/main.cpp @@ -0,0 +1,81 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "windows.h" + +int tem = 0; +bool stsl1 = false, stsl2 = false, stsl3 = false, stsl4 = false, stsl5 = false, stsl6 = false; +int MASS[6]; + +#include "dino.h" +#include "button.h" +#include "ui.h" +#include "start.h" +#include "play.h" +#include "inventory.h" +#include "shop.h" + +int main() +{ + std::string line2, cu; + std::ifstream in2("dino_numbers.txt"); + if (in2.is_open()) + { + while (getline(in2, line2)) + { + cu = line2; + } + } + in2.close(); + + if (cu.length() > 0 && cu.length() <= 1) { + stsl1 = true; + stsl2 = false; + stsl3 = false; + tem = 1; + }if (cu.length() > 1 && cu.length() <= 2) { + stsl1 = true; + stsl2 = true; + stsl3 = false; + tem = 2; + }if (cu.length() >= 3) { + stsl1 = true; + stsl2 = true; + stsl3 = true; + tem = 3; + } + + sf::RenderWindow window(sf::VideoMode::getDesktopMode(), "DINO FIGTHERS 2"); + window.setFramerateLimit(240); + + sf::Font font; + if (!font.loadFromFile("EpilepsySansBold.ttf")) {} + + while (window.isOpen()) + { + Wind Wind = chTam(window, font); + + if (Wind == Wind::play) + { + int Play = play(window, font); + } + if (Wind == Wind::inventory) + { + Inven Inven = inven(window, font); + } + if (Wind == Wind::shop) + { + Buy Buy = shopin(window, font); + } + if (Wind == Wind::exit) + { + window.close(); + } + } +} \ No newline at end of file diff --git a/sem2/Benko A/Dino/play.h b/sem2/Benko A/Dino/play.h new file mode 100644 index 00000000..cb43679b --- /dev/null +++ b/sem2/Benko A/Dino/play.h @@ -0,0 +1,357 @@ +#pragma once + +enum Terrain { Plain, River, Mountain }; +enum Dinosavrus { Teranosavr = 1, Diplodog = 2, Triceratops = 3 }; + +int play(sf::RenderWindow& window, sf::Font& font) +{ + + int cH, ecH, dino1, dino2, a, b, cu_ca, rN1, rN2, rN3, n = 1, en = 1; + std::string line, cu_pul; + std::ifstream in("cash.txt"); + if (in.is_open()) + { + while (getline(in, line)) + { + cu_ca = stoi(line); + } + } + in.close(); + + std::ofstream out; + out.open("dino_numbers.txt"); + if (out.is_open()) + { + if (stsl1 == false && MASS[0] != 0) { + out << MASS[0]; + } + if (stsl2 == false && MASS[1] != 0) { + out << MASS[1]; + } + if (stsl3 == false && MASS[2] != 0) { + out << MASS[2]; + } + if (stsl4 == false && MASS[3] != 0) { + out << MASS[3]; + } + if (stsl5 == false && MASS[4] != 0) { + out << MASS[4]; + } + if (stsl6 == false && MASS[5] != 0) { + out << MASS[5]; + } + } + out.close(); + + std::string pull, enemy_pull, file_name, terr_name, temr, temr2, terr_n; + + std::string line1; + std::ifstream in1("pull.txt"); + if (in1.is_open()) + { + while (getline(in1, line1)) + { + pull = line1; + } + } + + if (pull.length() == 0) + { + UI alert1({ 1000, 100 }, { 800, 1100 }, sf::Color(20, 230, 230), 60, "You do not choose any dino", font); + alert1.draw(window); + window.display(); + Sleep(1000); + return 0; + } + + while (window.isOpen()) { + + + srand(time(0)); + + rN1 = rand() % 3 + 1; + rN2 = rand() % 3 + 1; + rN3 = rand() % 3 + 1; + enemy_pull = std::to_string(rN1) + std::to_string(rN2) + std::to_string(rN3); + cH = 100; + ecH = 100; + temr = pull[0]; + dino1 = std::stoi(temr); + temr2 = enemy_pull[0]; + dino2 = std::stoi(temr2); + Player player; + DinoStr D; + DinoDex D1; + DinoInt D2; + + switch (dino1) { + case 1: + a = player.damage(&D); + break; + case 2: + a = player.damage(&D1); + break; + case 3: + a = player.damage(&D2); + break; + } + + std::random_device rd; + std::mt19937 gen(rd()); + + std::uniform_int_distribution distribution(0, 2); + + int randomIndex = distribution(gen); + Terrain randomTerrain = static_cast(randomIndex); + + switch (randomTerrain) { + case Terrain::Plain: + terr_name = "plain.png"; + terr_n = "PLAIN"; + break; + case Terrain::River: + terr_name = "river.png"; + terr_n = "RIVER"; + break; + case Terrain::Mountain: + terr_name = "mountain.png"; + terr_n = "MOUNTAIN"; + } + + Button dinoB1({ 600, 600 }, { 200, 250 }, sf::Color(20, 230, 230), ""); + Button dinoB2({ 600, 600 }, { 1800, 250 }, sf::Color(20, 230, 230), ""); + UI terra({ 600, 150 }, { 1000, 100 }, sf::Color(20, 230, 230), 100, terr_n, font); + UI stat1({ 600, 100 }, { 200, 850 }, sf::Color(20, 230, 230), 60, std::to_string(cH).append("HP"), font); + UI stat2({ 600, 100 }, { 1800, 850 }, sf::Color(20, 230, 230), 60, std::to_string(ecH).append("HP"), font); + UI n1({ 100, 100 }, { 800, 250 }, sf::Color(20, 230, 230), 60, std::to_string(n), font); + UI n2({ 100, 100 }, { 1700, 250 }, sf::Color(20, 230, 230), 60, std::to_string(en), font); + Button back({ 410, 125 }, { 1100, 1300 }, sf::Color(20, 230, 230), "back.png"); + back.color(sf::Color(20, 150, 150), window); + + switch (dino1) { + case 1: + file_name = "ter.jpg"; + break; + case 2: + file_name = "dip.jpg"; + break; + case 3: + file_name = "tri.jpg"; + break; + } + + dinoB1.img(file_name, window); + + switch (dino2) { + case 1: + file_name = "ter.jpg"; + break; + case 2: + file_name = "dip.jpg"; + break; + case 3: + file_name = "tri.jpg"; + break; + } + + dinoB2.img(file_name, window); + + sf::Texture start; + start.loadFromFile(terr_name); + sf::RectangleShape HAHAShape(sf::Vector2f(window.getSize())); + HAHAShape.setTexture(&start); + HAHAShape.setPosition(0, 0); + window.draw(HAHAShape); + terra.draw(window); + dinoB1.draw(window); + dinoB2.draw(window); + stat1.draw(window); + stat2.draw(window); + back.draw(window); + window.display(); + + while (pull.length() != 0 and enemy_pull.length() != 0) + { + temr = pull[0]; + dino1 = std::stoi(temr); + + temr2 = enemy_pull[0]; + dino2 = std::stoi(temr2); + + switch (dino1) { + case 1: + a = player.damage(&D); + break; + case 2: + a = player.damage(&D1); + break; + case 3: + a = player.damage(&D2); + break; + } + + switch (dino1) { + case 1: + file_name = "ter.jpg"; + break; + case 2: + file_name = "dip.jpg"; + break; + case 3: + file_name = "tri.jpg"; + break; + } + + dinoB1.img(file_name, window); + dinoB1.color(sf::Color(20, 230, 230), window); + + switch (dino2) { + case 1: + file_name = "ter.jpg"; + break; + case 2: + file_name = "dip.jpg"; + break; + case 3: + file_name = "tri.jpg"; + break; + } + + dinoB2.img(file_name, window); + dinoB2.color(sf::Color(20, 230, 230), window); + + b = rand() % 20 + 10; + cH = cH - b; + UI dmg1({ 600, 100 }, { 200, 950 }, sf::Color(20, 230, 230), 60, std::to_string(b).append("HP damage to you"), font); + dmg1.draw(window); + window.display(); + Sleep(500); + if ((randomTerrain == Terrain::Plain and dino1 == 1) or (randomTerrain == Terrain::River and dino1 == 2) or (randomTerrain == Terrain::Mountain and dino1 == 3)) { + ecH = ecH - (a * 2); + UI dmg1({ 600, 100 }, { 1800, 950 }, sf::Color(20, 230, 230), 60, std::to_string(a*2).append("HP damage to enemy"), font); + dmg1.draw(window); + window.display(); + Sleep(500); + } + else { + ecH = ecH - a; + UI dmg1({ 600, 100 }, { 1800, 950 }, sf::Color(20, 230, 230), 60, std::to_string(a).append("HP damage to enemy"), font); + dmg1.draw(window); + window.display(); + Sleep(500); + } + + stat1.text(std::to_string(cH).append("HP"), window); + stat2.text(std::to_string(ecH).append("HP"), window); + + if (cH <= 0) { + pull.erase(pull.begin()); + cH = 0; + stat1.text(std::to_string(cH).append("HP"), window); + stat1.draw(window); + window.display(); + cH = 100; + dinoB1.color(sf::Color(230, 20, 20), window); + + if (pull.length() > 0) { + ++n; + n1.text(std::to_string(n), window); + } + } + if (ecH <= 0) { + enemy_pull.erase(enemy_pull.begin()); + ecH = 0; + stat2.text(std::to_string(ecH).append("HP"), window); + stat2.draw(window); + window.display(); + cu_ca += (rand() % 8 + 8); + ecH = 100; + dinoB2.color(sf::Color(230, 20, 20), window); + if (enemy_pull.length() > 0) { + ++en; + n2.text(std::to_string(en), window); + } + + } + sf::Texture start; + start.loadFromFile(terr_name); + sf::RectangleShape HAHAShape(sf::Vector2f(window.getSize())); + HAHAShape.setTexture(&start); + HAHAShape.setPosition(0, 0); + window.draw(HAHAShape); + terra.draw(window); + dinoB1.draw(window); + dinoB2.draw(window); + stat1.draw(window); + stat2.draw(window); + n1.draw(window); + n2.draw(window); + back.draw(window); + window.display(); + Sleep(1000); + } + + in.open("dino_numbers.txt"); + if (in.is_open()) + { + while (getline(in, line)) + { + cu_pul = line; + } + } + in.close(); + out.open("dino_numbers.txt"); + if (out.is_open()) + { + if (cu_pul.length() != 0) { + out << cu_pul << pull; + } else if (pull.length() != 0) { + out << pull; + } + } + out.close(); + + pull = ""; + + out.open("pull.txt"); + if (out.is_open()) + { + out << pull; + } + out.close(); + + out.open("cash.txt"); + if (out.is_open()) + { + out << cu_ca; + } + out.close(); + back.color(sf::Color(20, 230, 230), window); + back.draw(window); + window.display(); + while (window.isOpen()) { + sf::Vector2i mPos = sf::Mouse::getPosition(window); + sf::Event event; + while (window.pollEvent(event)) + { + if (event.type == sf::Event::Closed) window.close(); + if (event.type == sf::Event::MouseButtonPressed) + { + if (event.mouseButton.button == sf::Mouse::Left) + { + if (back.clicked(mPos)) + { + tem = 0; + stsl1 = false, stsl2 = false, stsl3 = false, stsl4 = false, stsl5 = false, stsl6 = false; + back.color(sf::Color(20, 180, 180), window); + back.draw(window); + window.display(); + Sleep(250); + return 0; + } + } + } + } + } + } +} \ No newline at end of file diff --git a/sem2/Benko A/Dino/shop.h b/sem2/Benko A/Dino/shop.h new file mode 100644 index 00000000..4efbe7a4 --- /dev/null +++ b/sem2/Benko A/Dino/shop.h @@ -0,0 +1,204 @@ +#pragma once + +enum class Buy { lt1, lt2, lt3, back}; +Buy shopin(sf::RenderWindow& window, sf::Font& font) +{ + int cu_ca, len = 0; + std::string line; + std::ifstream in("cash.txt"); + if (in.is_open()) + { + while (getline(in, line)) + { + cu_ca = stoi(line); + } + } + in.close(); + std::ifstream in2("dino_numbers.txt"); + if (in2.is_open()) + { + while (getline(in2, line)) + { + len = line.length(); + } + } + in2.close(); + + Button lot1({ 600, 600 }, { 200, 250 }, sf::Color(20, 230, 230), "ter.jpg"); + UI stat1({ 600, 100 }, { 200, 850 }, sf::Color(20, 230, 230), 60, "20$", font); + + Button lot2({ 600, 600 }, { 1000, 250 }, sf::Color(20, 230, 230), "dip.jpg"); + UI stat2({ 600, 100 }, { 1000, 850 }, sf::Color(20, 230, 230), 60, "12$", font); + + Button lot3({ 600, 600 }, { 1800, 250 }, sf::Color(20, 230, 230), "tri.jpg"); + UI stat3({ 600, 100 }, { 1800, 850 }, sf::Color(20, 230, 230), 60, "16$", font); + + UI mon({ 410, 125 }, { 1100, 1100 }, sf::Color(20, 230, 230), 60, std::to_string(cu_ca).append("$"), font); + + Button back({ 410, 125 }, { 1100, 1300 }, sf::Color(20, 230, 230), "back.png"); + + while (window.isOpen()) + { + sf::Vector2i mPos = sf::Mouse::getPosition(window); + sf::Event event; + while (window.pollEvent(event)) + { + if (event.type == sf::Event::Closed) window.close(); + + if (event.type == sf::Event::MouseButtonPressed) + { + if (LIM <= 6) + { + if (event.mouseButton.button == sf::Mouse::Left) + { + if (lot1.clicked(mPos)) + { + lot1.color(sf::Color(20, 180, 180), window); + lot1.draw(window); + window.display(); + Sleep(250); + if (len < 6) + { + if (cu_ca >= 20) + { + stat1.text("-$", window); + lot1.draw(window); + cu_ca = cu_ca - 20; + std::ofstream out; + out.open("dino_numbers.txt", std::ios::app); + out << 1; + out.close(); + mon.text(std::to_string(cu_ca).append("$"), window); + len += 1; + } + else + { + UI alert2({ 1000, 100 }, { 800, 1100 }, sf::Color(20, 230, 230), 60, "You haven't enought money", font); + alert2.draw(window); + window.display(); + Sleep(1000); + } + } + else + { + UI alert1({ 1000, 100 }, { 800, 1100 }, sf::Color(20, 230, 230), 60, "You haven't enought slots", font); + alert1.draw(window); + window.display(); + Sleep(1000); + } + } + if (lot2.clicked(mPos)) + { + lot2.color(sf::Color(20, 180, 180), window); + lot2.draw(window); + window.display(); + Sleep(250); + if (len < 6) + { + if (cu_ca >= 12) + { + stat2.text("-$", window); + lot2.draw(window); + cu_ca = cu_ca - 12; + std::ofstream out; + out.open("dino_numbers.txt", std::ios::app); + out << 2; + out.close(); + mon.text(std::to_string(cu_ca).append("$"), window); + len += 1; + } + else + { + UI alert2({ 1000, 100 }, { 800, 1100 }, sf::Color(20, 230, 230), 60, "You haven't enought money", font); + alert2.draw(window); + window.display(); + Sleep(1000); + } + } + else + { + UI alert1({ 1000, 100 }, { 800, 1100 }, sf::Color(20, 230, 230), 60, "You haven't enought slots", font); + alert1.draw(window); + window.display(); + Sleep(1000); + } + } + if (lot3.clicked(mPos)) + { + lot3.color(sf::Color(20, 180, 180), window); + lot3.draw(window); + window.display(); + Sleep(250); + if (len < 6) + { + if (cu_ca >= 16) + { + stat3.text("-$", window); + lot3.draw(window); + cu_ca = cu_ca - 16; + std::ofstream out; + out.open("dino_numbers.txt", std::ios::app); + out << 3; + out.close(); + mon.text(std::to_string(cu_ca).append("$"), window); + len += 1; + } + else + { + UI alert2({ 1000, 100 }, { 800, 1100 }, sf::Color(20, 230, 230), 60, "You haven't enought money", font); + alert2.draw(window); + window.display(); + Sleep(1000); + } + } + else + { + UI alert1({ 1000, 100 }, { 800, 1100 }, sf::Color(20, 230, 230), 60, "You haven't enought slots", font); + alert1.draw(window); + window.display(); + Sleep(1000); + } + } + if (back.clicked(mPos)) + { + back.color(sf::Color(20, 180, 180), window); + back.draw(window); + window.display(); + Sleep(250); + std::ofstream out; + out.open("cash.txt"); + if (out.is_open()) + { + out << cu_ca; + } + out.close(); + return Buy::back; + } + } + } + else + { + + } + } + } + sf::Texture start; + start.loadFromFile("font.png"); + sf::RectangleShape HAHAShape(sf::Vector2f(window.getSize())); + HAHAShape.setTexture(&start); + HAHAShape.setPosition(0, 0); + window.draw(HAHAShape); + lot1.color(sf::Color(20, 230, 230), window); + lot2.color(sf::Color(20, 230, 230), window); + lot3.color(sf::Color(20, 230, 230), window); + lot1.draw(window); + stat1.draw(window); + lot2.draw(window); + stat2.draw(window); + lot3.draw(window); + stat3.draw(window); + mon.draw(window); + back.draw(window); + window.display(); + } +} \ No newline at end of file diff --git a/sem2/Benko A/Dino/start.h b/sem2/Benko A/Dino/start.h new file mode 100644 index 00000000..39dd2c04 --- /dev/null +++ b/sem2/Benko A/Dino/start.h @@ -0,0 +1,72 @@ +#pragma once + +enum class Wind { play, inventory, shop, exit }; +Wind chTam(sf::RenderWindow& window, sf::Font& font) +{ + + Button playB({ 410, 125 }, { 700, 350 }, sf::Color(20, 230, 230), "play.png"); + Button invB({ 895, 125 }, { 700, 500 }, sf::Color(20, 230, 230), "inventoryb.png"); + Button strB({ 410, 125 }, { 700, 650 }, sf::Color(20, 230, 230), "shopb.png"); + Button extB({ 410, 125 }, { 700, 800 }, sf::Color(20, 230, 230), "exitb.png"); + + while (window.isOpen()) + { + sf::Vector2i mPos = sf::Mouse::getPosition(window); + sf::Event event; + while (window.pollEvent(event)) + { + if (event.type == sf::Event::Closed) window.close(); + + if (event.type == sf::Event::MouseButtonPressed) + { + if (event.mouseButton.button == sf::Mouse::Left) + { + if (playB.clicked(mPos)) + { + playB.color(sf::Color(20, 180, 180), window); + playB.draw(window); + window.display(); + Sleep(250); + return Wind::play; + } + if (invB.clicked(mPos)) + { + invB.color(sf::Color(20, 180, 180), window); + invB.draw(window); + window.display(); + Sleep(250); + return Wind::inventory; + } + if (strB.clicked(mPos)) + { + strB.color(sf::Color(20, 180, 180), window); + strB.draw(window); + window.display(); + Sleep(250); + return Wind::shop; + } + if (extB.clicked(mPos)) + { + extB.color(sf::Color(20, 180, 180), window); + extB.draw(window); + window.display(); + Sleep(250); + return Wind::exit; + + } + } + } + } + sf::Texture start; + start.loadFromFile("start.png"); + sf::RectangleShape HAHAShape(sf::Vector2f(window.getSize())); + HAHAShape.setTexture(&start); + HAHAShape.setPosition(0, 0); + window.draw(HAHAShape); + playB.draw(window); + invB.draw(window); + strB.draw(window); + extB.draw(window); + window.display(); + } +} \ No newline at end of file diff --git a/sem2/Benko A/Dino/ui.h b/sem2/Benko A/Dino/ui.h new file mode 100644 index 00000000..5ed9a978 --- /dev/null +++ b/sem2/Benko A/Dino/ui.h @@ -0,0 +1,43 @@ +#pragma once + +class UI { +private: + sf::RectangleShape sh; + sf::Text t; + +public: + UI(const sf::Vector2f& size, const sf::Vector2f& position, const sf::Color& color, int kegl, const std::string& str, sf::Font& font) + { + sh.setSize(size); + sh.setPosition(position); + sh.setFillColor(color); + sh.setOutlineColor(color); + sh.setOutlineThickness(4); + t.setFont(font); + t.setString(str); + t.setCharacterSize(kegl); + t.setOutlineThickness(1); + t.setPosition(position.x + (size.x - t.getLocalBounds().width) / 2, position.y + (size.y - t.getLocalBounds().height) / 2); + } + + void draw(sf::RenderWindow& window) + { + window.draw(sh); + window.draw(t); + } + + bool clicked(const sf::Vector2i& mousePos) + { + return sh.getGlobalBounds().contains(static_cast(mousePos)); + } + + void color(const sf::Color& color, sf::RenderWindow& window) + { + sh.setFillColor(color); + } + + void text(const std::string& str, sf::RenderWindow& window) + { + t.setString(str); + } +}; \ No newline at end of file diff --git a/sem2/Benko A/Project1/.vs/Project1/FileContentIndex/01bcc225-c8de-41f7-a07e-4a62c80ecd80.vsidx b/sem2/Benko A/Project1/.vs/Project1/FileContentIndex/01bcc225-c8de-41f7-a07e-4a62c80ecd80.vsidx new file mode 100644 index 00000000..6945dc1e Binary files /dev/null and b/sem2/Benko A/Project1/.vs/Project1/FileContentIndex/01bcc225-c8de-41f7-a07e-4a62c80ecd80.vsidx differ diff --git a/sem2/Benko A/Project1/.vs/Project1/FileContentIndex/04485db0-002a-4668-8f6a-3947f7456e56.vsidx b/sem2/Benko A/Project1/.vs/Project1/FileContentIndex/04485db0-002a-4668-8f6a-3947f7456e56.vsidx new file mode 100644 index 00000000..11f9e401 Binary files /dev/null and b/sem2/Benko A/Project1/.vs/Project1/FileContentIndex/04485db0-002a-4668-8f6a-3947f7456e56.vsidx differ diff --git a/sem2/Benko A/Project1/.vs/Project1/FileContentIndex/27565e40-bcba-4f2d-bf93-c33702f728f5.vsidx b/sem2/Benko A/Project1/.vs/Project1/FileContentIndex/27565e40-bcba-4f2d-bf93-c33702f728f5.vsidx new file mode 100644 index 00000000..36f6e806 Binary files /dev/null and b/sem2/Benko A/Project1/.vs/Project1/FileContentIndex/27565e40-bcba-4f2d-bf93-c33702f728f5.vsidx differ diff --git a/sem2/Benko A/Project1/.vs/Project1/FileContentIndex/3e84e1c6-539f-4319-92be-1b15dd76cf52.vsidx b/sem2/Benko A/Project1/.vs/Project1/FileContentIndex/3e84e1c6-539f-4319-92be-1b15dd76cf52.vsidx new file mode 100644 index 00000000..19f8a9a6 Binary files /dev/null and b/sem2/Benko A/Project1/.vs/Project1/FileContentIndex/3e84e1c6-539f-4319-92be-1b15dd76cf52.vsidx differ diff --git a/sem2/Benko A/Project1/.vs/Project1/v16/.suo b/sem2/Benko A/Project1/.vs/Project1/v16/.suo new file mode 100644 index 00000000..203de450 Binary files /dev/null and b/sem2/Benko A/Project1/.vs/Project1/v16/.suo differ diff --git a/sem2/Benko A/Project1/.vs/Project1/v16/Browse.VC.db b/sem2/Benko A/Project1/.vs/Project1/v16/Browse.VC.db new file mode 100644 index 00000000..74913340 Binary files /dev/null and b/sem2/Benko A/Project1/.vs/Project1/v16/Browse.VC.db differ diff --git a/sem2/Benko A/Project1/.vs/Project1/v16/ipch/AutoPCH/66640157a5244ace/BUTTON.ipch b/sem2/Benko A/Project1/.vs/Project1/v16/ipch/AutoPCH/66640157a5244ace/BUTTON.ipch new file mode 100644 index 00000000..f9e7c710 Binary files /dev/null and b/sem2/Benko A/Project1/.vs/Project1/v16/ipch/AutoPCH/66640157a5244ace/BUTTON.ipch differ diff --git a/sem2/Benko A/Project1/.vs/Project1/v16/ipch/AutoPCH/fbc71a3ec9c882b2/MAIN.ipch b/sem2/Benko A/Project1/.vs/Project1/v16/ipch/AutoPCH/fbc71a3ec9c882b2/MAIN.ipch new file mode 100644 index 00000000..d882773d Binary files /dev/null and b/sem2/Benko A/Project1/.vs/Project1/v16/ipch/AutoPCH/fbc71a3ec9c882b2/MAIN.ipch differ diff --git a/sem2/Benko A/Project1/.vs/Project1/v17/.suo b/sem2/Benko A/Project1/.vs/Project1/v17/.suo new file mode 100644 index 00000000..b52b89b1 Binary files /dev/null and b/sem2/Benko A/Project1/.vs/Project1/v17/.suo differ diff --git a/sem2/Benko A/Project1/.vs/Project1/v17/Browse.VC.db b/sem2/Benko A/Project1/.vs/Project1/v17/Browse.VC.db new file mode 100644 index 00000000..6c15f797 Binary files /dev/null and b/sem2/Benko A/Project1/.vs/Project1/v17/Browse.VC.db differ diff --git a/sem2/Benko A/Project1/.vs/Project1/v17/DocumentLayout.json b/sem2/Benko A/Project1/.vs/Project1/v17/DocumentLayout.json new file mode 100644 index 00000000..03de0a74 --- /dev/null +++ b/sem2/Benko A/Project1/.vs/Project1/v17/DocumentLayout.json @@ -0,0 +1,85 @@ +{ + "Version": 1, + "WorkspaceRootPath": "F:\\cplusplus\\Project1\\Project1\\", + "Documents": [ + { + "AbsoluteMoniker": "D:0:0:{9F9A0AC9-9904-437E-9564-B2D6903BB98A}|Project1\\Project1.vcxproj|F:\\cplusplus\\Project1\\Project1\\Project1\\cat.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", + "RelativeMoniker": "D:0:0:{9F9A0AC9-9904-437E-9564-B2D6903BB98A}|Project1\\Project1.vcxproj|solutionrelative:Project1\\cat.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" + }, + { + "AbsoluteMoniker": "D:0:0:{9F9A0AC9-9904-437E-9564-B2D6903BB98A}|Project1\\Project1.vcxproj|F:\\cplusplus\\Project1\\Project1\\Project1\\main.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", + "RelativeMoniker": "D:0:0:{9F9A0AC9-9904-437E-9564-B2D6903BB98A}|Project1\\Project1.vcxproj|solutionrelative:Project1\\main.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" + }, + { + "AbsoluteMoniker": "D:0:0:{9F9A0AC9-9904-437E-9564-B2D6903BB98A}|Project1\\Project1.vcxproj|F:\\cplusplus\\Project1\\Project1\\Project1\\info.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", + "RelativeMoniker": "D:0:0:{9F9A0AC9-9904-437E-9564-B2D6903BB98A}|Project1\\Project1.vcxproj|solutionrelative:Project1\\info.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" + }, + { + "AbsoluteMoniker": "D:0:0:{9F9A0AC9-9904-437E-9564-B2D6903BB98A}|Project1\\Project1.vcxproj|C:\\PROGRAM FILES\\MICROSOFT VISUAL STUDIO\\2022\\COMMUNITY\\VC\\TOOLS\\MSVC\\14.39.33519\\INCLUDE\\XSTRING||{3B902123-F8A7-4915-9F01-361F908088D0}|" + } + ], + "DocumentGroupContainers": [ + { + "Orientation": 0, + "VerticalTabListWidth": 256, + "DocumentGroups": [ + { + "DockedWidth": 200, + "SelectedChildIndex": 2, + "Children": [ + { + "$type": "Document", + "DocumentIndex": 3, + "Title": "xstring", + "DocumentMoniker": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.39.33519\\include\\xstring", + "ToolTip": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.39.33519\\include\\xstring", + "ViewState": "AQIAAI0BAAAAAAAAAADwv5IBAAAAAAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001001|", + "WhenOpened": "2024-05-08T09:04:15.507Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 2, + "Title": "info.h", + "DocumentMoniker": "F:\\cplusplus\\Project1\\Project1\\Project1\\info.h", + "RelativeDocumentMoniker": "Project1\\info.h", + "ToolTip": "F:\\cplusplus\\Project1\\Project1\\Project1\\info.h", + "RelativeToolTip": "Project1\\info.h", + "ViewState": "AQIAAA8AAAAAAAAAAAAAwBwAAAAAAAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|", + "WhenOpened": "2024-05-08T08:15:22.031Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 0, + "Title": "cat.h", + "DocumentMoniker": "F:\\cplusplus\\Project1\\Project1\\Project1\\cat.h", + "RelativeDocumentMoniker": "Project1\\cat.h", + "ToolTip": "F:\\cplusplus\\Project1\\Project1\\Project1\\cat.h", + "RelativeToolTip": "Project1\\cat.h", + "ViewState": "AQIAAAkAAAAAAAAAAAAAABgAAAAPAAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|", + "WhenOpened": "2024-04-24T07:58:23.578Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 1, + "Title": "main.cpp", + "DocumentMoniker": "F:\\cplusplus\\Project1\\Project1\\Project1\\main.cpp", + "RelativeDocumentMoniker": "Project1\\main.cpp", + "ToolTip": "F:\\cplusplus\\Project1\\Project1\\Project1\\main.cpp", + "RelativeToolTip": "Project1\\main.cpp", + "ViewState": "AQIAACgAAAAAAAAAAAAnwDIAAAAEAAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", + "WhenOpened": "2024-03-27T08:00:43.23Z", + "EditorCaption": "" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/sem2/Benko A/Project1/.vs/Project1/v17/Solution.VC.db b/sem2/Benko A/Project1/.vs/Project1/v17/Solution.VC.db new file mode 100644 index 00000000..1a2149d5 Binary files /dev/null and b/sem2/Benko A/Project1/.vs/Project1/v17/Solution.VC.db differ diff --git a/sem2/Benko A/Project1/.vs/Project1/v17/ipch/AutoPCH/77a0d0b83aa6bfb6/INFO.ipch b/sem2/Benko A/Project1/.vs/Project1/v17/ipch/AutoPCH/77a0d0b83aa6bfb6/INFO.ipch new file mode 100644 index 00000000..0d649401 Binary files /dev/null and b/sem2/Benko A/Project1/.vs/Project1/v17/ipch/AutoPCH/77a0d0b83aa6bfb6/INFO.ipch differ diff --git a/sem2/Benko A/Project1/.vs/Project1/v17/ipch/AutoPCH/dbd061fc72f03912/MAIN.ipch b/sem2/Benko A/Project1/.vs/Project1/v17/ipch/AutoPCH/dbd061fc72f03912/MAIN.ipch new file mode 100644 index 00000000..b7158051 Binary files /dev/null and b/sem2/Benko A/Project1/.vs/Project1/v17/ipch/AutoPCH/dbd061fc72f03912/MAIN.ipch differ diff --git a/sem2/Benko A/Project1/Project1.sln b/sem2/Benko A/Project1/Project1.sln new file mode 100644 index 00000000..6592f34b --- /dev/null +++ b/sem2/Benko A/Project1/Project1.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.9.34723.18 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Project1", "Project1\Project1.vcxproj", "{9F9A0AC9-9904-437E-9564-B2D6903BB98A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9F9A0AC9-9904-437E-9564-B2D6903BB98A}.Debug|x64.ActiveCfg = Debug|x64 + {9F9A0AC9-9904-437E-9564-B2D6903BB98A}.Debug|x64.Build.0 = Debug|x64 + {9F9A0AC9-9904-437E-9564-B2D6903BB98A}.Debug|x86.ActiveCfg = Debug|Win32 + {9F9A0AC9-9904-437E-9564-B2D6903BB98A}.Debug|x86.Build.0 = Debug|Win32 + {9F9A0AC9-9904-437E-9564-B2D6903BB98A}.Release|x64.ActiveCfg = Release|x64 + {9F9A0AC9-9904-437E-9564-B2D6903BB98A}.Release|x64.Build.0 = Release|x64 + {9F9A0AC9-9904-437E-9564-B2D6903BB98A}.Release|x86.ActiveCfg = Release|Win32 + {9F9A0AC9-9904-437E-9564-B2D6903BB98A}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {F0A68236-0B8F-4BE1-AA30-FB0B3CD5B424} + EndGlobalSection +EndGlobal diff --git a/sem2/Benko A/Project1/Project1/Project1.vcxproj b/sem2/Benko A/Project1/Project1/Project1.vcxproj new file mode 100644 index 00000000..d2bfcbc6 --- /dev/null +++ b/sem2/Benko A/Project1/Project1/Project1.vcxproj @@ -0,0 +1,156 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {9f9a0ac9-9904-437e-9564-b2d6903bb98a} + Project1 + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + C:\Users\qweco\Homework cpp\cpp\sem2\Benko A\Project1\SFML-2.6.1-windows-vc17-64-bit\SFML-2.6.1\include + + + Windows + true + C:\Users\qweco\Homework cpp\cpp\sem2\Benko A\Project1\SFML-2.6.1-windows-vc17-64-bit\SFML-2.6.1\lib + sfml-graphics-d.lib;sfml-window-d.lib;sfml-audio-d.lib;sfml-system-d.lib + mainCRTStartup + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + C:\Users\qweco\Homework cpp\cpp\sem2\Benko A\Project1\SFML-2.6.1-windows-vc17-64-bit\SFML-2.6.1\include + + + Windows + true + true + true + C:\Users\qweco\Homework cpp\cpp\sem2\Benko A\Project1\SFML-2.6.1-windows-vc17-64-bit\SFML-2.6.1\lib + sfml-graphics-d.lib;sfml-window-d.lib;sfml-audio-d.lib;sfml-system-d.lib + mainCRTStartup + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + C:\Users\qweco\Homework cpp\cpp\sem2\Benko A\Project1\SFML-2.6.1-windows-vc17-64-bit\SFML-2.6.1\include + + + Windows + true + C:\Users\qweco\Homework cpp\cpp\sem2\Benko A\Project1\SFML-2.6.1-windows-vc17-64-bit\SFML-2.6.1\lib + sfml-graphics-d.lib;sfml-window-d.lib;sfml-audio-d.lib;sfml-system-d.lib + mainCRTStartup + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + C:\Users\qweco\Homework cpp\cpp\sem2\Benko A\Project1\SFML-2.6.1-windows-vc17-64-bit\SFML-2.6.1\include + + + Windows + true + true + true + C:\Users\qweco\Homework cpp\cpp\sem2\Benko A\Project1\SFML-2.6.1-windows-vc17-64-bit\SFML-2.6.1\lib + sfml-graphics-d.lib;sfml-window-d.lib;sfml-audio-d.lib;sfml-system-d.lib + mainCRTStartup + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sem2/Benko A/Project1/Project1/Project1.vcxproj.filters b/sem2/Benko A/Project1/Project1/Project1.vcxproj.filters new file mode 100644 index 00000000..6038aa73 --- /dev/null +++ b/sem2/Benko A/Project1/Project1/Project1.vcxproj.filters @@ -0,0 +1,33 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Исходные файлы + + + + + Файлы заголовков + + + Файлы заголовков + + + Файлы заголовков + + + \ No newline at end of file diff --git a/sem2/Benko A/Project1/Project1/Project1.vcxproj.user b/sem2/Benko A/Project1/Project1/Project1.vcxproj.user new file mode 100644 index 00000000..88a55094 --- /dev/null +++ b/sem2/Benko A/Project1/Project1/Project1.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/sem2/Benko A/Project1/Project1/arial.ttf b/sem2/Benko A/Project1/Project1/arial.ttf new file mode 100644 index 00000000..ff0815cd Binary files /dev/null and b/sem2/Benko A/Project1/Project1/arial.ttf differ diff --git a/sem2/Benko A/Project1/Project1/button.h b/sem2/Benko A/Project1/Project1/button.h new file mode 100644 index 00000000..ec1145dc --- /dev/null +++ b/sem2/Benko A/Project1/Project1/button.h @@ -0,0 +1,42 @@ +#pragma once + +#include + +class Button { +private: + sf::RectangleShape sh; + sf::Text t; + +public: + Button(const sf::Vector2f& size, const sf::Vector2f& position, const sf::Color& color, const std::string& str, sf::Font& font) + { + sh.setSize(size); + sh.setPosition(position); + sh.setFillColor(color); + sh.setOutlineColor(sf::Color::White); + sh.setOutlineThickness(1); + t.setFont(font); + t.setString(str); + t.setCharacterSize(32); + t.setFillColor(sf::Color::White); + t.setOutlineColor(sf::Color::Black); + t.setOutlineThickness(1); + t.setPosition( position.x + (size.x - t.getLocalBounds().width) / 2, position.y + (size.y - t.getLocalBounds().height) / 2 ); + } + + void draw(sf::RenderWindow& window) + { + window.draw(sh); + window.draw(t); + } + + bool clicked(const sf::Vector2i& mousePos) + { + return sh.getGlobalBounds().contains(static_cast(mousePos)); + } + + void color(const sf::Color& color, sf::RenderWindow& window) + { + sh.setFillColor(color); + } +}; \ No newline at end of file diff --git a/sem2/Benko A/Project1/Project1/cat1.png b/sem2/Benko A/Project1/Project1/cat1.png new file mode 100644 index 00000000..14773a42 Binary files /dev/null and b/sem2/Benko A/Project1/Project1/cat1.png differ diff --git a/sem2/Benko A/Project1/Project1/cat2.png b/sem2/Benko A/Project1/Project1/cat2.png new file mode 100644 index 00000000..3bae20a5 Binary files /dev/null and b/sem2/Benko A/Project1/Project1/cat2.png differ diff --git a/sem2/Benko A/Project1/Project1/chin1.png b/sem2/Benko A/Project1/Project1/chin1.png new file mode 100644 index 00000000..20b36885 Binary files /dev/null and b/sem2/Benko A/Project1/Project1/chin1.png differ diff --git a/sem2/Benko A/Project1/Project1/chin2.png b/sem2/Benko A/Project1/Project1/chin2.png new file mode 100644 index 00000000..57c8cd26 Binary files /dev/null and b/sem2/Benko A/Project1/Project1/chin2.png differ diff --git a/sem2/Benko A/Project1/Project1/dog1.png b/sem2/Benko A/Project1/Project1/dog1.png new file mode 100644 index 00000000..2a7e0d47 Binary files /dev/null and b/sem2/Benko A/Project1/Project1/dog1.png differ diff --git a/sem2/Benko A/Project1/Project1/dog2.png b/sem2/Benko A/Project1/Project1/dog2.png new file mode 100644 index 00000000..02febfee Binary files /dev/null and b/sem2/Benko A/Project1/Project1/dog2.png differ diff --git a/sem2/Benko A/Project1/Project1/iClean.png b/sem2/Benko A/Project1/Project1/iClean.png new file mode 100644 index 00000000..ae2bf173 Binary files /dev/null and b/sem2/Benko A/Project1/Project1/iClean.png differ diff --git a/sem2/Benko A/Project1/Project1/iFull.png b/sem2/Benko A/Project1/Project1/iFull.png new file mode 100644 index 00000000..7adafa6b Binary files /dev/null and b/sem2/Benko A/Project1/Project1/iFull.png differ diff --git a/sem2/Benko A/Project1/Project1/iHydr.png b/sem2/Benko A/Project1/Project1/iHydr.png new file mode 100644 index 00000000..11aa1674 Binary files /dev/null and b/sem2/Benko A/Project1/Project1/iHydr.png differ diff --git a/sem2/Benko A/Project1/Project1/iSize.png b/sem2/Benko A/Project1/Project1/iSize.png new file mode 100644 index 00000000..6a26a5b0 Binary files /dev/null and b/sem2/Benko A/Project1/Project1/iSize.png differ diff --git a/sem2/Benko A/Project1/Project1/info.h b/sem2/Benko A/Project1/Project1/info.h new file mode 100644 index 00000000..4ef9d336 --- /dev/null +++ b/sem2/Benko A/Project1/Project1/info.h @@ -0,0 +1,20 @@ +#pragma once + +#include +#include +#include + +class Info { +private: + std::vector >> values; +public: + Info(const std::initializer_list>>& l) : values(l) {} + std::string getStr() + { + std::stringstream strStm; + for (auto& val : values) { + strStm << val.first << ": " << val.second.first << " / " << val.second.second << '\n' << '\n'; + } + return strStm.str(); + } +}; \ No newline at end of file diff --git a/sem2/Benko A/Project1/Project1/main.cpp b/sem2/Benko A/Project1/Project1/main.cpp new file mode 100644 index 00000000..1e8640de --- /dev/null +++ b/sem2/Benko A/Project1/Project1/main.cpp @@ -0,0 +1,269 @@ +#include +#include +#include +#include "windows.h" +#include "tam.h" +#include "info.h" +#include "button.h" + + + +enum class UTam { cat, dog, chin }; +UTam chTam(sf::RenderWindow& window, sf::Font& font) +{ + Button catB({ 200, 50 }, { 1000, 300 }, sf::Color(50, 50, 50), "CAT", font); + Button dogB({ 200, 50 }, { 1000, 400 }, sf::Color(50, 50, 50), "DOG", font); + Button chinB({ 200, 50 }, { 1000, 500 }, sf::Color(50, 50, 50), "CHINCHILLA", font); + + while (window.isOpen()) + { + sf::Vector2i mPos = sf::Mouse::getPosition(window); + sf::Event event; + while (window.pollEvent(event)) + { + if (event.type == sf::Event::Closed) window.close(); + + if (event.type == sf::Event::MouseButtonPressed) + { + if (event.mouseButton.button == sf::Mouse::Left) + { + if (catB.clicked(mPos)) + { + catB.color(sf::Color(30, 30, 30), window); + catB.draw(window); + window.display(); + Sleep(500); + return UTam::cat; + } + if (dogB.clicked(mPos)) + { + dogB.color(sf::Color(30, 30, 30), window); + dogB.draw(window); + window.display(); + Sleep(500); + return UTam::dog; + } + if (chinB.clicked(mPos)) + { + chinB.color(sf::Color(30, 30, 30), window); + chinB.draw(window); + window.display(); + Sleep(500); + return UTam::chin; + + } + } + } + } + + window.clear(sf::Color(30, 30, 30)); + catB.draw(window); + dogB.draw(window); + chinB.draw(window); + window.display(); + } +} + +void end(sf::RenderWindow& window, sf::Font& font, const std::string& message) +{ + sf::Text endT; + endT.setFont(font); + endT.setString(message); + endT.setCharacterSize(150); + endT.setFillColor(sf::Color::White); + endT.setPosition(window.getSize().x / 2, window.getSize().y / 2); + + while (window.isOpen()) + { + sf::Event event; + while (window.pollEvent(event)) + { + if (event.type == sf::Event::Closed) window.close(); + } + + window.clear(sf::Color(30, 30, 30)); + window.draw(endT); + window.display(); + } +} + +void upTamPic(const sf::Texture& tex, sf::Sprite& spr, + std::chrono::time_point& strTime, float& texDur) +{ + spr.setTexture(tex); + strTime = std::chrono::high_resolution_clock::now(); + texDur = 0.25f; +} + + + + +int main() +{ + + bool isPaused = false; + + sf::RenderWindow window(sf::VideoMode::getDesktopMode(), "GAMESTARTED"); + window.setFramerateLimit(60); + + sf::Event event; + + sf::Font font; + if (!font.loadFromFile("arial.ttf")) {} + + UTam UTam = chTam(window, font); + + sf::Texture tex1, tex2; + if (UTam == UTam::cat) + { + tex1.loadFromFile("cat1.png"); + tex2.loadFromFile("cat2.png"); + } + else if (UTam == UTam::dog) + { + tex1.loadFromFile("dog1.png"); + tex2.loadFromFile("dog2.png"); + } + else if (UTam == UTam::chin) + { + tex1.loadFromFile("chin1.png"); + tex2.loadFromFile("chin2.png"); + } + sf::Sprite sprite; + sprite.setTexture(tex1); + sprite.setScale(sf::Vector2f(0.01f, 0.01f)); + + + Tam tam(1, 100, 1000, 1000); + Info info( + { + {"Size", {tam.getSize(), tam.getMaxSize()}}, + {"Fullness", {tam.getFull(), tam.getMaxFull()}}, + {"Hydration", {tam.getHydr(), tam.getMaxHydr()}}, + {"Cleanliness", {tam.getClean(), tam.getMaxClean()}} + }); + + sf::Text text; + text.setFont(font); + text.setFillColor(sf::Color::White); + text.setString(info.getStr()); + text.setCharacterSize(35); + text.setPosition(window.getSize().x / 2, window.getSize().y / 10); + + sf::Texture iTexSize, iTexFull, iTexHydr, iTexClean; + if (!iTexSize.loadFromFile("iSize.png") || !iTexFull.loadFromFile("iFull.png") || !iTexHydr.loadFromFile("iHydr.png") || !iTexClean.loadFromFile("iClean.png")) + { + } + sf::Sprite iSize(iTexSize); + sf::Sprite iFull(iTexFull); + sf::Sprite iHydr(iTexHydr); + sf::Sprite iClean(iTexClean); + iSize.setScale(sf::Vector2f(0.8f, 0.8f)); + iFull.setScale(sf::Vector2f(0.8f, 0.8f)); + iHydr.setScale(sf::Vector2f(0.8f, 0.8f)); + iClean.setScale(sf::Vector2f(0.8f, 0.8f)); + float iOff = 100.0f; + iSize.setPosition(text.getPosition().x - iOff, text.getPosition().y); + iFull.setPosition(text.getPosition().x - iOff, text.getPosition().y + 75); + iHydr.setPosition(text.getPosition().x - iOff, text.getPosition().y + 150); + iClean.setPosition(text.getPosition().x - iOff, text.getPosition().y + 225); + + + + Button feed({ 200, 50 }, { text.getPosition().x, 500 }, sf::Color(50, 50, 50), "Feed", font); + Button drink({ 200, 50 }, { text.getPosition().x + 200, 500 }, sf::Color(50, 50, 50), "Drink", font); + Button wash({ 200, 50 }, { text.getPosition().x + 400, 500 }, sf::Color(50, 50, 50), "Wash", font); + Button pause({ 50, 50 }, { text.getPosition().x + 600, 500 }, sf::Color(50, 50, 50), "||", font); + + + + std::chrono::time_point startTime = std::chrono::high_resolution_clock::now(); + float texDur = 0.0f; + + while (window.isOpen()) + { + if (!isPaused) + { + if (tam.isDead()) + { + end(window, font, "YOU LOSED!((("); + return 0; + } + if (tam.isSuccess()) + { + end(window, font, "YOU WON!)))"); + return 0; + } + + tam.live(); + sprite.setScale(sf::Vector2f(float(tam.getSize()) / tam.getMaxSize(), float(tam.getSize()) / tam.getMaxSize())); + } + + while (window.pollEvent(event)) + { + std::chrono::duration duration = std::chrono::high_resolution_clock::now() - startTime; + if (texDur > 0.0f) + { + texDur -= duration.count(); + if (texDur <= 0.0f) + { + sprite.setTexture(tex1); + } + } + + if (event.type == sf::Event::Closed) window.close(); + + if (event.type == sf::Event::MouseButtonPressed) + { + if (event.mouseButton.button == sf::Mouse::Left) + { + sf::Vector2i mousePos = sf::Mouse::getPosition(window); + + if (feed.clicked(mousePos) && !isPaused) + { + tam.increaseFull(200); + upTamPic(tex2, sprite, startTime, texDur); + } + if (wash.clicked(mousePos) && !isPaused) + { + tam.increaseClean(200); + upTamPic(tex2, sprite, startTime, texDur); + } + if (drink.clicked(mousePos) && !isPaused) + { + tam.increaseHydr(200); + upTamPic(tex2, sprite, startTime, texDur); + } + if (pause.clicked(mousePos)) + { + isPaused = !isPaused; + } + } + } + } + + Info info( + { + {"Size", {tam.getSize(), tam.getMaxSize()}}, + {"Fullness", {tam.getFull(), tam.getMaxFull()}}, + {"Hydration", {tam.getHydr(), tam.getMaxHydr()}}, + {"Cleanliness", {tam.getClean(), tam.getMaxClean()}} + }); + text.setString(info.getStr()); + + window.clear(sf::Color(30, 30, 30)); + window.draw(sprite); + window.draw(text); + window.draw(iSize); + window.draw(iFull); + window.draw(iHydr); + window.draw(iClean); + feed.draw(window); + wash.draw(window); + drink.draw(window); + pause.draw(window); + window.display(); + } + + return 0; +} \ No newline at end of file diff --git a/sem2/Benko A/Project1/Project1/tam.h b/sem2/Benko A/Project1/Project1/tam.h new file mode 100644 index 00000000..f2b664ee --- /dev/null +++ b/sem2/Benko A/Project1/Project1/tam.h @@ -0,0 +1,97 @@ +#pragma once + + +class Tam { +private: + int size; + const int maxSize; + int speedGrowth; + int full; + const int maxFull; + int hydr; + const int maxHydr; + int clean; + const int maxClean; + +public: + Tam(int _speedGrowth, + int _full, + int _hydr, + int _clean + ) : size{ 10 }, + speedGrowth{ _speedGrowth }, + full{ _full }, + hydr{ _hydr }, + clean{ _clean }, + maxSize{ 100 }, + maxFull{ 1000 }, + maxHydr{ 1000 }, + maxClean{ 1000 } + { + + } + + void live() { + catGrow(); + + decreaseFull(1); + decreaseHydr(1); + decreaseClean(1); + } + + bool isDead() { + return 0 == size or 0 == clean or 0 == hydr; + } + + bool isSuccess() { + return maxSize <= size; + } + + void catGrow() { + if (full >= maxFull) { + full = maxFull / 3 * 2; + increaseSize(); + } + if (full <= 0) { + full = 1000; + decreaseSize(); + } + if (hydr >= maxHydr) { + hydr = maxHydr; + } + if (hydr <= 0) { + hydr = 0; + decreaseSize(); + } + if (clean >= maxClean) { + clean = maxClean; + } + if (clean <= 0) { + clean = 0; + decreaseSize(); + } + } + + + void increaseSize() { size += speedGrowth; } + void decreaseSize() { if (size > 0) size -= speedGrowth; } + + void increaseFull(const int value) { if (full < maxFull) full += value; } + void decreaseFull(const int value) { if (full > 0) full -= value; } + + void increaseHydr(const int value) { if (hydr < maxHydr) hydr += value; } + void decreaseHydr(const int value) { if (hydr > 0) hydr -= value; } + + void increaseClean(const int value) { if (clean < maxClean) clean += value; } + void decreaseClean(const int value) { if (clean > 0) clean -= value; } + + const int getSpeedGrowth() { return speedGrowth; } + const int getSize() { return size; } + const int getMaxSize() { return maxSize; } + const int getFull() { return full; } + const int getMaxFull() { return maxFull; } + const int getHydr() { return hydr; } + const int getMaxHydr() { return maxHydr; } + const int getClean() { return clean; } + const int getMaxClean() { return maxClean; } +}; \ No newline at end of file diff --git a/sem2/Benko A/Project1/Project1/x64/Debug/Project1.Build.CppClean.log b/sem2/Benko A/Project1/Project1/x64/Debug/Project1.Build.CppClean.log new file mode 100644 index 00000000..0348c178 --- /dev/null +++ b/sem2/Benko A/Project1/Project1/x64/Debug/Project1.Build.CppClean.log @@ -0,0 +1,14 @@ +f:\cplusplus\project1\project1\project1\x64\debug\vc143.pdb +f:\cplusplus\project1\project1\project1\x64\debug\vc143.idb +f:\cplusplus\project1\project1\project1\x64\debug\main.obj +f:\cplusplus\project1\project1\x64\debug\project1.exe +f:\cplusplus\project1\project1\x64\debug\project1.pdb +f:\cplusplus\project1\project1\project1\x64\debug\project1.ilk +f:\cplusplus\project1\project1\project1\x64\debug\project1.tlog\cl.command.1.tlog +f:\cplusplus\project1\project1\project1\x64\debug\project1.tlog\cl.items.tlog +f:\cplusplus\project1\project1\project1\x64\debug\project1.tlog\cl.read.1.tlog +f:\cplusplus\project1\project1\project1\x64\debug\project1.tlog\cl.write.1.tlog +f:\cplusplus\project1\project1\project1\x64\debug\project1.tlog\link.command.1.tlog +f:\cplusplus\project1\project1\project1\x64\debug\project1.tlog\link.read.1.tlog +f:\cplusplus\project1\project1\project1\x64\debug\project1.tlog\link.secondary.1.tlog +f:\cplusplus\project1\project1\project1\x64\debug\project1.tlog\link.write.1.tlog diff --git a/sem2/Benko A/Project1/Project1/x64/Debug/Project1.exe.recipe b/sem2/Benko A/Project1/Project1/x64/Debug/Project1.exe.recipe new file mode 100644 index 00000000..98ae7238 --- /dev/null +++ b/sem2/Benko A/Project1/Project1/x64/Debug/Project1.exe.recipe @@ -0,0 +1,11 @@ + + + + + C:\Users\qweco\Homework cpp\cpp\sem2\Benko A\Project1\x64\Debug\Project1.exe + + + + + + \ No newline at end of file diff --git a/sem2/Benko A/Project1/Project1/x64/Debug/Project1.ilk b/sem2/Benko A/Project1/Project1/x64/Debug/Project1.ilk new file mode 100644 index 00000000..c67350ee Binary files /dev/null and b/sem2/Benko A/Project1/Project1/x64/Debug/Project1.ilk differ diff --git a/sem2/Benko A/Project1/Project1/x64/Debug/Project1.log b/sem2/Benko A/Project1/Project1/x64/Debug/Project1.log new file mode 100644 index 00000000..454f0292 --- /dev/null +++ b/sem2/Benko A/Project1/Project1/x64/Debug/Project1.log @@ -0,0 +1,23 @@ + main.cpp +C:\Users\qweco\Homework cpp\cpp\sem2\Benko A\Project1\Project1\main.cpp(74,65): warning C4244: аргумент: преобразование "T" в "float", возможна потеря данных + with + [ + T=unsigned int + ] +C:\Users\qweco\Homework cpp\cpp\sem2\Benko A\Project1\Project1\main.cpp(74,41): warning C4244: аргумент: преобразование "T" в "float", возможна потеря данных + with + [ + T=unsigned int + ] +C:\Users\qweco\Homework cpp\cpp\sem2\Benko A\Project1\Project1\main.cpp(151,65): warning C4244: аргумент: преобразование "T" в "float", возможна потеря данных + with + [ + T=unsigned int + ] +C:\Users\qweco\Homework cpp\cpp\sem2\Benko A\Project1\Project1\main.cpp(151,41): warning C4244: аргумент: преобразование "T" в "float", возможна потеря данных + with + [ + T=unsigned int + ] +C:\Users\qweco\Homework cpp\cpp\sem2\Benko A\Project1\Project1\main.cpp(65): warning C4715: chTam: значение возвращается не при всех путях выполнения + Project1.vcxproj -> C:\Users\qweco\Homework cpp\cpp\sem2\Benko A\Project1\x64\Debug\Project1.exe diff --git a/sem2/Benko A/Project1/Project1/x64/Debug/Project1.tlog/CL.command.1.tlog b/sem2/Benko A/Project1/Project1/x64/Debug/Project1.tlog/CL.command.1.tlog new file mode 100644 index 00000000..88450739 Binary files /dev/null and b/sem2/Benko A/Project1/Project1/x64/Debug/Project1.tlog/CL.command.1.tlog differ diff --git a/sem2/Benko A/Project1/Project1/x64/Debug/Project1.tlog/CL.read.1.tlog b/sem2/Benko A/Project1/Project1/x64/Debug/Project1.tlog/CL.read.1.tlog new file mode 100644 index 00000000..247742d9 Binary files /dev/null and b/sem2/Benko A/Project1/Project1/x64/Debug/Project1.tlog/CL.read.1.tlog differ diff --git a/sem2/Benko A/Project1/Project1/x64/Debug/Project1.tlog/CL.write.1.tlog b/sem2/Benko A/Project1/Project1/x64/Debug/Project1.tlog/CL.write.1.tlog new file mode 100644 index 00000000..8aa42028 Binary files /dev/null and b/sem2/Benko A/Project1/Project1/x64/Debug/Project1.tlog/CL.write.1.tlog differ diff --git a/sem2/Benko A/Project1/Project1/x64/Debug/Project1.tlog/Cl.items.tlog b/sem2/Benko A/Project1/Project1/x64/Debug/Project1.tlog/Cl.items.tlog new file mode 100644 index 00000000..b38215d2 --- /dev/null +++ b/sem2/Benko A/Project1/Project1/x64/Debug/Project1.tlog/Cl.items.tlog @@ -0,0 +1 @@ +F:\cplusplus\Project1\Project1\Project1\main.cpp;F:\cplusplus\Project1\Project1\Project1\x64\Debug\main.obj diff --git a/sem2/Benko A/Project1/Project1/x64/Debug/Project1.tlog/Project1.lastbuildstate b/sem2/Benko A/Project1/Project1/x64/Debug/Project1.tlog/Project1.lastbuildstate new file mode 100644 index 00000000..bf9304ad --- /dev/null +++ b/sem2/Benko A/Project1/Project1/x64/Debug/Project1.tlog/Project1.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:TargetPlatformVersion=10.0.19041.0: +Debug|x64|C:\Users\qweco\Homework cpp\cpp\sem2\Benko A\Project1\| diff --git a/sem2/Benko A/Project1/Project1/x64/Debug/Project1.tlog/link.command.1.tlog b/sem2/Benko A/Project1/Project1/x64/Debug/Project1.tlog/link.command.1.tlog new file mode 100644 index 00000000..a323aed4 Binary files /dev/null and b/sem2/Benko A/Project1/Project1/x64/Debug/Project1.tlog/link.command.1.tlog differ diff --git a/sem2/Benko A/Project1/Project1/x64/Debug/Project1.tlog/link.read.1.tlog b/sem2/Benko A/Project1/Project1/x64/Debug/Project1.tlog/link.read.1.tlog new file mode 100644 index 00000000..8d46e41d Binary files /dev/null and b/sem2/Benko A/Project1/Project1/x64/Debug/Project1.tlog/link.read.1.tlog differ diff --git a/sem2/Benko A/Project1/Project1/x64/Debug/Project1.tlog/link.secondary.1.tlog b/sem2/Benko A/Project1/Project1/x64/Debug/Project1.tlog/link.secondary.1.tlog new file mode 100644 index 00000000..cb978a1c --- /dev/null +++ b/sem2/Benko A/Project1/Project1/x64/Debug/Project1.tlog/link.secondary.1.tlog @@ -0,0 +1,2 @@ +^F:\CPLUSPLUS\PROJECT1\PROJECT1\PROJECT1\X64\DEBUG\MAIN.OBJ +F:\cplusplus\Project1\Project1\Project1\x64\Debug\Project1.ilk diff --git a/sem2/Benko A/Project1/Project1/x64/Debug/Project1.tlog/link.write.1.tlog b/sem2/Benko A/Project1/Project1/x64/Debug/Project1.tlog/link.write.1.tlog new file mode 100644 index 00000000..3328c730 Binary files /dev/null and b/sem2/Benko A/Project1/Project1/x64/Debug/Project1.tlog/link.write.1.tlog differ diff --git a/sem2/Benko A/Project1/Project1/x64/Debug/Project1.vcxproj.FileListAbsolute.txt b/sem2/Benko A/Project1/Project1/x64/Debug/Project1.vcxproj.FileListAbsolute.txt new file mode 100644 index 00000000..e69de29b diff --git a/sem2/Benko A/Project1/Project1/x64/Debug/main.obj b/sem2/Benko A/Project1/Project1/x64/Debug/main.obj new file mode 100644 index 00000000..9284c3dc Binary files /dev/null and b/sem2/Benko A/Project1/Project1/x64/Debug/main.obj differ diff --git a/sem2/Benko A/Project1/Project1/x64/Debug/main.obj.enc b/sem2/Benko A/Project1/Project1/x64/Debug/main.obj.enc new file mode 100644 index 00000000..45088a4f Binary files /dev/null and b/sem2/Benko A/Project1/Project1/x64/Debug/main.obj.enc differ diff --git a/sem2/Benko A/Project1/Project1/x64/Debug/vc142.idb b/sem2/Benko A/Project1/Project1/x64/Debug/vc142.idb new file mode 100644 index 00000000..8a0bc7d3 Binary files /dev/null and b/sem2/Benko A/Project1/Project1/x64/Debug/vc142.idb differ diff --git a/sem2/Benko A/Project1/Project1/x64/Debug/vc142.pdb b/sem2/Benko A/Project1/Project1/x64/Debug/vc142.pdb new file mode 100644 index 00000000..49e52452 Binary files /dev/null and b/sem2/Benko A/Project1/Project1/x64/Debug/vc142.pdb differ diff --git a/sem2/Benko A/Project1/Project1/x64/Debug/vc143.idb b/sem2/Benko A/Project1/Project1/x64/Debug/vc143.idb new file mode 100644 index 00000000..29af8427 Binary files /dev/null and b/sem2/Benko A/Project1/Project1/x64/Debug/vc143.idb differ diff --git a/sem2/Benko A/Project1/Project1/x64/Debug/vc143.pdb b/sem2/Benko A/Project1/Project1/x64/Debug/vc143.pdb new file mode 100644 index 00000000..b384adfd Binary files /dev/null and b/sem2/Benko A/Project1/Project1/x64/Debug/vc143.pdb differ diff --git a/sem2/Benko A/Project1/exe/Project1.exe b/sem2/Benko A/Project1/exe/Project1.exe new file mode 100644 index 00000000..be552f83 Binary files /dev/null and b/sem2/Benko A/Project1/exe/Project1.exe differ diff --git a/sem2/Benko A/Project1/exe/arial.ttf b/sem2/Benko A/Project1/exe/arial.ttf new file mode 100644 index 00000000..ff0815cd Binary files /dev/null and b/sem2/Benko A/Project1/exe/arial.ttf differ diff --git a/sem2/Benko A/Project1/exe/cat1.png b/sem2/Benko A/Project1/exe/cat1.png new file mode 100644 index 00000000..14773a42 Binary files /dev/null and b/sem2/Benko A/Project1/exe/cat1.png differ diff --git a/sem2/Benko A/Project1/exe/cat2.png b/sem2/Benko A/Project1/exe/cat2.png new file mode 100644 index 00000000..3bae20a5 Binary files /dev/null and b/sem2/Benko A/Project1/exe/cat2.png differ diff --git a/sem2/Benko A/Project1/exe/chin1.png b/sem2/Benko A/Project1/exe/chin1.png new file mode 100644 index 00000000..20b36885 Binary files /dev/null and b/sem2/Benko A/Project1/exe/chin1.png differ diff --git a/sem2/Benko A/Project1/exe/chin2.png b/sem2/Benko A/Project1/exe/chin2.png new file mode 100644 index 00000000..57c8cd26 Binary files /dev/null and b/sem2/Benko A/Project1/exe/chin2.png differ diff --git a/sem2/Benko A/Project1/exe/dog1.png b/sem2/Benko A/Project1/exe/dog1.png new file mode 100644 index 00000000..2a7e0d47 Binary files /dev/null and b/sem2/Benko A/Project1/exe/dog1.png differ diff --git a/sem2/Benko A/Project1/exe/dog2.png b/sem2/Benko A/Project1/exe/dog2.png new file mode 100644 index 00000000..02febfee Binary files /dev/null and b/sem2/Benko A/Project1/exe/dog2.png differ diff --git a/sem2/Benko A/Project1/exe/iClean.png b/sem2/Benko A/Project1/exe/iClean.png new file mode 100644 index 00000000..ae2bf173 Binary files /dev/null and b/sem2/Benko A/Project1/exe/iClean.png differ diff --git a/sem2/Benko A/Project1/exe/iFull.png b/sem2/Benko A/Project1/exe/iFull.png new file mode 100644 index 00000000..7adafa6b Binary files /dev/null and b/sem2/Benko A/Project1/exe/iFull.png differ diff --git a/sem2/Benko A/Project1/exe/iHydr.png b/sem2/Benko A/Project1/exe/iHydr.png new file mode 100644 index 00000000..11aa1674 Binary files /dev/null and b/sem2/Benko A/Project1/exe/iHydr.png differ diff --git a/sem2/Benko A/Project1/exe/iSize.png b/sem2/Benko A/Project1/exe/iSize.png new file mode 100644 index 00000000..6a26a5b0 Binary files /dev/null and b/sem2/Benko A/Project1/exe/iSize.png differ diff --git a/sem2/Benko A/Project1/x64/Debug/Project1.exe b/sem2/Benko A/Project1/x64/Debug/Project1.exe new file mode 100644 index 00000000..be552f83 Binary files /dev/null and b/sem2/Benko A/Project1/x64/Debug/Project1.exe differ diff --git a/sem2/Benko A/Project1/x64/Debug/Project1.pdb b/sem2/Benko A/Project1/x64/Debug/Project1.pdb new file mode 100644 index 00000000..d234e5c6 Binary files /dev/null and b/sem2/Benko A/Project1/x64/Debug/Project1.pdb differ diff --git a/sem2/Benko A/Project1/x64/Debug/arial.ttf b/sem2/Benko A/Project1/x64/Debug/arial.ttf new file mode 100644 index 00000000..ff0815cd Binary files /dev/null and b/sem2/Benko A/Project1/x64/Debug/arial.ttf differ diff --git a/sem2/Benko A/Project1/x64/Debug/cat1.png b/sem2/Benko A/Project1/x64/Debug/cat1.png new file mode 100644 index 00000000..51b2f427 Binary files /dev/null and b/sem2/Benko A/Project1/x64/Debug/cat1.png differ diff --git a/sem2/Benko A/Project1/x64/Debug/cat2.png b/sem2/Benko A/Project1/x64/Debug/cat2.png new file mode 100644 index 00000000..1298554c Binary files /dev/null and b/sem2/Benko A/Project1/x64/Debug/cat2.png differ diff --git a/sem2/Benko A/Project1/x64/Debug/iSize.png b/sem2/Benko A/Project1/x64/Debug/iSize.png new file mode 100644 index 00000000..6a26a5b0 Binary files /dev/null and b/sem2/Benko A/Project1/x64/Debug/iSize.png differ diff --git a/sem2/KondyukovKR/all/Project1/.vs/Project1/v16/.suo b/sem2/KondyukovKR/all/Project1/.vs/Project1/v16/.suo new file mode 100644 index 00000000..fd0e5d0c Binary files /dev/null and b/sem2/KondyukovKR/all/Project1/.vs/Project1/v16/.suo differ diff --git a/sem2/KondyukovKR/all/Project1/.vs/Project1/v16/Browse.VC.db b/sem2/KondyukovKR/all/Project1/.vs/Project1/v16/Browse.VC.db new file mode 100644 index 00000000..fea24702 Binary files /dev/null and b/sem2/KondyukovKR/all/Project1/.vs/Project1/v16/Browse.VC.db differ diff --git a/sem2/KondyukovKR/all/Project1/Project1/Project1.vcxproj b/sem2/KondyukovKR/all/Project1/Project1/Project1.vcxproj index d2c1ccda..f0129e96 100644 --- a/sem2/KondyukovKR/all/Project1/Project1/Project1.vcxproj +++ b/sem2/KondyukovKR/all/Project1/Project1/Project1.vcxproj @@ -78,7 +78,7 @@ true - Console + Windows true @@ -92,7 +92,7 @@ true - Console + Windows true true true @@ -107,7 +107,7 @@ F:\cplusplus\SFML-2.6.1\include;%(AdditionalIncludeDirectories) - Console + Windows true F:\cplusplus\SFML-2.6.1\lib;%(AdditionalLibraryDirectories) sfml-system-d.lib;sfml-window-d.lib;sfml-graphics-d.lib;%(AdditionalDependencies) @@ -123,7 +123,7 @@ true - Console + Windows true true true diff --git a/sem2/KondyukovKR/all/Project1/Project1/x64/Debug/Project1.log b/sem2/KondyukovKR/all/Project1/Project1/x64/Debug/Project1.log index cb7a4df8..6b7e64b1 100644 --- a/sem2/KondyukovKR/all/Project1/Project1/x64/Debug/Project1.log +++ b/sem2/KondyukovKR/all/Project1/Project1/x64/Debug/Project1.log @@ -1,12 +1 @@ - main.cpp -F:\cplusplus\Project1\Project1\Project1\main.cpp(62,59): warning C4244: аргумент: преобразование "T" в "float", возможна потеря данных -F:\cplusplus\Project1\Project1\Project1\main.cpp(62,59): warning C4244: with -F:\cplusplus\Project1\Project1\Project1\main.cpp(62,59): warning C4244: [ -F:\cplusplus\Project1\Project1\Project1\main.cpp(62,59): warning C4244: T=unsigned int -F:\cplusplus\Project1\Project1\Project1\main.cpp(62,59): warning C4244: ] -F:\cplusplus\Project1\Project1\Project1\main.cpp(62,37): warning C4244: аргумент: преобразование "T" в "float", возможна потеря данных -F:\cplusplus\Project1\Project1\Project1\main.cpp(62,37): warning C4244: with -F:\cplusplus\Project1\Project1\Project1\main.cpp(62,37): warning C4244: [ -F:\cplusplus\Project1\Project1\Project1\main.cpp(62,37): warning C4244: T=unsigned int -F:\cplusplus\Project1\Project1\Project1\main.cpp(62,37): warning C4244: ] - Project1.vcxproj -> F:\cplusplus\Project1\Project1\x64\Debug\Project1.exe +C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(439,5): error MSB8020: Не удается найти средства сборки для v143 (набор инструментов платформы = "v143"). Чтобы выполнить сборку с использованием средств сборки v143 установите средства сборки v143. Кроме того, можно выполнить обновление до текущей версии средств Visual Studio, перейдя в меню "Проект" или щелкнув решение правой кнопкой мыши и выбрав "Обновить решение...".