/** Called when the check line is triggered. This function  creates a cannon
 *  animation object and attaches it to the kart.
 *  \param kart_index The index of the kart that triggered the check line.
 */
void CheckGoal::trigger(unsigned int kart_index)
{
    SoccerWorld* world = dynamic_cast<SoccerWorld*>(World::getWorld());
    if(!world)
    {
        fprintf(stderr, "WARNING: no soccer world found, cannot count the points\n");
        return;
    }

    world->onCheckGoalTriggered(m_first_goal);
}   // CheckGoal
예제 #2
0
/** Called when the check line is triggered. This function  creates a cannon
 *  animation object and attaches it to the kart.
 *  \param kart_index The index of the kart that triggered the check line.
 */
void CheckGoal::trigger(unsigned int kart_index)
{
    SoccerWorld* world = dynamic_cast<SoccerWorld*>(World::getWorld());
    if(!world)
    {
        Log::warn("CheckGoal", 
                  "No soccer world found, cannot count the points.");
        return;
    }

    world->onCheckGoalTriggered(m_first_goal);
}   // trigger