Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

35 lines (27 sloc) 1.123 kb
module dancingMan;
import animatedAsciiSprite;
import types;
class DancingMan {
AnimatedAsciiSprite[6] _animations;
Animate _curAnimation;
this() {
// init animations
_animations[Animate.DOWN] = new AnimatedAsciiSprite("graphics/man-down.txt", null, true, false, 26, 24);
_animations[Animate.LEFT] = new AnimatedAsciiSprite("graphics/man-left.txt", null, true, false, 26, 24);
_animations[Animate.MOONWALK] = new AnimatedAsciiSprite("graphics/man-moonwalk.txt", null, true, false, 26, 24);
_animations[Animate.RIGHT] = new AnimatedAsciiSprite("graphics/man-right.txt", null, true, false, 26, 24);
_animations[Animate.UP] = new AnimatedAsciiSprite("graphics/man-up.txt", null, true, false, 26, 22);
_animations[Animate.YMCA] = new AnimatedAsciiSprite("graphics/man-ymca.txt", null, true, false, 26, 24);
}
void setCurAnimation(Animate animation) {
_curAnimation = animation;
_animations[_curAnimation]._animate = true;
}
void animate() {
_animations[_curAnimation].drawSprite();
_animations[_curAnimation].nextFrame();
}
void draw() {
_animations[_curAnimation].drawSprite();
}
}
Jump to Line
Something went wrong with that request. Please try again.