Scratch this, I can't find the delete button for the forums but I figured it out >.> I forgot to set the sprite size, and that caused them to not show up.
--------------------------------
I was just curious if anyone else has run into a problem with particles not showing up in Android. I'm using the same class for explosions that I used on a Windows AppGameKit program, but they're not showing up. I've played with print statements to make sure the sections of code are being hit, and the game picks up a little lag when enough are created (I haven't set a timer so I was generating 60 a second when a sprite was in a specific location).
Here's my CPP file:
#include "Explosion.h"
#include "agk.h"
Explosion::Explosion(int type, float x, float y)
{
id = agk::CreateParticles(x, y);
agk::SetParticlesDepth(id, 0);
timeToLive = 180;
//Small Asteroid v Bullet
if(type == 3)
{
agk::SetParticlesFrequency(id, 20.0f);
agk::SetParticlesSize(id, 2.0f);
agk::SetParticlesLife(id, 3.0f);
}
//Medium Asteroid v Bullet
if(type == 2)
{
agk::SetParticlesFrequency(id, 40.0f);
agk::SetParticlesSize(id, 4.0f);
agk::SetParticlesLife(id, 3.0f);
}
//Large Asteroid v Bullet
if(type == 1)
{
agk::SetParticlesFrequency(id, 60.0f);
agk::SetParticlesSize(id, 6.0f);
agk::SetParticlesLife(id, 3.0f);
}
//Asteroid v Ship
else if(type == 0)
{
//agk::SetParticlesFrequency(id, 100);
//agk::SetParticlesLife(id, 5.0f);
}
agk::SetParticlesColorInterpolation(id, 1);
}
Explosion::~Explosion(void)
{
}
and my header
class Explosion
{
public:
Explosion(int type, float x, float y);
~Explosion(void);
unsigned int id;
unsigned int timeToLive;
};
The section where the explosions are created in my template is here:
for(int i = 0; i < (int) asteroidList.size(); i++)
{
if(agk::GetSpriteCollision(ship, asteroidList[i].id))
{
agk::PlaySound(sound_shipExplosion);
Explosion *tmpExplosion = new Explosion(0, agk::GetSpriteXByOffset(ship), agk::GetSpriteYByOffset(ship));
explosionList.push_back(*tmpExplosion);
gameOver(0);
continue;
}
}