Пример #1
0
define(function(require) {

	var Entity = require("engine/Entity");

	return Entity.extend({
		init: function(position, size)
		{
			this._super("FlagStand", position, size);
		},

		update: function(timeDx)
		{
			this._super(timeDx);
		},

		draw: function(ctx)
		{
			ctx.save();
			ctx.fillStyle = "Gold";
			ctx.translate(this.position.x, this.position.y);
			ctx.beginPath();
			ctx.arc(0, 0, this.size.width/2, 0, Math.PI*2, false);
			ctx.fill();
			ctx.restore();

			this._super(ctx);
		}
	});
});
Пример #2
0
define(function(require) {

	var Entity = require("engine/Entity");

	return Entity.extend({
		init: function(position, size)
		{
			this._super("CircularObstacle", position, size);
		},

		update: function(timeDx)
		{
			this._super(timeDx);
		},

		draw: function(ctx)
		{
			ctx.save();
			ctx.strokeStyle = "Orange";
			ctx.translate(this.position.x, this.position.y);
			ctx.beginPath();
			ctx.arc(0, 0, this.size.width/2, 0, Math.PI*2, false);
			ctx.stroke();
			ctx.restore();

			this._super(ctx);
		}
	});
});