Fix config loading, speed thresholds and block selection; add tests, README, CLAUDE.md
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"ALL_BLOCKS": {
|
||||
"__type__": "EnumClass",
|
||||
"name": "BlockType",
|
||||
"members": {
|
||||
"O": {
|
||||
"name": "Square",
|
||||
"color": [255,255,0],
|
||||
"min_score": 0,
|
||||
"shapes": [
|
||||
[[1,1],[1,1]]
|
||||
]
|
||||
},
|
||||
"I": {
|
||||
"name": "Line",
|
||||
"color": [0,255,255],
|
||||
"min_score": 0,
|
||||
"shapes": [
|
||||
[[1,1,1,1]],
|
||||
[[1],[1],[1],[1]]
|
||||
]
|
||||
},
|
||||
"I3": {
|
||||
"name": "Line3",
|
||||
"color": [55,180,210],
|
||||
"min_score": 0,
|
||||
"shapes": [
|
||||
[[1,1,1]],
|
||||
[[1],[1],[1]]
|
||||
]
|
||||
},
|
||||
"L": {
|
||||
"name": "L-Shape",
|
||||
"color": [255,0,255],
|
||||
"min_score": 0,
|
||||
"shapes": [
|
||||
[[1, 0], [1, 0], [1, 1]],
|
||||
[[1, 1, 1], [1, 0, 0]],
|
||||
[[1, 1], [0, 1], [0, 1]],
|
||||
[[0, 0, 1], [1, 1, 1]]
|
||||
]
|
||||
},
|
||||
"J": {
|
||||
"name": "J-Shape",
|
||||
"color": [0,0,255],
|
||||
"min_score": 900,
|
||||
"shapes": [
|
||||
[[0, 1], [0, 1], [1, 1]],
|
||||
[[1, 0, 0], [1, 1, 1]],
|
||||
[[1, 1], [1, 0], [1, 0]],
|
||||
[[1, 1, 1], [0, 0, 1]]
|
||||
]
|
||||
},
|
||||
"S": {
|
||||
"name": "S-Shape",
|
||||
"color": [0,255,0],
|
||||
"min_score": 1000,
|
||||
"shapes": [
|
||||
[[0, 1, 1], [1, 1, 0]],
|
||||
[[1, 0], [1, 1], [0, 1]]
|
||||
]
|
||||
},
|
||||
"Z": {
|
||||
"name": "Z-Shape",
|
||||
"color": [255,0,0],
|
||||
"min_score": 2500,
|
||||
"shapes": [
|
||||
[[1, 1, 0], [0, 1, 1]],
|
||||
[[0, 1], [1, 1], [1, 0]]
|
||||
]
|
||||
},
|
||||
"T": {
|
||||
"name": "T-Shape",
|
||||
"color": [255,255,255],
|
||||
"min_score": 2500,
|
||||
"shapes": [
|
||||
[[1, 1, 1], [0, 1, 0]],
|
||||
[[1, 0], [1, 1], [1, 0]],
|
||||
[[0, 1, 0], [1, 1, 1]],
|
||||
[[0, 1], [1, 1], [0, 1]]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,163 @@
|
||||
{
|
||||
"ADDITIONAL_BLOCKS": {
|
||||
"__type__": "EnumClass",
|
||||
"name": "BlockType",
|
||||
"members": {
|
||||
"D": {
|
||||
"name": "Dot",
|
||||
"color": [255, 255, 100],
|
||||
"min_score": 3500,
|
||||
"shapes": [
|
||||
[[1]]
|
||||
]
|
||||
},
|
||||
"U": {
|
||||
"name": "U-Shape",
|
||||
"color": [135, 135, 135],
|
||||
"min_score": 4500,
|
||||
"shapes": [
|
||||
[[1, 0, 1], [1, 1, 1]],
|
||||
[[1, 1], [1, 0], [1, 1]],
|
||||
[[1, 1, 1], [1, 0, 1]],
|
||||
[[1, 1], [0, 1], [1, 1]]
|
||||
]
|
||||
},
|
||||
"T1": {
|
||||
"name": "T-Shape+",
|
||||
"color": [0, 200, 255],
|
||||
"min_score": 10000,
|
||||
"shapes": [
|
||||
[[1, 1, 1], [0, 1, 0], [0, 1, 0]],
|
||||
[[0, 0, 1], [1, 1, 1], [0, 0, 1]],
|
||||
[[0, 1, 0], [0, 1, 0], [1, 1, 1]],
|
||||
[[1, 0, 0], [1, 1, 1], [1, 0, 0]]
|
||||
]
|
||||
},
|
||||
"U1": {
|
||||
"name": "U-Shape+",
|
||||
"color": [255, 150, 0],
|
||||
"min_score": 10000,
|
||||
"shapes": [
|
||||
[[1, 1, 1], [1, 0, 1], [1, 0, 1]],
|
||||
[[1, 1, 1], [1, 0, 0], [1, 1, 1]],
|
||||
[[1, 0, 1], [1, 0, 1], [1, 1, 1]],
|
||||
[[1, 1, 1], [0, 0, 1], [1, 1, 1]]
|
||||
]
|
||||
},
|
||||
"X": {
|
||||
"name": "X-Shape",
|
||||
"color": [50, 150, 100],
|
||||
"min_score": 15000,
|
||||
"shapes": [
|
||||
[[0, 1, 0], [1, 1, 1], [0, 1, 0]]
|
||||
]
|
||||
},
|
||||
"Cn": {
|
||||
"name": "Corner",
|
||||
"color": [15, 180, 180],
|
||||
"min_score": 5000,
|
||||
"shapes": [
|
||||
[[1, 0], [1, 1]],
|
||||
[[1, 1], [1, 0]],
|
||||
[[1, 1], [0, 1]],
|
||||
[[0, 1], [1, 1]]
|
||||
]
|
||||
},
|
||||
"CN": {
|
||||
"name": "Corner+",
|
||||
"color": [15, 15, 180],
|
||||
"min_score": 4000,
|
||||
"shapes": [
|
||||
[[1, 0, 0], [1, 0, 0], [1, 1, 1]],
|
||||
[[1, 1, 1], [1, 0, 0], [1, 0, 0]],
|
||||
[[1, 1, 1], [0, 0, 1], [0, 0, 1]],
|
||||
[[0, 0, 1], [0, 0, 1], [1, 1, 1]]
|
||||
]
|
||||
},
|
||||
"W": {
|
||||
"name": "Dabl",
|
||||
"color": [180, 25, 230],
|
||||
"min_score": 15000,
|
||||
"shapes": [
|
||||
[[1, 0, 0], [1, 1, 0], [0, 1, 1]],
|
||||
[[0, 1, 1], [1, 1, 0], [1, 0, 0]],
|
||||
[[1, 1, 0], [0, 1, 1], [0, 0, 1]],
|
||||
[[0, 0, 1], [0, 1, 1], [1, 1, 0]]
|
||||
]
|
||||
},
|
||||
"Z1": {
|
||||
"name": "Zet",
|
||||
"color": [170, 25, 130],
|
||||
"min_score": 25000,
|
||||
"shapes": [
|
||||
[[1, 1, 0], [0, 1, 0], [0, 1, 1]],
|
||||
[[0, 0, 1], [1, 1, 1], [1, 0, 0]]
|
||||
]
|
||||
},
|
||||
"I2": {
|
||||
"name": "Line2",
|
||||
"color": [50, 25, 60],
|
||||
"min_score": 25000,
|
||||
"shapes": [
|
||||
[[1, 1]],
|
||||
[[1], [1]]
|
||||
]
|
||||
},
|
||||
"P": {
|
||||
"name": "P",
|
||||
"color": [240, 170, 40],
|
||||
"min_score": 30000,
|
||||
"shapes": [
|
||||
[[1, 1], [1, 1], [1, 0]],
|
||||
[[1, 1, 1], [0, 1, 1]],
|
||||
[[0, 1], [1, 1], [1, 1]],
|
||||
[[1, 1, 0], [1, 1, 1]]
|
||||
]
|
||||
},
|
||||
"F": {
|
||||
"name": "F",
|
||||
"color": [135, 110, 65],
|
||||
"min_score": 30000,
|
||||
"shapes": [
|
||||
[[0, 1, 1], [1, 1, 0], [0, 1, 0]],
|
||||
[[0, 1, 0], [1, 1, 1], [0, 0, 1]],
|
||||
[[0, 1, 0], [0, 1, 1], [1, 1, 0]],
|
||||
[[1, 0, 0], [1, 1, 1], [0, 1, 0]]
|
||||
]
|
||||
},
|
||||
"S1": {
|
||||
"name": "S1",
|
||||
"color": [240, 110, 20],
|
||||
"min_score": 30000,
|
||||
"shapes": [
|
||||
[[1, 0], [1, 0], [1, 1], [0, 1]],
|
||||
[[0, 1, 1, 1], [1, 1, 0, 0]],
|
||||
[[1, 0], [1, 1], [0, 1], [0, 1]],
|
||||
[[0, 0, 1, 1], [1, 1, 1, 0]]
|
||||
]
|
||||
},
|
||||
"L1": {
|
||||
"name": "L1",
|
||||
"color": [45, 95, 175],
|
||||
"min_score": 30000,
|
||||
"shapes": [
|
||||
[[1, 0], [1, 0], [1, 0], [1, 1]],
|
||||
[[1, 1, 1, 1], [1, 0, 0, 0]],
|
||||
[[1, 1], [0, 1], [0, 1], [0, 1]],
|
||||
[[0, 0, 0, 1], [1, 1, 1, 1]]
|
||||
]
|
||||
},
|
||||
"F1": {
|
||||
"name": "F1",
|
||||
"color": [240, 230, 60],
|
||||
"min_score": 0,
|
||||
"shapes": [
|
||||
[[0, 1], [1, 1], [0, 1], [0, 1]],
|
||||
[[0, 0, 1, 0], [1, 1, 1, 1]],
|
||||
[[1, 0], [1, 0], [1, 1], [1, 0]],
|
||||
[[1, 1, 1, 1], [0, 1, 0, 0]]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -161,4 +161,3 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
{
|
||||
"CONFIG": {
|
||||
"keys": {
|
||||
"left": {
|
||||
"__type__": "PygameKey",
|
||||
"name": "K_LEFT"
|
||||
},
|
||||
"right": {
|
||||
"__type__": "PygameKey",
|
||||
"name": "K_RIGHT"
|
||||
},
|
||||
"rotate": {
|
||||
"__type__": "PygameKey",
|
||||
"name": "K_UP"
|
||||
},
|
||||
"drop": {
|
||||
"__type__": "PygameKey",
|
||||
"name": "K_DOWN"
|
||||
},
|
||||
"pause": {
|
||||
"__type__": "PygameKey",
|
||||
"name": "K_p"
|
||||
},
|
||||
"restart": {
|
||||
"__type__": "PygameKey",
|
||||
"name": "K_r"
|
||||
},
|
||||
"exit": {
|
||||
"__type__": "PygameKey",
|
||||
"name": "K_ESCAPE"
|
||||
}
|
||||
},
|
||||
"controls_text": {
|
||||
"__type__": "list",
|
||||
"items": [
|
||||
"Controls:",
|
||||
"Left/Right Move",
|
||||
"Up - Rotate",
|
||||
"Dn - Drop",
|
||||
"P - Pause",
|
||||
"R - Restart",
|
||||
"ESC - Exit"
|
||||
]
|
||||
},
|
||||
"colors": {
|
||||
"background": {
|
||||
"__type__": "tuple",
|
||||
"items": [20, 20, 40]
|
||||
},
|
||||
"field": {
|
||||
"__type__": "tuple",
|
||||
"items": [30, 30, 60]
|
||||
},
|
||||
"border": {
|
||||
"__type__": "tuple",
|
||||
"items": [100, 100, 150]
|
||||
},
|
||||
"text": {
|
||||
"__type__": "tuple",
|
||||
"items": [255, 255, 255]
|
||||
},
|
||||
"game_over": {
|
||||
"__type__": "tuple",
|
||||
"items": [255, 0, 0]
|
||||
}
|
||||
},
|
||||
"store_width": 10,
|
||||
"block_size": 30,
|
||||
"high_score_inc_speed": true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user