JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://github.com/photonstorm/phaser/releases/download/v2.3.0/phaser.min.js"></script>
<div id="gameDiv"></div>
JavaScript
var mainstate = {
preload: function() {
game.time.advancedTiming = true;
},
create: function() {
this.tt = this.add.graphics(100, 100);
this.tt.lineStyle(1, 0xffd900);
this.tt.drawCircle(0, 0, 10 * 2 * Math.PI);
this.tt.fixedToCamera = true;
this.ttt = 5;
},
update: function() {
this.tt.cameraOffset.x = 100 + this.ttt++;
},
render: function() {
game.debug.text(game.time.fps || '--', 2, 14, "#00ff00");
}
};
var game = new Phaser.Game(400, 300, Phaser.AUTO, 'gameDiv');
game.state.add('main', mainstate);
game.state.start('main');