From 914ccce4433bda5acd8d8968d133c4ef2bed1a6c Mon Sep 17 00:00:00 2001 From: mbjornstk Date: Mon, 12 Apr 2010 02:18:08 +0000 Subject: [PATCH] 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 --- src/items/attachment.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/items/attachment.cpp b/src/items/attachment.cpp index 685854025..c6d3faa88 100644 --- a/src/items/attachment.cpp +++ b/src/items/attachment.cpp @@ -56,11 +56,6 @@ void Attachment::set(attachmentType type, float time, Kart *current_kart) { clear(); 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_time_left = time; m_previous_owner = current_kart; @@ -192,7 +187,11 @@ void Attachment::update(float dt) case ATTACH_MAX: break; case ATTACH_BOMB: - if(m_time_left<=0.0) + 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) { projectile_manager->newExplosion(m_kart->getXYZ()); m_kart->handleExplosion(m_kart->getXYZ(),