Merge pull request #3 from Foxar/develop
Foxar develop->Foxar master-> PR #58 h4570/tyra
This commit is contained in:
@@ -189,7 +189,8 @@ private:
|
|||||||
TextureType _type;
|
TextureType _type;
|
||||||
std::vector<TextureLink> texLinks;
|
std::vector<TextureLink> texLinks;
|
||||||
u32 id;
|
u32 id;
|
||||||
u8 width, height, _isNameSet, _isSizeSet;
|
u16 width, height;
|
||||||
|
u8 _isNameSet, _isSizeSet;
|
||||||
unsigned char *data;
|
unsigned char *data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,11 @@ Dolphin::Dolphin(Engine *t_engine) : engine(t_engine), camera(&engine->screen)
|
|||||||
mines = new Mine[MINES_COUNT];
|
mines = new Mine[MINES_COUNT];
|
||||||
}
|
}
|
||||||
|
|
||||||
Dolphin::~Dolphin() {}
|
Dolphin::~Dolphin()
|
||||||
|
{
|
||||||
|
delete[] oysters;
|
||||||
|
delete[] mines;
|
||||||
|
}
|
||||||
|
|
||||||
void Dolphin::onInit()
|
void Dolphin::onInit()
|
||||||
{
|
{
|
||||||
@@ -181,8 +185,8 @@ void Dolphin::onUpdate()
|
|||||||
{
|
{
|
||||||
oysters[i].update();
|
oysters[i].update();
|
||||||
Vector3 vecDist = oysters[i].mesh.position - player.mesh.position;
|
Vector3 vecDist = oysters[i].mesh.position - player.mesh.position;
|
||||||
float dist = Math::sqrt(vecDist.x + vecDist.y + vecDist.z);
|
float dist = vecDist.length();
|
||||||
if (dist < 2.5F && player.isJumping() && oysters[i].isActive())
|
if (dist < 20.F && player.isJumping() && oysters[i].isActive())
|
||||||
{
|
{
|
||||||
printf("Pickup %d Dist %d\n", i, dist);
|
printf("Pickup %d Dist %d\n", i, dist);
|
||||||
oysters[i].disappear();
|
oysters[i].disappear();
|
||||||
@@ -196,9 +200,8 @@ void Dolphin::onUpdate()
|
|||||||
{
|
{
|
||||||
mines[i].update();
|
mines[i].update();
|
||||||
Vector3 vecDist = mines[i].mesh.position - player.mesh.position;
|
Vector3 vecDist = mines[i].mesh.position - player.mesh.position;
|
||||||
float dist = Math::sqrt((vecDist.x * vecDist.x) +
|
float dist = vecDist.length();
|
||||||
(vecDist.y * vecDist.y) +
|
|
||||||
(vecDist.z * vecDist.z));
|
|
||||||
if (dist < 20.F && !mines[i].getExplosionTicks())
|
if (dist < 20.F && !mines[i].getExplosionTicks())
|
||||||
{
|
{
|
||||||
printf("Vecdist %f,%f,%f\n", vecDist.x, vecDist.y, vecDist.z);
|
printf("Vecdist %f,%f,%f\n", vecDist.x, vecDist.y, vecDist.z);
|
||||||
|
|||||||
Reference in New Issue
Block a user