diff --git a/Bomb/Bomb.cpp b/Bomb/Bomb.cpp deleted file mode 100644 index fbdfe03..0000000 --- a/Bomb/Bomb.cpp +++ /dev/null @@ -1,50 +0,0 @@ -#include "Bomb.h" - - - -Bomb::Bomb(int x = 0, int y = 0) -{ - loadBombTexture(); - m_bomb_sprite.setPosition(x, y); -} - -Bomb::~Bomb() -{ -} - -void Bomb::GenerateBomb(int x, int y) -{ - Bomb* plant = new Bomb(x,y); - m_bomb.push_back(plant); - std::cout << "Bomb planted at: " << x << " " << y << std::endl; -} - -void Bomb::Draw(sf::RenderWindow & window) -{ - for (int i = 0; i < m_bomb.size(); i++) - window.draw(m_bomb[i]->getSprite()); -} -//TODO -void Bomb::loadBombTexture() -{ - if (!m_texture.loadFromFile("data/bomb.png")) - std::cout << "COULD NOT LOADED BOMB TEXTURE!" << std::endl; - m_bomb_sprite.setTexture(m_texture); -} -//TODO -void Bomb::explosion() -{ - /*if (!m_texture.loadFromFile("")) - std::cout << "COULD NOT LOADED EXPLOSION TEXTURE!" << std::endl; - m_bomb_sprite.setTexture(m_texture);*/ -} - -sf::Sprite Bomb::getSprite() -{ - return m_bomb_sprite; -} - -void Bomb::GetElapsedTime(float &time) -{ - time = elapsedTime; -} diff --git a/Bomb/Bomb.h b/Bomb/Bomb.h deleted file mode 100644 index ea637aa..0000000 --- a/Bomb/Bomb.h +++ /dev/null @@ -1,25 +0,0 @@ -#pragma once -#include -#include - -class Bomb -{ -public: - Bomb(int ,int); - ~Bomb(); - - void GenerateBomb(int, int); - void Draw(sf::RenderWindow&); - void GetElapsedTime(float&); - -private: - sf::Sprite m_bomb_sprite; - sf::Texture m_texture; - std::vector m_bomb; - - sf::Sprite getSprite(); - float elapsedTime; - - void loadBombTexture(); - void explosion(); -}; diff --git a/Bomberman.xml b/Bomberman.xml deleted file mode 100644 index 9a83ed3..0000000 --- a/Bomberman.xml +++ /dev/null @@ -1 +0,0 @@ -7Vltb+I4EP41SHsfriJJYdmP5WXblXonVCp199PJTQyx1om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cMmAQkyzIRVsmEZentd/QiaJxuf5BTrTEeNY4ganEVzjwgbPPd6bTkj7bs6TDNJTNiXR2xzUk0whQJLkVy5363m+pJOVMrHXLqVT5vqBnq1zJCzYxdcMNMztjrog8jsVl4TiXbQra+pPx3TPl9d7DlzjYc4eV967BqmXeOnfv5mJRfPnJwBx6zpYZ0hwKxF3vPKPZlemf4EVL5SqNlTOp4dfll8p+VCnlsOKpUaJPsWUoFUv2lVDgff22lQht/5wg4dOxfoi8Bxb91upFhbrMe+pSnOBgAjzSPOrwAIxRM/sUxSfvBbp8luFft51FG82ydfT9uJrbTj52dLuHt3bZH8+ClPSO7X++nbBBXDpyllvauuvDTqlxNX3kFMOVawPywOMvdzl+EyStwurYdugO6rTc/vCq3tW41AJQr9Tfc/zGVuquoiWxH7P+lTofb4s9N27z4BzmY/AY= \ No newline at end of file diff --git a/Game/Game.cpp b/Game/Game.cpp deleted file mode 100644 index 8e8354b..0000000 --- a/Game/Game.cpp +++ /dev/null @@ -1,66 +0,0 @@ -#include "Game.h" - -Game::Game() :Bomb(0,0) -{ - window.create(sf::VideoMode(m_SCREEN_WIDTH, m_SCREEN_HEIGHT), "Bomberman v.0.001 - PiGames", sf::Style::Close); - window.setFramerateLimit(60); - player.SetTexture(); -} - -void Game::Start() -{ - sf::Time lastUpdate = sf::Time::Zero; - sf::Clock time; - - elapsed = time.getElapsedTime().asSeconds(); - GetElapsedTime(elapsed); - - while (window.isOpen()) - { - sf::Event event; - while (window.pollEvent(event)) - { - if (event.type == sf::Event::Closed) - window.close(); - if (event.type == sf::Event::KeyReleased && event.key.code == sf::Keyboard::Space) - { - GenerateBomb(player.getPosX(),player.getPosY()); - } - } - float delta = time.getElapsedTime().asSeconds() - lastUpdate.asSeconds(); - update(delta); - std::cout << "X: " << player.getPosX() << " Y: " << player.getPosY() << std::endl; - lastUpdate = time.getElapsedTime(); - - draw(); - } -} - -void Game::draw() -{ - window.clear(sf::Color::White); - Draw(window); - player.Draw(window); - window.display(); -} -//TODO -void Game::update(float delta) -{ - float speed = 300.f; - if (sf::Keyboard::isKeyPressed(sf::Keyboard::Left)) - { - player.Move(-(speed *delta), 0); - } - if (sf::Keyboard::isKeyPressed(sf::Keyboard::Right)) - { - player.Move(speed *delta, 0); - } - if (sf::Keyboard::isKeyPressed(sf::Keyboard::Down)) - { - player.Move(0, speed *delta); - } - if (sf::Keyboard::isKeyPressed(sf::Keyboard::Up)) - { - player.Move(0, -(speed *delta)); - } -} diff --git a/Game/Game.h b/Game/Game.h deleted file mode 100644 index 6a01cd7..0000000 --- a/Game/Game.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once -#include -#include "../Player/Player.h" -#include "../Bomb/Bomb.h" -#include - -class Game :public Bomb -{ -public: - Game(); - float elapsed; - void Start(); -private: - void draw(); - void update(float); - /* WINDOW */ - sf::RenderWindow window; - const int m_SCREEN_WIDTH = 1024; - const int m_SCREEN_HEIGHT = 768; - - Player player; -}; - diff --git a/LICENSE.md b/LICENSE.md index 403223e..1360178 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,8 +1,11 @@ -**The MIT License (MIT)** -Copyright (c) 2016 PiGames +###The MIT License (MIT) +Copyright (c) 2016 *PiGames* + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Player/Player.cpp b/Player/Player.cpp deleted file mode 100644 index 3e9b4c0..0000000 --- a/Player/Player.cpp +++ /dev/null @@ -1,39 +0,0 @@ -#include "Player.h" - - -Player::Player() -{ -} - -Player::~Player() -{ -} - -void Player::Move(int x, int y) -{ - m_sprite.move(x, y); -} -void Player::SetPosition(int x, int y) -{ - m_sprite.setPosition(x, y); -} -void Player::SetTexture() -{ - m_texture.loadFromFile("data/player.png"); - m_sprite.setTexture(m_texture); -} - -void Player::Draw(sf::RenderWindow &window) -{ - window.draw(m_sprite); -} - -float Player::getPosX() -{ - return m_sprite.getPosition().x; -} - -float Player::getPosY() -{ - return m_sprite.getPosition().y; -} diff --git a/Player/Player.h b/Player/Player.h deleted file mode 100644 index 5e19952..0000000 --- a/Player/Player.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once -#include -class Player -{ -public: - Player(); - ~Player(); - - void Move(int, int); - void SetPosition(int, int); - void SetTexture(); - void Draw(sf::RenderWindow &); - - float getPosX(); - float getPosY(); - -protected: - sf::Texture m_texture; - sf::Sprite m_sprite; -}; - diff --git a/README.md b/README.md index 4671460..49771c0 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # Bomberman ------- + Bomberman remake (for now only core) written in SFML by **PiGames** ## How to play ------- + ### Basics Rules are similar to standard rules: https://en.wikipedia.org/wiki/Bomberman ### Controlls @@ -15,7 +15,7 @@ Use your *movement keys* to move and *action key* to place a bomb -Player 2 is not supported yet- ## Requirements ------- + * C++ compiler (i.e. GCC) * [SFML 2.3.2](http://www.sfml-dev.org/download.php) (or another latest stable version) @@ -24,9 +24,5 @@ Use your *movement keys* to move and *action key* to place a bomb TODO ## License ------- -Project is under [MIT](LICENSE.md) license. -## Authors ------- -TODO +Project is under [MIT](LICENSE.md) license. diff --git a/data/Thumbs.db b/data/Thumbs.db deleted file mode 100644 index 0a14d0a..0000000 Binary files a/data/Thumbs.db and /dev/null differ diff --git a/data/bomb.png b/data/bomb.png deleted file mode 100644 index 03855c9..0000000 Binary files a/data/bomb.png and /dev/null differ diff --git a/data/icon.png b/data/icon.png deleted file mode 100644 index 16c9cba..0000000 Binary files a/data/icon.png and /dev/null differ diff --git a/data/player.png b/data/player.png deleted file mode 100644 index e9a1140..0000000 Binary files a/data/player.png and /dev/null differ diff --git a/main.cpp b/main.cpp deleted file mode 100644 index fdbfb79..0000000 --- a/main.cpp +++ /dev/null @@ -1,9 +0,0 @@ - #include "Game\Game.h" - -int main() -{ - Game game; - game.Start(); - - return 0; -} \ No newline at end of file