when collected all crystals it is possible to move to the next level, by stepping in the portal
This commit is contained in:
+34
@@ -0,0 +1,34 @@
|
||||
#include "Portal.h"
|
||||
#include "Model.h"
|
||||
#include <iostream>
|
||||
#include "Player.h"
|
||||
#include "WorldHandler.h"
|
||||
|
||||
Portal::Portal(const std::string &fileName,
|
||||
const Vec3f &position,
|
||||
Vec3f &rotation,
|
||||
const float &scale)
|
||||
{
|
||||
model = Model::load(fileName);
|
||||
this->position = position;
|
||||
this->rotation = rotation;
|
||||
this->scale = scale;
|
||||
this->canCollide = true;
|
||||
|
||||
mayEnter = false;
|
||||
maxCrystals = 0;
|
||||
}
|
||||
|
||||
|
||||
Portal::~Portal()
|
||||
{
|
||||
}
|
||||
|
||||
void Portal::collide()
|
||||
{
|
||||
if (maxCrystals == (Player::getInstance()->crystals) && !mayEnter)
|
||||
{
|
||||
canCollide = false;
|
||||
mayEnter = true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user