Beispiel #1
0
void
Candle::save(lisp::Writer& writer) {
  MovingSprite::save(writer);
  writer.write("burning", burning);
  writer.write("flicker", flicker);
  writer.write("color", lightcolor.toVector(false));
}
Beispiel #2
0
void
Spotlight::save(lisp::Writer& writer) {
  GameObject::save(writer);
  writer.write("x", position.x);
  writer.write("y", position.y);
  writer.write("color", color.toVector(false));
}
Beispiel #3
0
void
SpawnPoint::save(lisp::Writer& writer){
  writer.start_list("spawnpoint");

  writer.write("x",pos.x);
  writer.write("y",pos.y);
  writer.write("name",name,false);

  writer.end_list("spawnpoint");
}
Beispiel #4
0
void
Background::save(lisp::Writer& writer) {
  GameObject::save(writer);
  switch (alignment) {
    case LEFT_ALIGNMENT:   writer.write("alignment", "left",   false); break;
    case RIGHT_ALIGNMENT:  writer.write("alignment", "right",  false); break;
    case TOP_ALIGNMENT:    writer.write("alignment", "top",    false); break;
    case BOTTOM_ALIGNMENT: writer.write("alignment", "bottom", false); break;
    case NO_ALIGNMENT: break;
  }

  writer.write("scroll-offset-x", scroll_offset.x);
  writer.write("scroll-offset-y", scroll_offset.y);
  writer.write("scroll-speed-x",  scroll_speed.x);
  writer.write("scroll-speed-y",  scroll_speed.y);
  writer.write("speed", speed);
  if (speed_y != speed){
    writer.write("speed_y", speed_y);
  }

  writer.write("image", imagefile, false);
  if (imagefile_top != "") {
    writer.write("image-top", imagefile_top);
  }
  if (imagefile_bottom != "") {
    writer.write("image-bottom", imagefile_bottom);
  }
}
Beispiel #5
0
void
BadGuy::save(lisp::Writer& writer) {
  MovingSprite::save(writer);
  if(dir == LEFT){
    writer.write("direction", "left", false);
  } else {
    writer.write("direction", "right", false);
  }
  if(dead_script != ""){
    writer.write("dead-script", dead_script, false);
  }
}
void
SecretAreaTrigger::save(lisp::Writer& writer) {
  MovingObject::save(writer);
  writer.write("width", bbox.get_width());
  writer.write("height", bbox.get_height());
  if (fade_tilemap != "") {
    writer.write("fade-tilemap", fade_tilemap, false);
  }
  writer.write("message", message, false);
  if (script != "") {
    writer.write("script", script, false);
  }
}
Beispiel #7
0
void
PlayerStatus::write(lisp::Writer& writer)
{
  switch(bonus) {
    case NO_BONUS:
      writer.write("bonus", "none");
      break;
    case GROWUP_BONUS:
      writer.write("bonus", "growup");
      break;
    case FIRE_BONUS:
      writer.write("bonus", "fireflower");
      break;
    case ICE_BONUS:
      writer.write("bonus", "iceflower");
      break;
    default:
      log_warning << "Unknown bonus type." << std::endl;
      writer.write("bonus", "none");
  }
  writer.write("fireflowers", max_fire_bullets);
  writer.write("iceflowers", max_ice_bullets);

  writer.write("coins", coins);
}
Beispiel #8
0
void
TileMap::save(lisp::Writer& writer) {
  GameObject::save(writer);
  if (draw_target == LIGHTMAP) {
    writer.write("draw-target", "lightmap", false);
  } else {
    writer.write("draw-target", "normal", false);
  }
  writer.write("width", width);
  writer.write("height", height);
  writer.write("speed", speed_x);
  if(speed_y != speed_x) {
    writer.write("speed", speed_y);
  }
  writer.write("solid", real_solid);
  writer.write("z-pos", z_pos);
  if(alpha != 1) {
    writer.write("alpha", alpha);
  }
  if(path) {
    path->save(writer);
  }
  writer.write("tiles", tiles);
}
Beispiel #9
0
void
Gradient::save(lisp::Writer& writer) {
  GameObject::save(writer);
  writer.write("z-pos",layer);
  switch (gradient_direction) {
    case HORIZONTAL:        writer.write("direction", "horizontal"       , false); break;
    case VERTICAL_SECTOR:   writer.write("direction", "vertical_sector"  , false); break;
    case HORIZONTAL_SECTOR: writer.write("direction", "horizontal_sector", false); break;
    case VERTICAL: break;
  }
  if(gradient_direction == HORIZONTAL || gradient_direction == HORIZONTAL_SECTOR) {
    writer.write("left_color" , gradient_top.toVector(false));
    writer.write("right_color", gradient_bottom.toVector(false));
  } else {
    writer.write("top_color"   , gradient_top.toVector(false));
    writer.write("bottom_color", gradient_bottom.toVector(false));
  }
}
Beispiel #10
0
void
Door::save(lisp::Writer& writer) {
  MovingObject::save(writer);
  writer.write("sector", target_sector, false);
  writer.write("spawnpoint", target_spawnpoint, false);
}
Beispiel #11
0
void
GameObject::save(lisp::Writer& writer) {
    if(name != "") {
        writer.write("name", name, false);
    }
}
Beispiel #12
0
void
MagicBlock::save(lisp::Writer& writer) {
  MovingSprite::save(writer);
  writer.write("color", color.toVector(false));
}
Beispiel #13
0
void
Owl::save(lisp::Writer& writer) {
  BadGuy::save(writer);
  writer.write("carry", carried_obj_name);
}
Beispiel #14
0
void
PushButton::save(lisp::Writer& writer) {
  MovingSprite::save(writer);
  writer.write("script", script, false);
}
Beispiel #15
0
void
MovingObject::save(lisp::Writer& writer) {
    GameObject::save(writer);
    writer.write("x", bbox.p1.x);
    writer.write("y", bbox.p1.y);
}
Beispiel #16
0
void
Thunderstorm::save(lisp::Writer& writer) {
  GameObject::save(writer);
  writer.write("running", running);
  writer.write("interval", interval);
}
Beispiel #17
0
void
LevelTime::save(lisp::Writer& writer) {
  GameObject::save(writer);
  writer.write("time", time_left);
}