t-spin only if last movement is a rotation

This commit is contained in:
adrienmalin
2019-01-16 22:53:19 +01:00
parent 69a21fe12f
commit 6e9f5659ae
3 changed files with 23 additions and 21 deletions

View File

@ -8,14 +8,14 @@ const T_SLOT = [
]
func t_spin():
var center = to_global(minoes[0].translation)
var a = not grid_map.is_free_cell(center + T_SLOT[orientation])
var b = not grid_map.is_free_cell(center + T_SLOT[(1+orientation)%4])
var c = not grid_map.is_free_cell(center + T_SLOT[(3+orientation)%4])
var d = not grid_map.is_free_cell(center + T_SLOT[(2+orientation)%4])
if rotation_point_5_used or (a and b and (c or d)):
return "T-SPIN"
elif c and d and (a or b):
return "MINI T-SPIN"
else:
return ""
if rotated_last:
var center = to_global(minoes[0].translation)
var a = not grid_map.is_free_cell(center + T_SLOT[orientation])
var b = not grid_map.is_free_cell(center + T_SLOT[(1+orientation)%4])
var c = not grid_map.is_free_cell(center + T_SLOT[(3+orientation)%4])
var d = not grid_map.is_free_cell(center + T_SLOT[(2+orientation)%4])
if rotation_point_5_used or (a and b and (c or d)):
return "T-SPIN"
elif c and d and (a or b):
return "MINI T-SPIN"
return ""