@Override protected void loadDefaults() { super.loadDefaults(); orientation = Types.RIGHT.copy(); draw_arrow = true; is_oriented = true; }
@Override public void update(Game game) { Vector2d tmp = orientation.copy(); orientation = Types.NONE.copy(); super.update(game); Vector2d dir = lastDirection(); if (0 == dir.x && 0 == dir.y) { // No movement. orientation = tmp; } else { // moved, update: dir.normalise(); orientation = dir; } }
@Override public void copyTo(VGDLSprite target) { OrientedAvatar targetSprite = (OrientedAvatar) target; super.copyTo(targetSprite); }