Skip to content

Commit

Permalink
Add repo to migration list, see phetsims/chipper#875
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Feb 27, 2020
1 parent 3630e65 commit c2a524e
Show file tree
Hide file tree
Showing 44 changed files with 6,237 additions and 6,370 deletions.
47 changes: 40 additions & 7 deletions area-builder_en.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,35 @@

<script type="text/javascript">

window.phet = window.phet || {};
window.phet.chipper = window.phet.chipper || {};
window.phet.chipper.packageObject = {
"name": "area-builder",
"version": "1.2.0-dev.0",
"license": "GPL-3.0",
"repository": { "type": "git", "url": "https://github.com/phetsims/area-builder.git" },
"devDependencies": { "grunt": "~1.0.0" },
"phet": {
"requirejsNamespace": "AREA_BUILDER",
"phetLibs": [ "twixt", "vegas" ],
"runnable": true,
"supportedBrands": [ "phet", "adapted-from-phet" ],
"supportsSound": true,
"simulation": true
},
"eslintConfig": { "extends": "../chipper/eslint/sim_eslintrc.js" }
};
window.phet.chipper.stringRepos = [ {
"repo": "area-builder",
"requirejsNamespace": "AREA_BUILDER"
}, { "repo": "joist", "requirejsNamespace": "JOIST" }, {
"repo": "scenery-phet",
"requirejsNamespace": "SCENERY_PHET"
}, { "repo": "sun", "requirejsNamespace": "SUN" }, {
"repo": "tambo",
"requirejsNamespace": "TAMBO"
}, { "repo": "twixt", "requirejsNamespace": "TWIXT" }, { "repo": "vegas", "requirejsNamespace": "VEGAS" } ];

// Identify the brand (assume generated brand if not provided with query parameters)
const brandMatch = location.search.match( /brand=([^&]+)/ );
const brand = brandMatch ? decodeURIComponent( brandMatch[ 1 ] ) : 'adapted-from-phet';
Expand All @@ -28,6 +57,7 @@
// Preloads, with more included for phet-io brand
let preloads = [
'../sherpa/lib/mdn-array-from-polyfill.js',
'../sherpa/lib/es6-promise-1e68dc.auto.min.js',
'../joist/js/splash.js',
'../sherpa/lib/jquery-2.1.0.js',
'../sherpa/lib/lodash-4.17.4.js',
Expand Down Expand Up @@ -55,25 +85,28 @@
] );
}

// TODO: es6 modules won't need a "main" param in this function
// Loads a synchronously-executed asynchronously-downloaded script tag, with optional data-main parameter.
// See http://www.html5rocks.com/en/tutorials/speed/script-loading/ for more about script loading. It helps to
// load all of the scripts with this method, so they are treated the same (and placed in the correct execution
// order).
const loadURL = ( preloadURL, main ) => {
const loadURL = ( preloadURL, type = 'text/javascript' ) => {
const script = document.createElement( 'script' );
if ( typeof main === 'string' ) {
script.setAttribute( 'data-main', main );
}
script.type = 'text/javascript';
script.type = type;
script.src = preloadURL + queryAppend;
script.async = false;
document.head.appendChild( script );
};

// Kick off string loading immediately
loadURL( '../chipper/js/load-runtime-strings.js' );

// Queue all of the preloads to be loaded.
preloads.forEach( loadURL );
preloads.forEach( preload => loadURL( preload ) );

loadURL( '../sherpa/lib/require-2.3.6.js', 'js/area-builder-config.js' );
// Module loading in compilation-free (development) mode will be kicked off once strings are loaded.
// This is done in load-runtime-strings.js
window.phet.chipper.loadModules = () => loadURL( 'js/area-builder-main.js', 'module' );
</script>
</body>
</html>
5 changes: 5 additions & 0 deletions images/explore-icon_png.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions images/game-icon_png.js

Large diffs are not rendered by default.

51 changes: 0 additions & 51 deletions js/area-builder-config.js

This file was deleted.

52 changes: 24 additions & 28 deletions js/area-builder-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,33 @@
*
* @author John Blanco
*/
define( require => {
'use strict';

// modules
const AreaBuilderExploreScreen = require( 'AREA_BUILDER/explore/AreaBuilderExploreScreen' );
const AreaBuilderGameScreen = require( 'AREA_BUILDER/game/AreaBuilderGameScreen' );
const Sim = require( 'JOIST/Sim' );
const SimLauncher = require( 'JOIST/SimLauncher' );
const Tandem = require( 'TANDEM/Tandem' );
import Sim from '../../joist/js/Sim.js';
import SimLauncher from '../../joist/js/SimLauncher.js';
import Tandem from '../../tandem/js/Tandem.js';
import areaBuilderStrings from './area-builder-strings.js';
import AreaBuilderExploreScreen from './explore/AreaBuilderExploreScreen.js';
import AreaBuilderGameScreen from './game/AreaBuilderGameScreen.js';

// strings
const areaBuilderTitleString = require( 'string!AREA_BUILDER/area-builder.title' );
const areaBuilderTitleString = areaBuilderStrings[ 'area-builder' ].title;

// constants
const tandem = Tandem.ROOT;
// constants
const tandem = Tandem.ROOT;

const simOptions = {
credits: {
leadDesign: 'Karina K. R. Hensberry',
softwareDevelopment: 'John Blanco',
team: 'Bryce Gruneich, Amanda McGarry, Ariel Paul, Kathy Perkins, Beth Stade',
qualityAssurance: 'Steele Dalton, Amanda Davis, Oliver Nix, Oliver Orejola, Arnab Purkayastha, ' +
'Amy Rouinfar, Bryan Yoelin'
}
};
const simOptions = {
credits: {
leadDesign: 'Karina K. R. Hensberry',
softwareDevelopment: 'John Blanco',
team: 'Bryce Gruneich, Amanda McGarry, Ariel Paul, Kathy Perkins, Beth Stade',
qualityAssurance: 'Steele Dalton, Amanda Davis, Oliver Nix, Oliver Orejola, Arnab Purkayastha, ' +
'Amy Rouinfar, Bryan Yoelin'
}
};

SimLauncher.launch( function() {
// create and start the sim
new Sim( areaBuilderTitleString, [
new AreaBuilderExploreScreen( tandem.createTandem( 'exploreScreen' ) ),
new AreaBuilderGameScreen( tandem.createTandem( 'gameScreen' ) )
], simOptions ).start();
} );
SimLauncher.launch( function() {
// create and start the sim
new Sim( areaBuilderTitleString, [
new AreaBuilderExploreScreen( tandem.createTandem( 'exploreScreen' ) ),
new AreaBuilderGameScreen( tandem.createTandem( 'gameScreen' ) )
], simOptions ).start();
} );
14 changes: 14 additions & 0 deletions js/area-builder-strings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright 2020, University of Colorado Boulder

/**
* Auto-generated from modulify, DO NOT manually modify.
*/

import getStringModule from '../../chipper/js/getStringModule.js';
import areaBuilder from './areaBuilder.js';

const areaBuilderStrings = getStringModule( 'AREA_BUILDER' );

areaBuilder.register( 'areaBuilderStrings', areaBuilderStrings );

export default areaBuilderStrings;
8 changes: 2 additions & 6 deletions js/areaBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
*
* @author John Blanco
*/
define( require => {
'use strict';

// modules
const Namespace = require( 'PHET_CORE/Namespace' );
import Namespace from '../../phet-core/js/Namespace.js';

return new Namespace( 'areaBuilder' );
} );
export default new Namespace( 'areaBuilder' );
18 changes: 7 additions & 11 deletions js/common/AreaBuilderQueryParameters.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,15 @@
*
* @author John Blanco
*/
define( require => {
'use strict';

// modules
const areaBuilder = require( 'AREA_BUILDER/areaBuilder' );
import areaBuilder from '../areaBuilder.js';

const AreaBuilderQueryParameters = QueryStringMachine.getAll( {
const AreaBuilderQueryParameters = QueryStringMachine.getAll( {

// fill the shape placement boards on the 'Explore' screen during startup, useful for testing
prefillBoards: { type: 'flag' }
} );
// fill the shape placement boards on the 'Explore' screen during startup, useful for testing
prefillBoards: { type: 'flag' }
} );

areaBuilder.register( 'AreaBuilderQueryParameters', AreaBuilderQueryParameters );
areaBuilder.register( 'AreaBuilderQueryParameters', AreaBuilderQueryParameters );

return AreaBuilderQueryParameters;
} );
export default AreaBuilderQueryParameters;
68 changes: 32 additions & 36 deletions js/common/AreaBuilderSharedConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,50 +5,46 @@
*
* @author John Blanco
*/
define( require => {
'use strict';

// modules
const areaBuilder = require( 'AREA_BUILDER/areaBuilder' );
const Bounds2 = require( 'DOT/Bounds2' );
import Bounds2 from '../../../dot/js/Bounds2.js';
import areaBuilderStrings from '../area-builder-strings.js';
import areaBuilder from '../areaBuilder.js';

// strings
const invalidValueString = require( 'string!AREA_BUILDER/invalidValue' );
const invalidValueString = areaBuilderStrings.invalidValue;

const AreaBuilderSharedConstants = {
const AreaBuilderSharedConstants = {

// layout bounds used throughout the simulation for laying out the screens
LAYOUT_BOUNDS: new Bounds2( 0, 0, 768, 464 ),
// layout bounds used throughout the simulation for laying out the screens
LAYOUT_BOUNDS: new Bounds2( 0, 0, 768, 464 ),

// colors used for the various shapes
GREENISH_COLOR: '#33E16E',
DARK_GREEN_COLOR: '#1A7137',
PURPLISH_COLOR: '#9D87C9',
DARK_PURPLE_COLOR: '#634F8C',
ORANGISH_COLOR: '#FFA64D',
ORANGE_BROWN_COLOR: '#A95327',
PALE_BLUE_COLOR: '#5DB9E7',
DARK_BLUE_COLOR: '#277DA9',
PINKISH_COLOR: '#E88DC9',
PURPLE_PINK_COLOR: '#AA548D',
PERIMETER_DARKEN_FACTOR: 0.6, // The amount that the perimeter colors are darkened from the main shape color
// colors used for the various shapes
GREENISH_COLOR: '#33E16E',
DARK_GREEN_COLOR: '#1A7137',
PURPLISH_COLOR: '#9D87C9',
DARK_PURPLE_COLOR: '#634F8C',
ORANGISH_COLOR: '#FFA64D',
ORANGE_BROWN_COLOR: '#A95327',
PALE_BLUE_COLOR: '#5DB9E7',
DARK_BLUE_COLOR: '#277DA9',
PINKISH_COLOR: '#E88DC9',
PURPLE_PINK_COLOR: '#AA548D',
PERIMETER_DARKEN_FACTOR: 0.6, // The amount that the perimeter colors are darkened from the main shape color

// velocity at which animated elements move
ANIMATION_SPEED: 200, // In screen coordinates per second
// velocity at which animated elements move
ANIMATION_SPEED: 200, // In screen coordinates per second

// various other constants
BACKGROUND_COLOR: 'rgb( 225, 255, 255 )',
CONTROL_PANEL_BACKGROUND_COLOR: 'rgb( 254, 241, 233 )',
RESET_BUTTON_RADIUS: 22,
CONTROLS_INSET: 15,
// various other constants
BACKGROUND_COLOR: 'rgb( 225, 255, 255 )',
CONTROL_PANEL_BACKGROUND_COLOR: 'rgb( 254, 241, 233 )',
RESET_BUTTON_RADIUS: 22,
CONTROLS_INSET: 15,

UNIT_SQUARE_LENGTH: 32, // In screen coordinates, used in several places
UNIT_SQUARE_LENGTH: 32, // In screen coordinates, used in several places

// string used to indicate an invalid value for area and perimeter
INVALID_VALUE: invalidValueString
};
// string used to indicate an invalid value for area and perimeter
INVALID_VALUE: invalidValueString
};

areaBuilder.register( 'AreaBuilderSharedConstants', AreaBuilderSharedConstants );
areaBuilder.register( 'AreaBuilderSharedConstants', AreaBuilderSharedConstants );

return AreaBuilderSharedConstants;
} );
export default AreaBuilderSharedConstants;
Loading

0 comments on commit c2a524e

Please sign in to comment.