Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Board.h"
- Board::Board()
- {
- board.setSize(sf::Vector2f(300.0f, 400.0f));
- Pit.setSize(sf::Vector2f(20.0f, 20.0f));
- Pit.setPosition(sf::Vector2f(50.0f, 50.0f));
- }
- Board::~Board()
- {
- }
- void Board::setTableTexture()
- {
- //radi
- //load teksturu
- boardTexture.loadFromFile(PATH_IMAGES "background.png");
- board.setTexture(&boardTexture);
- //dobiti velicinu kockice
- pitMoveMent = boardTexture.getSize();
- moveXaxis = pitMoveMent.x / 10;
- moveYaXis = pitMoveMent.y / 20;
- }
- void Board::setTable()
- {
- PitTexture.loadFromFile(PATH_IMAGES "O.png");
- Pit.setTexture(&PitTexture);
- for (size_t i = 0; i < 20; i++) {
- for (size_t j = 0; j < 10; j++) {
- vectBoard[i][j].setTexture(&PitTexture);
- }
- }
- }
- void Board::draw(sf::RenderWindow & window)
- {
- //window.draw(board);
- for (size_t i = 0; i < 20; i++) {
- for (size_t j = 0; j < 10; j++) {
- vectBoard[i][j].draw();
- }
- }
- //window.draw(Pit);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement