Sha256: c9cfce7d1aa937c90b78255ae37959da0b60fde1e1ca20788ffdf54adf42ef76

Contents?: true

Size: 858 Bytes

Versions: 9

Compression:

Stored size: 858 Bytes

Contents

//= require "application_controller"

var CourthouseController = (function() {
  return Jax.Controller.create("courthouse", ApplicationController, {
    /* 'index' action. Sets up the scene. 'index' is called by default when first
       switching to this controller, unless another action name is given.
     */
    index: function() {
      this.world.addLightSource(LightSource.find('sun'));
      this.world.addObject(Scene.find('courthouse'));
      this.world.addObject(Character.find('judge'));
    },
    
    /* Some special actions are fired whenever the corresponding input is
       received from the user.
     */
    mouse_clicked: function(event) {
      if (event.target.isKindOf(Door)) {
        /* user clicks on the door, so they need to go to the next scene */
        this.redirectTo(event.target.destination);
      }
    }
  });
})();

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
jax-0.0.0.9 spec/example_app/app/controllers/courthouse_controller.js
jax-0.0.0.8 spec/example_app/app/controllers/courthouse_controller.js
jax-0.0.0.7 spec/example_app/app/controllers/courthouse_controller.js
jax-0.0.0.6 spec/example_app/app/controllers/courthouse_controller.js
jax-0.0.0.5 spec/example_app/app/controllers/courthouse_controller.js
jax-0.0.0.4 spec/example_app/app/controllers/courthouse_controller.js
jax-0.0.0.3 spec/example_app/app/controllers/courthouse_controller.js
jax-0.0.0.2 spec/example_app/app/controllers/courthouse_controller.js
jax-0.0.0.1 spec/example_app/app/controllers/courthouse_controller.js