Commit 5a64f75f authored by pa's avatar pa

eezhgfkdsjhfk

parent 51ddb118
......@@ -5,7 +5,7 @@
#include <iostream>
#include <sstream>
#define PORT 53001
#define PORT 53000
class Input{
......
......@@ -62,38 +62,29 @@ void World::update(sf::Time dt){
void World::checkCollision(){
std::set<SceneNode::Pair> stack;
mSceneGraph.checkSceneCollision(mSceneGraph, stack);
bool apri = false;
for(auto &pair : stack){
pair.first->onCollideWith(*pair.second);
pair.second->onCollideWith(*pair.first);
}
for(auto &pair : stack){
if(pair.first->identify() == Category::Player
if(!apri && pair.first->identify() == Category::Player
&& pair.second->identify() == Category::Door
&& static_cast<Door&>(*pair.second).lockLevel()
<= static_cast<Player&>(*pair.first).getKeys()){
mPlayer[0] = static_cast<Player*>(mRoom->detachPlayer(*mPlayer[0]));
std::cout << "t1\n";
mPlayer[1] = static_cast<Player*>(mRoom->detachPlayer(*mPlayer[1]));
std::cout << "t2\n";
Room* room = static_cast<Room*>(mSceneGraph.detachChild(*mRoom));
std::cout << "t3\n";
mCarte.checkOut(room);
std::cout << "t4\n";
mCarte.move(static_cast<Door&>(*pair.second).getDir());
std::cout << "t5\n";
mRoom->reset();
std::cout << "t6\n";
mRoom = mCarte.checkIn();
std::cout << "t7\n";
mRoom->spawnAt(static_cast<Door&>(*pair.second).getDir());
std::cout << "t8\n";
mRoom->attachPlayer(mPlayer[0]);
std::cout << "t9\n";
mRoom->attachPlayer(mPlayer[1]);
std::cout << "ta\n";
mSceneGraph.attachChild(mRoom);
std::cout << "tb\n";
apri = true;
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment