"use strict";

function createEnemy(location, size, options) {
	var e = Object.create(SqEntity);
	e.init(TYPE_ENEMY, location, size, options);
	
	e.stepAction.push(alignRotationToMovement);
	
	e.draw = function(){
		var canvas = document.getElementById('scene').getContext('2d');
		var drawSize = this.size * 100;

		canvas.save();
		
		canvas.fillStyle = "hsla(" + this.color.h + ", " + this.color.s * 100 + "%, " + this.color.l * 100 + "%, " + this.color.a + ")";
		
		canvas.translate(this.body.GetPosition().x * 100 + 300, -this.body.GetPosition().y * 100 + 300);
		canvas.rotate(-this.body.GetAngle());
		canvas.fillRect(-drawSize, -drawSize, drawSize * 2, drawSize * 2);
		
		canvas.restore();
	};
	
	return e;
}
@@ -56,12 +56,24 @@
 ions
+, behaviours
 ) %7B%0A
-
 %09var
@@ -155,51 +155,85 @@
 %0A%09%0A%09
-e.stepAction.push(alignRotationToMovement);
+for (var i = 0; i %3C behaviours; ++i) %7B%0A%09%09e.stepAction.push(behaviours%5Bi%5D);%0A%09%7D
 %0A%09%0A%09
@@ -757,8 +757,9 @@
 urn e;%0A%7D
+%0A

add behaviours array to createEnemy