コード例 #1
0
void load_card(void) {
  //load_card_image();
  load_card_text(current_card);
  card_used[current_card] = true;

  if (!(--card_counter)) {
    reset_card_used();
  }
}
コード例 #2
0
void init_cards(Window *main_window,
                CardBack_t main_card_front,
                CardBack_t main_card_back)
{
  reset_card_used();
  current_card = rand() % NUMBER_OF_CARDS;
  current_side = FRONT;
  window = main_window;
  window_set_background_color(main_window, GColorBlack);
  card_front = main_card_front;
  card_back = main_card_back;
  init_card_text();
  GRect bounds = layer_get_bounds(window_get_root_layer(window));

  load_card();
}
コード例 #3
0
ファイル: cards.c プロジェクト: pebble-hacks/watch_and_learn
void init_cards(Window *main_window,
                GBitmap *main_image_front,
                BitmapLayer *main_image_layer_front,
                CardBack_t main_card_back)
{
  reset_card_used();
  current_card = rand() % NUMBER_OF_CARDS;
  current_side = FRONT;
  window = main_window;
  image_front = main_image_front;
  image_layer_front = main_image_layer_front;
  card_back = main_card_back;
  init_card_text();
  GRect bounds = layer_get_bounds(window_get_root_layer(window));
  image_layer_front = bitmap_layer_create(bounds);
  bitmap_layer_set_alignment(image_layer_front, GAlignCenter);
  layer_add_child(window_get_root_layer(window), (Layer*)image_layer_front);

  load_card();
}