summaryrefslogtreecommitdiff
path: root/lib/rules.h
blob: ac441a878016a8ee058f0eb479d4564996b04455 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef RULES_H
#define RULES_H

#include "cetris.h"

static bool twenty_line_sprint(ctrs_game *g)
{
  return g->lines >= 20;
}

static bool forty_line_sprint(ctrs_game *g)
{
  return g->lines >= 40;
}

static bool marathon(ctrs_game *g)
{
  (void)g;
  return false;
}

// https://tetris.fandom.com/wiki/Tetris_Worlds
static unsigned long tetris_worlds_levels[20] =
{
  1000, 793, 618, 473, 355, 262, 189, 134, 94, 64,
  43,   28,  18,  11,  7,   4,   2,   1,   1,  1
};

// https://tetris.fandom.com/wiki/Tetris_DS
static ctrs_config tetris_ds_config = {
  .drop_period = 83,
  .next_piece_delay = 666,
  .line_delay_clear = 666,
  .lock_delay = 500,
  .force_lock = 0,
#if CETRIS_ENABLE_DAS
  .das_arr = 83,
  .das_das = 183,
#endif
  .board_x = 10,
  .board_y = 43,
  .board_visible = 20,
  .mino_start_x = 3,
  .mino_start_y = 19,
  .starting_level = 1,
  .wait_on_clear = true,
  .levels = &tetris_worlds_levels[0],
  .win_condition = marathon
};

#endif /* RULES_H */