Make bomb anim use frame steps (small jumps on purpose, tick tock ...).

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5178 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
mbjornstk 2010-04-12 02:18:08 +00:00
parent 5cc8b0c491
commit 914ccce443

View File

@ -56,11 +56,6 @@ void Attachment::set(attachmentType type, float time, Kart *current_kart)
{ {
clear(); clear();
m_node->setMesh(attachment_manager->getMesh(type)); m_node->setMesh(attachment_manager->getMesh(type));
if(type==ATTACH_BOMB)
{
int num_frames = m_node->getEndFrame() - m_node->getStartFrame()+1;
m_node->setAnimationSpeed(num_frames / time);
}
m_type = type; m_type = type;
m_time_left = time; m_time_left = time;
m_previous_owner = current_kart; m_previous_owner = current_kart;
@ -192,6 +187,10 @@ void Attachment::update(float dt)
case ATTACH_MAX: case ATTACH_MAX:
break; break;
case ATTACH_BOMB: case ATTACH_BOMB:
if(m_time_left <= (m_node->getEndFrame() - m_node->getStartFrame() - 1))
{
m_node->setCurrentFrame((m_node->getEndFrame() - m_node->getStartFrame() - 1) - (int) m_time_left);
}
if(m_time_left<=0.0) if(m_time_left<=0.0)
{ {
projectile_manager->newExplosion(m_kart->getXYZ()); projectile_manager->newExplosion(m_kart->getXYZ());