JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://rawgit.com/photonstorm/phaser/v2.0.7/build/phaser.js"></script>

JavaScript

var Main = {};
var squareA;

Main.Game = function (game) {  
};
        
Main.Game.prototype = {
  create: function() {
    squareA = this.add.sprite(0, 0, '__missing');
    squareA.inputEnabled = true;
    squareA.events.onInputDown.add(this.testFunction, this);
  },
    
  testFunction: function() {
    console.log('it works');
  }
};

var game = new Phaser.Game(400, 300, Phaser.AUTO);

game.state.add('Game', Main.Game, true);