|
@@ -55,6 +55,10 @@
|
55
|
55
|
.css('position', 'absolute')
|
56
|
56
|
.offset(adjustMapOffset(tower.position, thisLevel))
|
57
|
57
|
.rotate(tower.rotation)
|
|
58
|
+ .dblclick(function() {
|
|
59
|
+ layout.towers = $.grep(layout.towers, function(value) { return value != tower; });
|
|
60
|
+ $(this).remove();
|
|
61
|
+ })
|
58
|
62
|
.mousedown(function(e) {
|
59
|
63
|
if (!e.shiftKey) {
|
60
|
64
|
return;
|
|
@@ -71,7 +75,7 @@
|
71
|
75
|
var newMouseAngle = Math.atan2(mouseY, mouseX);
|
72
|
76
|
var mouseDelta = newMouseAngle - initialMouseAngle;
|
73
|
77
|
var rotation = initialRotation + newMouseAngle * (180 / Math.PI);
|
74
|
|
- el.data('tower').rotation = rotation;
|
|
78
|
+ tower.rotation = rotation;
|
75
|
79
|
el.rotate(rotation);
|
76
|
80
|
};
|
77
|
81
|
|