refactor #1
This commit is contained in:
@@ -21,9 +21,10 @@
|
||||
// Constructors/Destructors
|
||||
// ----
|
||||
|
||||
Player::Player(Audio *t_audio)
|
||||
Player::Player(Audio *t_audio, TextureRepository *t_texRepo)
|
||||
{
|
||||
PRINT_LOG("Creating player object");
|
||||
texRepo = t_texRepo;
|
||||
audio = t_audio;
|
||||
gravity = 0.1F;
|
||||
lift = -1.0F;
|
||||
@@ -45,6 +46,8 @@ Player::Player(Audio *t_audio)
|
||||
mesh.setAnimSpeed(0.17F);
|
||||
mesh.playAnimation(0, 0);
|
||||
|
||||
texRepo->addByMesh("meshes/player/", mesh, BMP);
|
||||
|
||||
walkAdpcm = audio->loadADPCM("sounds/walk.adpcm");
|
||||
jumpAdpcm = audio->loadADPCM("sounds/jump.adpcm");
|
||||
boomAdpcm = audio->loadADPCM("sounds/boom.adpcm");
|
||||
|
||||
@@ -33,7 +33,7 @@ public:
|
||||
float gravity, velocity, lift;
|
||||
Mesh mesh;
|
||||
s16 indexOfCurrentFloor;
|
||||
Player(Audio *t_audio);
|
||||
Player(Audio *t_audio, TextureRepository *t_texRepo);
|
||||
~Player();
|
||||
|
||||
void update(const Pad &t_pad, const Camera &t_camera, const FloorManager &t_floorManager, Enemy &enemy);
|
||||
@@ -43,6 +43,7 @@ public:
|
||||
inline const Vector3 &getPosition() const { return mesh.position; }
|
||||
|
||||
private:
|
||||
TextureRepository *texRepo;
|
||||
u32 jumpCounter, killedEnemies;
|
||||
Vector3 *getNextPosition(const Pad &t_pad, const Camera &t_camera);
|
||||
FloorsCheck *checkFloors(const FloorManager &t_floorManager, const Vector3 &t_nextPos);
|
||||
|
||||
Reference in New Issue
Block a user