(action (name "flat-left")
(x-offset 2)
(y-offset 3)
- (images "creatures/snowsnail/snowsnail_flip1.png"
+ (images "creatures/snowsnail/snowsnail_flip1.png"
"creatures/snowsnail/snowsnail_flip2.png"
"creatures/snowsnail/snowsnail_flip3.png"
"creatures/snowsnail/snowsnail_flip4.png"
void
SnowSnail::active_update(float elapsed_time)
{
+ if(flat_timer.started()) {
+ sprite->set_fps(64 - 15 * flat_timer.get_timegone());
+ }
if(ice_state == ICESTATE_FLAT && flat_timer.check()) {
ice_state = ICESTATE_NORMAL;
physic.set_velocity_x(dir == LEFT ? -WALKSPEED : WALKSPEED);
physic.set_velocity_y(0);
sprite->set_action(dir == LEFT ? "flat-left" : "flat-right");
+ sprite->set_fps(64);
flat_timer.start(4);
ice_state = ICESTATE_FLAT;
break;
return (int) action->surfaces[get_frame()]->get_height();
}
+void
+Sprite::set_fps(float new_fps)
+{
+ action->fps = new_fps;
+}
+
/** Set action (or state) */
void set_action(const std::string& act, int loops = -1);
+ /** Set framerate */
+ void set_fps(float new_fps);
+
/* Stop animation */
void stop_animation()
{ animation_loops = 0; }
GLenum error = glGetError();
if(error != GL_NO_ERROR) {
std::ostringstream msg;
- msg << "OpenGLError while '" << message << "': "
- << gluErrorString(error);
+ msg << "OpenGLError while '" << message << "': ";
+ //<< gluErrorString(error);
throw std::runtime_error(msg.str());
}
#endif