var stageWidth = 600;
var stageHeight = 400;
var gameScore = 0;
Crafty.init(600, 400, document.getElementById('crafty-game'));
var eventText = Crafty.e('2D, DOM, Text')
.attr({
x: 20,
y: 15
})
.textFont({
size: '20px'
});
var Box = Crafty.e("2D, Canvas, Color, Mouse")
.attr({
x: 200,
y: 100,
w: 200,
h: 200
})
.color("black")
.origin("center")
.bind('MouseOver', function() {
this.color("orange");
eventText.text("MouseOver");
})
.bind('MouseOut', function(e) {
this.color("purple");
eventText.text("MouseOut");
}).bind('MouseMove', function() {
this.rotation += 1;
}).bind('MouseDown', function() {
this.color("red");
eventText.text("MouseDown");
}).bind('MouseUp', function() {
this.color("yellow");
eventText.text("MouseUp");
});