increased floors count, added gaps

This commit is contained in:
Sandro Sobczyński
2020-11-04 22:47:03 +01:00
parent bfd75003a4
commit 1868b714bc
5 changed files with 10 additions and 5 deletions
+1 -1
View File
@@ -14,7 +14,7 @@
// Constructors/Destructors // Constructors/Destructors
// ---- // ----
const u8 FLOORS_COUNT = 64; // Temp change it also in floor_manager.hpp const u8 FLOORS_COUNT = 144; // Temp change it also in floor_manager.hpp
Floors::Floors(Engine *t_engine) Floors::Floors(Engine *t_engine)
: engine(t_engine), floorManager(FLOORS_COUNT), camera(&t_engine->screen) : engine(t_engine), floorManager(FLOORS_COUNT), camera(&t_engine->screen)
@@ -77,7 +77,7 @@ void FloorManager::calcSpiral(int X, int Y)
void FloorManager::initFloors() void FloorManager::initFloors()
{ {
PRINT_LOG("Initializing floors"); PRINT_LOG("Initializing floors");
floors[0].mesh.loadObj("floor/", "floor", 2.0F, false); floors[0].mesh.loadObj("floor/", "floor", 3.0F, false);
floors[0].mesh.shouldBeFrustumCulled = true; floors[0].mesh.shouldBeFrustumCulled = true;
floors[0].mesh.shouldBeLighted = true; floors[0].mesh.shouldBeLighted = true;
for (u8 i = 1; i < floorAmount; i++) for (u8 i = 1; i < floorAmount; i++)
@@ -26,7 +26,7 @@ class FloorManager
public: public:
FloorManager(int t_floorAmount); FloorManager(int t_floorAmount);
~FloorManager(); ~FloorManager();
Floor floors[64]; // Temp change it also in floors.cpp Floor floors[144]; // Temp change it also in floors.cpp
u32 floorAmount; u32 floorAmount;
void update(Player &t_player); void update(Player &t_player);
void onAudioTick(); void onAudioTick();
+2 -2
View File
@@ -45,8 +45,8 @@ void Floor::init(const Mesh &mother, const Point &spiral, const u8 &initOffset)
this->mesh.shouldBeLighted = true; this->mesh.shouldBeLighted = true;
this->mesh.shouldBeFrustumCulled = true; this->mesh.shouldBeFrustumCulled = true;
this->animDirection = 0; this->animDirection = 0;
this->mesh.position.x = spiral.x * 40.0F; this->mesh.position.x = spiral.x * 80.0F;
this->mesh.position.z = spiral.y * 40.0F; this->mesh.position.z = spiral.y * 80.0F;
} }
/** Check and update animation direction and position /** Check and update animation direction and position
+5
View File
@@ -50,6 +50,11 @@ void Player::update(Pad &pad, Camera &camera, FloorManager &floorManager)
{ {
this->updatePosition(pad, camera, floorManager); this->updatePosition(pad, camera, floorManager);
this->updateGravity(pad, floorManager); this->updateGravity(pad, floorManager);
if (mesh.position.y < -60.0F)
{
mesh.position.y = 60.0F;
velocity = 0;
}
} }
/** Move player when pad move buttons are pressed and is not blocked by any floor side */ /** Move player when pad move buttons are pressed and is not blocked by any floor side */