Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.rawgit.com/craftyjs/Crafty/testing/dist/crafty-min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
Crafty.init(400, 400);
var square = Crafty.e('2D, Canvas, Color');
square.attr({
  x: 10,
  y: 10,
  w: 100,
  h: 100
}).color('red');
square.origin("center");
square.bind('UpdateFrame', function(){
  this.rotation = this.rotation + 1;
});
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x