static game #1
This commit is contained in:
@@ -36,10 +36,10 @@ Floor::~Floor() {}
|
||||
* @param spiral Spiral position
|
||||
* @param initOffset Number of floor (index)
|
||||
*/
|
||||
void Floor::init(Mesh *mother, Point &spiral, u8 &initOffset)
|
||||
void Floor::init(const Mesh &mother, const Point &spiral, const u8 &initOffset)
|
||||
{
|
||||
this->mesh.position.set(0.00F, -10.00F, 0.00F);
|
||||
this->mesh.loadFrom(*mother);
|
||||
this->mesh.loadFrom(mother);
|
||||
this->initOffset = initOffset;
|
||||
this->animTimer = rand() % FLOOR_ANIMATION_LENGTH;
|
||||
this->mesh.shouldBeLighted = true;
|
||||
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
Floor();
|
||||
~Floor();
|
||||
|
||||
void init(Mesh *mother, Point &spiral, u8 &initOffset);
|
||||
void init(const Mesh &mother, const Point &spiral, const u8 &initOffset);
|
||||
void animate(Player &player);
|
||||
};
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ void Player::updatePosition(Pad &pad, Camera &camera, FloorManager &floorManager
|
||||
this->isCollideFloor = 0;
|
||||
Vector3 min = Vector3();
|
||||
Vector3 max = Vector3();
|
||||
for (int i = 0; i < floorManager.floorAmount; i++)
|
||||
for (u32 i = 0; i < floorManager.floorAmount; i++)
|
||||
{
|
||||
getMinMax(&floorManager.floors[i].mesh, &min, &max);
|
||||
this->isCollideFloor = this->playerNextPosition.collidesSquare(min, max);
|
||||
@@ -151,7 +151,7 @@ void Player::updateGravity(Pad &pad, FloorManager &floorManager)
|
||||
this->velocity = this->lift;
|
||||
|
||||
this->isOnFloor = 0;
|
||||
for (int i = 0; i < floorManager.floorAmount; i++)
|
||||
for (u32 i = 0; i < floorManager.floorAmount; i++)
|
||||
{
|
||||
getMinMax(&floorManager.floors[i].mesh, &min, &max);
|
||||
this->isOnFloor = this->mesh.position.isOnSquare(min, max);
|
||||
|
||||
Reference in New Issue
Block a user