This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Okienka pierwsze starcie.cpp : definiuje punkt wejścia dla aplikacji | |
// | |
#include "stdafx.h" | |
#include "Okienka pierwsze starcie.h" | |
#include <windowsx.h> | |
#define MAX_LOADSTRING 100 | |
// Zmienne globalne: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ScoreBoard::ScoreBoard() : filestatus(true) { | |
std::ifstream scoreFile("score.dat"); | |
if (!scoreFile.is_open()) { | |
filestatus = false; | |
for (auto &i : score) | |
i = 0; | |
} else { | |
for (auto &i : score) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
do | |
{ | |
tst = 0; | |
char keyboardChar = _getch(); | |
actualMove = (keyboardChar == 'w' || keyboardChar == 'W') && p_p_worldArr[p_player->get_actX()][p_player->get_actY()].get_exitCell(0) ? 0 | |
: (keyboardChar == 'd' || keyboardChar == 'D') && p_p_worldArr[p_player->get_actX()][p_player->get_actY()].get_exitCell(1) ? 1 | |
: (keyboardChar == 's' || keyboardChar == 'S') && p_p_worldArr[p_player->get_actX()][p_player->get_actY()].get_exitCell(2) ? 2 | |
: (keyboardChar == 'a' || keyboardChar == 'A') && p_p_worldArr[p_player->get_actX()][p_player->get_actY()].get_exitCell(3) ? 3 | |
: (keyboardChar == 'q' || keyboardChar == 'Q') && (p_player->get_actX() == p_player->get_endX() && p_player->get_actY() == p_player->get_endY()) ? 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace particle { | |
Screen::Screen() | |
: m_window(NULL), m_renderer(NULL), m_texture(NULL), m_buffer1(NULL) {} | |
bool Screen::init() { | |
if (SDL_Init(SDL_INIT_VIDEO) < 0) { | |
return false; | |
} | |
m_window = SDL_CreateWindow("Particle Explosion", SDL_WINDOWPOS_UNDEFINED, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <random> | |
int main(){ | |
std::default_random_engine generator; | |
//wyświetla 20 liczb losowych z zakresu 0 do 9 | |
std::uniform_int_distribution<int> distribution(0, 9); | |
for (int i = 0; i<20; ++i) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <random> | |
int main() | |
{ | |
std::default_random_engine generator; | |
for (int i = 0; i<20; ++i) { | |
std::cout << generator <<std::endl; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int Player::gameOver() | |
{ | |
system("cls"); | |
std::cout << " HP " << get_playerHp() << " zakonczone rundy " << get_playerRounds() << " Pozostalo czasu " | |
<< get_playerTime() << std::endl << std::endl; | |
if (get_endGame() == 1) std::cout << "\nNiestety twoje zdrowie spadlo do zera... umarles :) " << std::endl; | |
if (get_endGame() == 2) std::cout << "\nUciekasz wyjsciem bezpieczenstwa przed zakonczeniem zadania." << std::endl; | |
if (get_endGame() == 4) std::cout << "\nNiestety koniec czasu - przegrales." << std::endl; | |
if (get_endGame() == 3) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ScoreBoard.h ************************************************************ | |
#pragma once | |
/* | |
* Tworzenie tabeli wygranych i zapis do pliku | |
*/ | |
class ScoreBoard | |
{ | |
int score[10]{}; //Tabela najwyzszych 10 wynikow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int actualMove; | |
do | |
{ | |
tst = 0; | |
char keyboardChar = _getch(); //Pobieranie znaku z klawiatury | |
actualMove = (keyboardChar == 'w' || keyboardChar == 'W') && p_p_worldArr[p_player->get_actX()][p_player->get_actY()].get_exitCell(0) ? 0 | |
: (keyboardChar == 'd' || keyboardChar == 'D') && p_p_worldArr[p_player->get_actX()][p_player->get_actY()].get_exitCell(1) ? 1 | |
: (keyboardChar == 's' || keyboardChar == 'S') && p_p_worldArr[p_player->get_actX()][p_player->get_actY()].get_exitCell(2) ? 2 | |
: (keyboardChar == 'a' || keyboardChar == 'A') && p_p_worldArr[p_player->get_actX()][p_player->get_actY()].get_exitCell(3) ? 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int actualMove; | |
do | |
{ | |
tst = 0; | |
char keyboardChar = _getch(); //Pobieranie znaku z klawiatury | |
if ((keyboardChar == 'w' || keyboardChar == 'W') && p_p_worldArr[p_player->get_actX()][p_player->get_actY()].get_exitCell(0)) actualMove = 0; | |
else if ((keyboardChar == 'd' || keyboardChar == 'D') && p_p_worldArr[p_player->get_actX()][p_player->get_actY()].get_exitCell(1)) actualMove = 1; | |
else if ((keyboardChar == 's' || keyboardChar == 'S') && p_p_worldArr[p_player->get_actX()][p_player->get_actY()].get_exitCell(2)) actualMove = 2; | |
else if ((keyboardChar == 'a' || keyboardChar == 'A') && p_p_worldArr[p_player->get_actX()][p_player->get_actY()].get_exitCell(3)) actualMove = 3; |
NewerOlder