示例#1
0
void disc_init(Disc *disc, Vec2d start) {
  disc->pos.x = start.x * 12 + 5.5;
  disc->pos.y = start.y * 12 + 5.5;
  disc->vel.x = 0;
  disc->vel.y = 0;
  disc->radius = 5.5;
  disc->mass = disc_calc_mass(disc);
}
static void disc_init(Disc *disc) {
  GRect frame = window_frame;
  disc->pos.x = frame.size.w/2;
  disc->pos.y = frame.size.h/2;
  disc->vel.x = 0;
  disc->vel.y = 0;
  disc->radius = next_radius;
  disc->mass = disc_calc_mass(disc);
  next_radius += 0.5;
}
static void disc_init(Disc *disc) {
  static double next_radius = 3;

  GRect frame = window_frame;
  disc->pos.x = frame.size.w/2;
  disc->pos.y = frame.size.h/2;
  disc->vel.x = 0;
  disc->vel.y = 0;
  disc->radius = next_radius;
  disc->mass = disc_calc_mass(disc);
#ifdef PBL_COLOR
  disc->color = GColorFromRGB(rand() % 255, rand() % 255, rand() % 255);
#endif
  next_radius += 0.5;
}