diff --git a/app/main/controllers/main_controller.rb b/app/main/controllers/main_controller.rb index c0e6fd5..c08d08f 100644 --- a/app/main/controllers/main_controller.rb +++ b/app/main/controllers/main_controller.rb @@ -1,11 +1,12 @@ # By default Volt generates this controller for your Main component - +if RUBY_PLATFORM == 'opal' + require "main/lib/game" +end module Main class MainController < Volt::ModelController def index - require "main/lib/game" Game.new() diff --git a/app/main/lib/game.rb b/app/main/lib/game.rb index 981c186..b1af0f9 100644 --- a/app/main/lib/game.rb +++ b/app/main/lib/game.rb @@ -1,4 +1,6 @@ +require "opal-phaser" + class Score attr_accessor :score attr_reader :scoreText