-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathradar.inc
More file actions
25 lines (20 loc) · 2.46 KB
/
radar.inc
File metadata and controls
25 lines (20 loc) · 2.46 KB
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
% si la celda actual esta libre verifica si dos objetos adyacentes chocaran en ella
#BeginMacro(Colision1)
(0,0,0) = 0 and ((if ((-1,-1,0) = 1.1, 1, 0) + if ((-1,0,0) = 5.1, 1, 0) + if ((-1,1,0) = 3.1, 1, 0) + if ((0,-1,0) = 6.1, 1, 0) + if ((0,1,0) = 7.1, 1, 0) + if ((1,-1,0) = 2.1, 1, 0) + if ((1,0,0) = 8.1, 1, 0) + if ((1,1,0) = 4.1, 1, 0)) > 1 or (if ((-1,-1,0) = 1.2, 1, 0) + if ((-1,0,0) = 5.2, 1, 0) + if ((-1,1,0) = 3.2, 1, 0) + if ((0,-1,0) = 6.2, 1, 0) + if ((0,1,0) = 7.2, 1, 0) + if ((1,-1,0) = 2.2, 1, 0) + if ((1,0,0) = 8.2, 1, 0) + if ((1,1,0) = 4.2, 1, 0)) > 1)
#EndMacro
% si la celda actual esta ocupada verifica si un objeto adyacente chocara en ella
#BeginMacro(Colision2)
(((0,0,0) = 6.1 and (0,1,0) = 7.1) or ((0,0,0) = 8.1 and (-1,0,0) = 5.1) or ((0,0,0) = 1.1 and (1,1,0) = 4.1) or ((0,0,0) = 2.1 and (-1,1,0) = 3.1)) or (((0,0,0) = 6.2 and (0,1,0) = 7.2) or ((0,0,0) = 8.2 and (-1,0,0) = 5.2) or ((0,0,0) = 1.2 and (1,1,0) = 4.2) or ((0,0,0) = 2.2 and (-1,1,0) = 3.2))
#EndMacro
% idem anterior pero alternando la celda actual
#BeginMacro(Colision2b)
(((0,0,0) = 7.1 and (0,-1,0) = 6.1) or ((0,0,0) = 5.1 and (1,0,0) = 8.1) or ((0,0,0) = 4.1 and (-1,-1,0) = 1.1) or ((0,0,0) = 3.1 and (1,-1,0) = 2.1)) or (((0,0,0) = 7.2 and (0,-1,0) = 6.2) or ((0,0,0) = 5.2 and (1,0,0) = 8.2) or ((0,0,0) = 4.2 and (-1,-1,0) = 1.2) or ((0,0,0) = 3.2 and (1,-1,0) = 2.2))
#EndMacro
% detecta un cruce
#BeginMacro(Cruce)
(0,0,0) = 0 and ((if ((-1,-1,0) = 1.1, 1, 0) + if ((-1,0,0) = 5.1, 1, 0) + if ((-1,1,0) = 3.1, 1, 0) + if ((0,-1,0) = 6.1, 1, 0) + if ((0,1,0) = 7.1, 1, 0) + if ((1,-1,0) = 2.1, 1, 0) + if ((1,0,0) = 8.1, 1, 0) + if ((1,1,0) = 4.1, 1, 0)) > 0 and (if ((-1,-1,0) = 1.2, 1, 0) + if ((-1,0,0) = 5.2, 1, 0) + if ((-1,1,0) = 3.2, 1, 0) + if ((0,-1,0) = 6.2, 1, 0) + if ((0,1,0) = 7.2, 1, 0) + if ((1,-1,0) = 2.2, 1, 0) + if ((1,0,0) = 8.2, 1, 0) + if ((1,1,0) = 4.2, 1, 0)) > 0)
#EndMacro
%codifica un cruce
#BeginMacro(Codificacion_Cruce)
if((1,1,0) = 4.1,9,0) * 1 + if((1,0,0) = 8.1,9,0) * 10 + if((-1,1,0) = 3.1,9,0) * 100 + if((0,-1,0) = 6.1,9,0) * 1000 + if((0,1,0) = 7.1,9,0) * 10000 + if((1,-1,0) = 2.1,9,0) * 100000 + if((-1,0,0) = 5.1,9,0) * 1000000 + if((-1,-1,0) = 1.1,9,0) * 10000000 + if((1,1,0) = 4.2,8,0) * 1 + if((1,0,0) = 8.2,8,0) * 10 + if((-1,1,0) = 3.2,8,0) * 100 + if((0,-1,0) = 6.2,8,0) * 1000 + if((0,1,0) = 7.2,8,0) * 10000 + if((1,-1,0) = 2.2,8,0) * 100000 + if((-1,0,0) = 5.2,8,0) * 1000000 + if((-1,-1,0) = 1.2,8,0) * 10000000
#EndMacro