Code covered by the BSD License  

Highlights from
Carcassonne

image thumbnail

Carcassonne

by

 

21 Jan 2012 (Updated )

Emulation of the map-building game Carcassonne, including 4 expansion packs

BuilderPatch2(X, Y, size, color, axH)
function h = BuilderPatch2(X, Y, size, color, axH)
% Draws a pig

x = [ 50.3963,  37.3088,  20.2949,  15.3871,  15.3871,  19.3134, 28.8018, ...
      47.4516,  48.1060,  36.3272,  17.0230,  14.7327,  18.3318, 37.6359, ...
      90.9677, 112.8894, 120.0876, 121.3963, 117.7972,  97.8387, 86.3871, ...
      88.0230, 107.9816, 117.4700, 121.0691, 119.1060, 111.5806, 89.9862, ...
      85.7327,  86.7143,  94.8940,  99.8018,  99.1475,  90.9677, 82.7880, ...
      70.3548,  60.2120,  43.8525,  37.3088,  37.9631,  42.8710, 50.7235];
   
y = [ 66.6930,  68.9854,  69.5585,  75.8626,  81.0205,  88.4708,  89.0439, ...
      91.9094,  96.4942, 148.0731, 155.5234, 157.8158, 169.8509, 172.1433, ...
     172.1433, 172.1433, 167.5585, 160.1082, 150.9386, 146.3538,  97.0673, ...
      91.3363,  90.1901,  89.0439,  83.3129,  72.9971,  67.8392,  67.8392, ...
      65.5468,  45.4883,  42.0497,  34.5994,  25.4298,  15.1140,  12.8216, ...
      14.5409,  11.6754,  13.9678,  24.2836,  35.1725,  42.0497,  46.0614];

x = x - mean(x);
y = y - mean(y);
  
pupSize = max(y) - min(y);
scale = size / pupSize;
x = x * scale;
y = y * scale;

h = patch(X + x, Y + y, color, 'Parent', axH, 'HitTest', 'off');

Contact us