�
I've made it so that sliding on ice works again (after the changes to the
input handling functions--looks much nicer now, btw).
I also changed supertux.stgt to make snow5.png ice. You can try out sliding
around on ice in the second level. I wasn't really sure what would be a good
sliding rate so people should try fiddling with different values.
Right now the accel/decel rate is the direct inverse of the velocity.. this
inverse can be increased or decreased.
Also, the smalltux animation doesn't "slide", he walks to a stop.. haven't
really looked into where to fix this, but I'm sure others could find it and
fix it before I could.
�
SVN-Revision: 532
(solid #t))
(tile (id 11)
(images "snow5.png")
- (solid #t))
+ (solid #t)
+ (ice #t))
(tile (id 12)
(images "snow6.png")
(solid #t))
ax = WALK_ACCELERATION_X * -1.5;
}
}
-
+
+ // if we're on ice slow down acceleration or deceleration
+ if (isice(base.x, base.y + base.height))
+ {
+ /* the acceleration/deceleration rate on ice is inversely proportional to
+ * the current velocity.
+ */
+
+ // increasing 1 will increase acceleration/deceleration rate
+ // decreasing 1 will decrease acceleration/deceleration rate
+ // must stay above zero, though
+ if (ax != 0) ax *= 1 / fabs(vx);
+ }
+
physic.set_velocity(vx, vy);
physic.set_acceleration(ax, ay);
}