public void dispose() { if (hasParticles) { System.out.println("removed particles"); magicParticles.end(); a.particleSystem.remove(magicParticles); // (magicParticles); a.firePool.free(magicParticles); magicParticles = null; hasParticles = false; } }
public void onAttackStart() { switch (attacktype) { case Bash: break; case Shoot: canShoot = true; break; case Spell: if (parent.drainMana(spellcost)) { parent.w.addProjectile( new SpellProjectile( mi.transform.cpy(), parent.face.cpy().scl(-8), a.firePool.obtain())); magicParticles.end(); } break; case Stab: break; case Swing: break; default: break; } }