Treballan en la Intro
This commit is contained in:
@@ -15,13 +15,9 @@ std::vector<SDL_Point> createPath(int start, int end, PathType type, int fixed_p
|
||||
double t = static_cast<double>(i) / (steps - 1);
|
||||
double value = start + (end - start) * easingFunction(t);
|
||||
|
||||
if (start > 0 && end < 0)
|
||||
if ((start > 0 && end < 0) || (start < 0 && end > 0))
|
||||
{
|
||||
value = start - std::abs(end - start) * easingFunction(t);
|
||||
}
|
||||
else if (start < 0 && end > 0)
|
||||
{
|
||||
value = start + std::abs(end - start) * easingFunction(t);
|
||||
value = start + (end > 0 ? 1 : -1) * std::abs(end - start) * easingFunction(t);
|
||||
}
|
||||
|
||||
switch (type)
|
||||
@@ -105,8 +101,8 @@ void PathSprite::enable()
|
||||
|
||||
// Establece la posición
|
||||
auto &path = paths_.at(current_path_);
|
||||
const auto &p = path.spots.at(path.counter);
|
||||
setPosition(p);
|
||||
const auto &P = path.spots.at(path.counter);
|
||||
setPosition(P);
|
||||
}
|
||||
|
||||
// Coloca el sprite en los diferentes puntos del recorrido
|
||||
|
||||
Reference in New Issue
Block a user