Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <SFML/Graphics.hpp>
- #include <iostream>
- #include <iomanip>
- #include <fstream>
- #include <vector>
- #include <math.h>
- #include <utility>
- #include "terrain.h"
- #include "player.h"
- #include "digidraw.h"
- #include "drawing.h"
- #include "map.h"
- #include "npc.h"
- std::pair<bool, Terrain> isColliding(Player, std::vector<Terrain>);
- std::pair<bool, Terrain> isColliding(Drawing, std::vector<Terrain>);
- std::pair<bool, Drawing> isColliding(Player, std::map<ObjectName, Drawing>);
- std::pair<bool, Drawing> isColliding(Drawing, std::map<ObjectName, Drawing>);
- std::pair<bool, Terrain> isColliding(sf::Vertex, std::vector<Terrain>);
- bool pointCollide(sf::Vertex, Terrain);
- void gravitate(Map, Player);
- void movement(sf::Vector2f, Player, Map, std::map<ObjectName, Drawing>);
- int main()
- {
- std::fstream fs;
- fs.open("/home/sir-lulzalot/Desktop/results.txt", std::fstream::out);
- sf::Clock theClock;
- sf::Time theTime;
- int32_t firstTap = 0, secondTap = 0;
- bool doubleSpeed = false;
- bool flight = false;
- bool doubleFall = false;
- bool hadJumped = false;
- bool canJump = true;
- bool jumping = false;
- sf::Vector2f jumpStart(0.0f,-3.0f);
- std::setw(2);
- std::setprecision(5);
- sf::RenderWindow window(sf::VideoMode(1000, 500), "SFML works!");
- Map thisMap;
- sf::Vector2f vect(35.0f, 50.0f);
- sf::Vector2f vectL(1000.0f,2.0f);
- sf::Vector2f vectL2(1000.0f, 30.0f);
- Terrain land(250, 400, vectL2);
- Terrain ceiling(250, 310, vectL2);
- Terrain test(200, 400, vect);
- Drawing wall;
- std::vector<Terrain> theMap;
- std::map<ObjectName, Drawing> theDrawings;
- Player character(300, 50, vect);
- std::pair<bool, Terrain> collisionResult;
- std::pair<bool, Drawing> collisionResultDrawn;
- std::pair<bool, Terrain> drawingCollision;
- std::pair<bool, Drawing> drawingToDrawingCollision;
- sf::Vertex thePoint;
- sf::Vertex pIQ, pIQ2;
- DigiDraw theDrawing[3];
- int drawIterator = 0;
- theMap.push_back(land);
- theMap.push_back(test);
- theMap.push_back(ceiling);
- thisMap.addTerrain(land);
- thisMap.addTerrain(test);
- thisMap.addTerrain(ceiling);
- while (window.isOpen())
- {
- sf::Event event;
- while (window.pollEvent(event))
- {
- switch (event.type){
- case sf::Event::Closed:
- window.close();
- break;
- case sf::Event::KeyReleased:
- if(event.key.code == sf::Keyboard::Return){
- fs << "Char Position:" << character.getObject().getPosition().x << " " << character.getObject().getPosition().y << "\n";
- fs << "Wall Position: " << wall.getObject().getPosition().x << " " << wall.getObject().getPosition().y << "\n";
- }
- if(event.key.code == sf::Keyboard::Up)
- flight = false;
- if(event.key.code == sf::Keyboard::Space){
- jumpStart.y = -3.0f;
- flight = false;
- hadJumped = true;
- }
- if(event.key.code == sf::Keyboard::Left || event.key.code == sf::Keyboard::Right){
- doubleSpeed = false;
- theTime = theClock.getElapsedTime();
- firstTap = theTime.asMilliseconds();
- }
- if(event.key.code == sf::Keyboard::LShift){
- if(theDrawing[0].analyzeArray() == ObjectName::Wall){
- if(theDrawings.find(ObjectName::Wall) != theDrawings.end())
- theDrawings.erase(theDrawings.find(ObjectName::Wall));
- if(theDrawing[0].getAnalysis().getVertexCount() >= 2){
- pIQ = theDrawing[0].getAnalysis()[0];
- drawingCollision = isColliding(pIQ, theMap);
- if(drawingCollision.first){
- std::cout << "I resize the bottom!" << std::endl;
- pIQ = theDrawing[0].resetPoint(pIQ.position.x, (drawingCollision.second.getTop()-0.1f), 0);
- }
- pIQ2 = theDrawing[0].getAnalysis()[(theDrawing[0].getAnalysis().getVertexCount()-1)];
- drawingCollision = isColliding(pIQ2, theMap);
- if(drawingCollision.first){
- std::cout << "I resize the top!" << std::endl;
- pIQ2 = theDrawing[0].resetPoint(pIQ2.position.x, (drawingCollision.second.getBottom()+0.1f) , (theDrawing[0].getAnalysis().getVertexCount()-1));
- }
- wall.theObject.setPosition((pIQ2.position.x-20), pIQ2.position.y);
- wall.theObject.setSize(sf::Vector2f(40, (pIQ.position.y - pIQ2.position.y)));
- wall.resizeTerrain();
- wall.setName(ObjectName::Wall);
- theDrawings[ObjectName::Wall] = wall;
- theDrawings[ObjectName::Wall].gravityShift(0.1f);
- }
- }
- else if(theDrawing[0].analyzeArray() == ObjectName::Fan){
- std::cout << "Somehow you were going to summon a Fan." << std::endl;
- }
- theDrawing[0].emptyArray();
- theDrawing[1].emptyArray();
- theDrawing[2].emptyArray();
- drawIterator = 0;
- }
- break;
- case sf::Event::MouseButtonReleased:
- if(event.mouseButton.button == sf::Mouse::Left){
- drawIterator++;
- }
- break;
- default:
- break;
- }
- }
- thePoint.position.x = (float)sf::Mouse::getPosition(window).x;
- thePoint.position.y = (float)sf::Mouse::getPosition(window).y;
- if(sf::Keyboard::isKeyPressed(sf::Keyboard::LShift)){
- if(sf::Mouse::isButtonPressed(sf::Mouse::Left) && drawIterator <= 2){
- theDrawing[drawIterator].fillAnalysis(thePoint);
- theDrawing[drawIterator].fillArray(thePoint);
- }
- }
- else{
- if(!flight){
- if(doubleFall){
- if(character.getGravityY() <= 6.0f)
- character.gravityShift(character.getGravityY() + 0.2f);
- }
- else
- if(character.getGravityY() <= 3.0f)
- character.gravityShift(character.getGravityY() + 0.1f);
- character.theObject.move(character.getGravity());
- character.update();
- collisionResult = isColliding(character, theMap);
- if(!theDrawings.empty())
- collisionResultDrawn = isColliding(character, theDrawings);
- if(collisionResult.first)
- hadJumped = false;
- else if(!theDrawings.empty())
- if(collisionResultDrawn.first)
- hadJumped = false;
- if(collisionResult.first && !doubleFall){
- character.theObject.setPosition(character.theObject.getPosition().x,
- (collisionResult.second.getObject().getPosition().y-0.1f)-character.theObject.getSize().y);
- character.gravityShift(0.1f);
- character.update();
- if(!sf::Keyboard::isKeyPressed(sf::Keyboard::Space))
- canJump = true;
- }
- else if(collisionResult.first && doubleFall){
- character.theObject.setPosition(character.theObject.getPosition().x,
- (collisionResult.second.getObject().getPosition().y-0.1f)-character.theObject.getSize().y);
- character.gravityShift(0.1f);
- doubleFall = false;
- character.update();
- if(!sf::Keyboard::isKeyPressed(sf::Keyboard::Space))
- canJump = true;
- }
- else if(!theDrawings.empty()){
- if(collisionResultDrawn.first && !doubleFall){
- character.theObject.setPosition(character.theObject.getPosition().x,
- (collisionResultDrawn.second.getObject().getPosition().y-0.1f)-character.theObject.getSize().y);
- character.gravityShift(0.1f);
- character.update();
- if(!sf::Keyboard::isKeyPressed(sf::Keyboard::Space))
- canJump = true;
- }
- if(collisionResultDrawn.first && doubleFall){
- character.theObject.setPosition(character.theObject.getPosition().x,
- (collisionResultDrawn.second.getObject().getPosition().y-0.1f)-character.theObject.getSize().y);
- character.gravityShift(0.1f);
- doubleFall = false;
- character.update();
- if(!sf::Keyboard::isKeyPressed(sf::Keyboard::Space))
- canJump = true;
- }
- }
- else
- canJump = false;
- }
- if(sf::Keyboard::isKeyPressed(sf::Keyboard::Left)){
- theTime = theClock.getElapsedTime();
- secondTap = theTime.asMilliseconds();
- if(secondTap - firstTap <= 300)
- doubleSpeed = true;
- if(doubleSpeed)
- character.theObject.move(-2.00f, 0);
- else
- character.theObject.move(-1.00f,0);
- character.update();
- collisionResult = isColliding(character, theMap);
- if(!theDrawings.empty())
- collisionResultDrawn = isColliding(character, theDrawings);
- if(collisionResult.first){
- character.theObject.setPosition((collisionResult.second.getObject().getPosition().x+0.1f)+collisionResult.second.getObject().getSize().x,
- character.getObject().getPosition().y);
- character.update();
- }
- else if(!theDrawings.empty())
- if(collisionResultDrawn.first){
- if(doubleSpeed && canJump && !hadJumped){
- theDrawings[collisionResultDrawn.second.getName()].theObject.move(-2.00f, 0);
- theDrawings[collisionResultDrawn.second.getName()].resizeTerrain();
- }
- else{
- character.theObject.setPosition((collisionResultDrawn.second.getObject().getPosition().x+0.1f)+collisionResultDrawn.second.getObject().getSize().x,
- character.getObject().getPosition().y);
- character.update();
- }
- }
- }
- if(sf::Keyboard::isKeyPressed(sf::Keyboard::Right)){
- theTime = theClock.getElapsedTime();
- secondTap = theTime.asMilliseconds();
- if(secondTap - firstTap <= 300)
- doubleSpeed = true;
- if(doubleSpeed)
- character.theObject.move(2.00f, 0);
- else
- character.theObject.move(1.00f, 0);
- character.update();
- collisionResult = isColliding(character, theMap);
- if(!theDrawings.empty())
- collisionResultDrawn = isColliding(character, theDrawings);
- if(collisionResult.first){
- character.theObject.setPosition((collisionResult.second.getObject().getPosition().x-0.1f)-character.theObject.getSize().x,
- character.getObject().getPosition().y);
- character.update();
- }
- else if(!theDrawings.empty())
- if(collisionResultDrawn.first){
- if(doubleSpeed && canJump && !hadJumped){
- theDrawings[collisionResultDrawn.second.getName()].theObject.move(2.00f, 0);
- theDrawings[collisionResultDrawn.second.getName()].resizeTerrain();
- }
- else{
- character.theObject.setPosition((collisionResultDrawn.second.getObject().getPosition().x-0.1f)-character.theObject.getSize().x,
- character.getObject().getPosition().y);
- character.update();
- }
- }
- }
- if(sf::Keyboard::isKeyPressed(sf::Keyboard::Up)){
- flight = true;
- movement(sf::Vector2f(0, -1.00f), character, thisMap, theDrawings);
- /*
- character.theObject.move(0,-1.00f);
- character.update();
- collisionResult = isColliding(character, theMap);
- if(!theDrawings.empty())
- collisionResultDrawn = isColliding(character, theDrawings);
- if(collisionResult.first){
- character.theObject.setPosition(character.theObject.getPosition().x,
- (collisionResult.second.getObject().getPosition().y+0.1f)+collisionResult.second.getObject().getSize().y);
- character.update();
- }
- else if(!theDrawings.empty())
- if(collisionResultDrawn.first){
- character.theObject.setPosition(character.theObject.getPosition().x,
- (collisionResultDrawn.second.getObject().getPosition().y+0.1f)+collisionResultDrawn.second.getObject().getSize().y);
- character.update();
- }
- */
- }
- if(sf::Keyboard::isKeyPressed(sf::Keyboard::Down)){
- if(!isColliding(character, theMap).first)
- doubleFall = true;
- }
- if((sf::Keyboard::isKeyPressed(sf::Keyboard::Space) && canJump) || (sf::Keyboard::isKeyPressed(sf::Keyboard::Space) && jumping)){
- canJump = false;
- jumping = true;
- if(jumpStart.y < 0 && !hadJumped)
- flight = true;
- else{
- flight = false;
- jumping = false;
- }
- if(flight && !hadJumped){
- character.theObject.move(jumpStart);
- character.update();
- collisionResult = isColliding(character, theMap);
- if(!theDrawings.empty())
- collisionResultDrawn = isColliding(character, theDrawings);
- if(collisionResult.first){
- if(jumpStart.y < 0){
- character.theObject.setPosition(character.theObject.getPosition().x,
- (collisionResult.second.getObject().getPosition().y+1)+collisionResult.second.getObject().getSize().y);
- jumpStart.y = 0.0f;
- flight = false;
- jumping = false;
- }
- else
- character.getObject().move(jumpStart);
- character.update();
- }
- else if(!theDrawings.empty())
- if(collisionResultDrawn.first){
- if(jumpStart.y < 0){
- character.theObject.setPosition(character.theObject.getPosition().x,
- (collisionResultDrawn.second.getObject().getPosition().y+1)+collisionResultDrawn.second.getObject().getSize().y);
- jumpStart.y = 0.0f;
- flight = false;
- }
- else
- character.getObject().move(jumpStart);
- character.update();
- }
- if(jumpStart.y < 0.0f)
- jumpStart.y += 0.1f;
- }
- }
- if(theDrawings.find(ObjectName::Wall) != theDrawings.end()){
- drawingCollision = isColliding(theDrawings[ObjectName::Wall], theMap);
- theDrawings[ObjectName::Wall].theObject.move(theDrawings[ObjectName::Wall].getGravity());
- if(drawingCollision.first){
- theDrawings[ObjectName::Wall].theObject.setPosition(theDrawings[ObjectName::Wall].theObject.getPosition().x,
- (drawingCollision.second.getObject().getPosition().y-0.1f)-theDrawings[ObjectName::Wall].theObject.getSize().y);
- theDrawings[ObjectName::Wall].resizeTerrain();
- theDrawings[ObjectName::Wall].gravityShift(0.1f);
- }
- else{
- theDrawings[ObjectName::Wall].resizeTerrain();
- theDrawings[ObjectName::Wall].gravityShift(theDrawings[ObjectName::Wall].getGravityY() + 0.1f);
- }
- }
- }
- if(sf::Keyboard::isKeyPressed(sf::Keyboard::Escape))
- window.close();
- if(character.collision(test))
- std::cout << "Collision!" << std::endl;
- if(character.collision(land))
- std::cout << "Collision!" << std::endl;
- character.update();
- window.clear();
- if(sf::Keyboard::LShift){
- window.draw(character.getObject());
- window.draw(land.getObject());
- window.draw(test.getObject());
- window.draw(ceiling.getObject());
- if(!theDrawings.empty())
- window.draw(theDrawings[ObjectName::Wall].getObject());
- }
- window.draw(theDrawing[0].getArray());
- window.draw(theDrawing[0].getAnalysis());
- window.draw(theDrawing[1].getArray());
- window.draw(theDrawing[1].getAnalysis());
- window.draw(theDrawing[2].getArray());
- window.draw(theDrawing[2].getAnalysis());
- window.display();
- }
- fs.close();
- return 0;
- }
- std::pair<bool, Terrain> isColliding(Player thePlayer, std::vector<Terrain> theMap){
- bool wouldCollide = false;
- Terrain theTerrain;
- for(std::vector<Terrain>::iterator i = theMap.begin(); i != theMap.end(); i++)
- if(thePlayer.collision(*i)){
- wouldCollide = true;
- theTerrain = *i;
- }
- return std::make_pair(wouldCollide, theTerrain);
- }
- std::pair<bool, Terrain> isColliding(Drawing theDrawing, std::vector<Terrain> theMap){
- bool wouldCollide = false;
- Terrain theTerrain;
- for(std::vector<Terrain>::iterator i = theMap.begin(); i != theMap.end(); i++)
- if(theDrawing.collision(*i)){
- wouldCollide = true;
- theTerrain = *i;
- }
- return std::make_pair(wouldCollide, theTerrain);
- }
- std::pair<bool, Drawing> isColliding(Player thePlayer, std::map<ObjectName, Drawing> theDrawings){
- bool wouldCollide = false;
- Drawing theObject;
- if(theDrawings.find(ObjectName::Wall) != theDrawings.end())
- if(thePlayer.collision(theDrawings[ObjectName::Wall])){
- wouldCollide = true;
- theObject = theDrawings[ObjectName::Wall];
- }
- return std::make_pair(wouldCollide, theObject);
- }
- std::pair<bool, Terrain> isColliding(sf::Vertex thePoint, std::vector<Terrain> theMap){
- bool wouldCollide = false;
- Terrain theObject;
- for(std::vector<Terrain>::iterator i = theMap.begin(); i != theMap.end(); i++)
- if(pointCollide(thePoint, *i)){
- wouldCollide = true;
- theObject = *i;
- }
- return std::make_pair(wouldCollide, theObject);
- }
- bool pointCollide(sf::Vertex thePoint, Terrain theTerrain){
- if((thePoint.position.x + 20) < theTerrain.getLeft() || (thePoint.position.x - 20) > theTerrain.getRight() ||
- thePoint.position.y > theTerrain.getBottom() || thePoint.position.y < theTerrain.getTop())
- {
- return false;
- }
- return true;
- }
- void gravitate(Map &theMap, Player &thePlayer, std::map<ObjectName, Drawing> &theDrawings){
- std::vector<Terrain> thisTerrain = theMap.getTerrain();
- std::vector<NPC> thisPopulace = theMap.getNPCs();
- for(std::vector<Terrain>::iterator i = thisTerrain.begin(); i != thisTerrain.end(); i++){
- i->gravitate();
- }
- for(std::vector<NPC>::iterator i = thisPopulace.begin(); i != thisPopulace.end(); i++){
- i->gravitate();
- }
- theMap.setTerrain(thisTerrain);
- theMap.setNPCs(thisPopulace);
- thePlayer.gravitate();
- if(theDrawings.find(ObjectName::Wall) != theDrawings.end())
- theDrawings[ObjectName::Wall].gravitate();
- }
- void movement(sf::Vector2f theVector, Player &thePlayer, Map &theMap, std::map<ObjectName, Drawing> theDrawings){
- std::vector<Terrain> theTerrain = theMap.getTerrain();
- std::vector<NPC> thePopulace = theMap.getNPCs();
- //Moving down.
- if(theVector.x == 0 && theVector.y > 0){
- thePlayer.movement(theVector);
- thePlayer.update();
- //All terrain checks.
- for(std::vector<Terrain>::iterator i = theTerrain.begin(); i != theTerrain.end(); i++){
- if(thePlayer.collision(Solid(i->getTop(), i->getBottom(), i->getLeft(), i->getRight())) && i->getSolidarity()){
- thePlayer.setPosition(sf::Vector2f(thePlayer.getObject().getPosition().x, (i->getTop()-0.1f)));
- thePlayer.update();
- }
- }
- //All NPC checks.
- for(std::vector<NPC>::iterator i = thePopulace.begin(); i != thePopulace.end(); i++){
- if(thePlayer.collision(Solid(i->getTop(), i->getBottom(), i->getLeft(), i->getRight())) && i->getSolidarity()){
- thePlayer.setPosition(sf::Vector2f(thePlayer.getObject().getPosition().x, (i->getTop()-0.1f)));
- thePlayer.update();
- }
- }
- //Individual drawing checks.
- if(theDrawings.find(ObjectName::Wall) != theDrawings.end()){
- if(thePlayer.collision(Solid(theDrawings[ObjectName::Wall].getTop(), theDrawings[ObjectName::Wall].getBottom(),
- theDrawings[ObjectName::Wall].getLeft(), theDrawings[ObjectName::Wall].getRight())) &&
- theDrawings[ObjectName::Wall].getSolidarity()){
- thePlayer.setPosition(sf::Vector2f(thePlayer.getObject().getPosition().x, (theDrawings[ObjectName::Wall].getTop()-0.1f)));
- thePlayer.update();
- }
- }
- }
- //Moving up.
- else if(theVector.x == 0 && theVector.y < 0){
- thePlayer.movement(theVector);
- thePlayer.update();
- //All terrain checks.
- for(std::vector<Terrain>::iterator i = theTerrain.begin(); i != theTerrain.end(); i++){
- if(thePlayer.collision(Solid(i->getTop(), i->getBottom(), i->getLeft(), i->getRight())) && i->getSolidarity()){
- thePlayer.setPosition(sf::Vector2f(thePlayer.getObject().getPosition().x, (i->getBottom()+0.1f)));
- thePlayer.update();
- }
- }
- //All NPC checks.
- for(std::vector<NPC>::iterator i = thePopulace.begin(); i != thePopulace.end(); i++){
- if(thePlayer.collision(Solid(i->getTop(), i->getBottom(), i->getLeft(), i->getRight())) && i->getSolidarity()){
- thePlayer.setPosition(sf::Vector2f(thePlayer.getObject().getPosition().x, (i->getBottom()+0.1f)));
- thePlayer.update();
- }
- }
- //Individual drawing checks.
- if(theDrawings.find(ObjectName::Wall) != theDrawings.end()){
- if(thePlayer.collision(Solid(theDrawings[ObjectName::Wall].getTop(), theDrawings[ObjectName::Wall].getBottom(),
- theDrawings[ObjectName::Wall].getLeft(), theDrawings[ObjectName::Wall].getRight())) &&
- theDrawings[ObjectName::Wall].getSolidarity()){
- thePlayer.setPosition(sf::Vector2f(thePlayer.getObject().getPosition().x, (theDrawings[ObjectName::Wall].getBottom()+0.1f)));
- thePlayer.update();
- }
- }
- }
- //Moving right.
- else if(theVector.x > 0 && theVector.y == 0){
- thePlayer.movement(theVector);
- thePlayer.update();
- //All terrain checks.
- for(std::vector<Terrain>::iterator i = theTerrain.begin(); i != theTerrain.end(); i++){
- if(thePlayer.collision(Solid(i->getTop(), i->getBottom(), i->getLeft(), i->getRight())) && i->getSolidarity()){
- thePlayer.setPosition(sf::Vector2f((i->getLeft()-0.1f), thePlayer.getObject().getPosition().y));
- thePlayer.update();
- }
- }
- //All NPC checks.
- for(std::vector<NPC>::iterator i = thePopulace.begin(); i != thePopulace.end(); i++){
- if(thePlayer.collision(Solid(i->getTop(), i->getBottom(), i->getLeft(), i->getRight())) && i->getSolidarity()){
- thePlayer.setPosition(sf::Vector2f((i->getLeft()-0.1f), thePlayer.getObject().getPosition().y));
- thePlayer.update();
- }
- }
- //Individual drawing checks.
- if(theDrawings.find(ObjectName::Wall) != theDrawings.end()){
- if(thePlayer.collision(Solid(theDrawings[ObjectName::Wall].getTop(), theDrawings[ObjectName::Wall].getBottom(),
- theDrawings[ObjectName::Wall].getLeft(), theDrawings[ObjectName::Wall].getRight())) &&
- theDrawings[ObjectName::Wall].getSolidarity()){
- thePlayer.setPosition(sf::Vector2f((theDrawings[ObjectName::Wall].getLeft()-0.1f), thePlayer.getObject().getPosition().y));
- thePlayer.update();
- }
- }
- }
- //Moving left.
- else if(theVector.x < 0 && theVector.y == 0){
- thePlayer.movement(theVector);
- thePlayer.update();
- //All terrain checks.
- for(std::vector<Terrain>::iterator i = theTerrain.begin(); i != theTerrain.end(); i++){
- if(thePlayer.collision(Solid(i->getTop(), i->getBottom(), i->getLeft(), i->getRight())) && i->getSolidarity()){
- thePlayer.setPosition(sf::Vector2f((i->getRight()+0.1f), thePlayer.getObject().getPosition().y));
- thePlayer.update();
- }
- }
- //All NPC checks.
- for(std::vector<NPC>::iterator i = thePopulace.begin(); i != thePopulace.end(); i++){
- if(thePlayer.collision(Solid(i->getTop(), i->getBottom(), i->getLeft(), i->getRight())) && i->getSolidarity()){
- thePlayer.setPosition(sf::Vector2f((i->getRight()+0.1f), thePlayer.getObject().getPosition().y));
- thePlayer.update();
- }
- }
- //Individual drawing checks.
- if(theDrawings.find(ObjectName::Wall) != theDrawings.end()){
- if(thePlayer.collision(Solid(theDrawings[ObjectName::Wall].getTop(), theDrawings[ObjectName::Wall].getBottom(),
- theDrawings[ObjectName::Wall].getLeft(), theDrawings[ObjectName::Wall].getRight())) &&
- theDrawings[ObjectName::Wall].getSolidarity()){
- thePlayer.setPosition(sf::Vector2f((theDrawings[ObjectName::Wall].getRight()+0.1f), thePlayer.getObject().getPosition().y));
- thePlayer.update();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement