Code Monkey home page Code Monkey logo

balloons-and-static-electricity's People

Contributors

aaronsamuel137 avatar agustinvallejo avatar andrealin avatar arouinfar avatar chrisklus avatar denz1994 avatar jbphet avatar jessegreenberg avatar jonathanolson avatar katiewoe avatar liquatics avatar marlitas avatar phet-dev avatar phet-steele avatar pixelzoom avatar samreid avatar terracoda avatar twant avatar zepumph avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

balloons-and-static-electricity's Issues

Convert BalloonsAndStaticElectricityModel.bounds from array to object literal or DOT/Bounds2

Currently bounds is declared as:

this.bounds = [this.sweater.center.x, 0, width - this.wallWidth, height];

Which leads to code like:

  if ( newLocation.y + balloonModel.height > model.bounds[3] ) {
    isStopped = true;
    newLocation.y = model.bounds[3] - balloonModel.height;
  }
  if ( newLocation.x < model.bounds[0] ) {
    isStopped = true;
    newLocation.x = model.bounds[0];
  }
  if ( newLocation.y < model.bounds[1] ) {
    isStopped = true;
    newLocation.y = model.bounds[1];
  }

I would recommend switching to an object literal or DOT/Bounds2 so code would read like bounds.maxY instead of bound[3] to make it easier to understand.

need translations for new strings

In html5 version new string appeared. Need translate them to all languages.
List below (from balloons-and-static-electricity-strings.js):

        "BalloonApplet.removeWall": "Remove<br/> Wall",
        "BalloonApplet.addWall": "Add<br/> Wall",
        "BalloonApplet.resetBalloon": "resetBalloon",
        "BalloonApplet.resetBalloons": "resetBalloons"

The wall charges oscillate too long

When moving a charged balloon toward the wall, the wall charges oscillate quite a long time (several seconds) and it is distracting. Can damping be added to its oscillation so it will won't oscillate too long?

Quick review and minor fixes

I'm going to take a quick look through the current balloons-and-static-electricity code and make review comments and minor fixes in this ticket.

Use peer repos instead of repos nested within scenery

Right now the simulation depends on submodules of scenery, but I think it should be changed so it is using peers for everything, including scenery's dependencies. This will require developers to have all of the dependencies listed in the *config.js checked out in the same directory.

Convert the "reset balloon" button to an icon or pictograph

The reset all button gets overlapped when the text on the "reset balloon" button changes to "reset balloons". Noah will see if he can come up with a sensible icon or pictograph to replace the text (which will also help with i18n layout issues).

Documentation for BalloonModel.js

Many of the methods in BalloonModel.js would benefit from more documentation (code comments) to explain what is happening and why.

Add the "reset balloon" button

The "reset balloon" button only resets the charges to their initial state. This is different from "reset all", which resets the entire sim back to the initial state.

Charges should be easier to pick up from sweater

It takes more swipes to remove more charges from the sweater than in the original Java version. Please make it easier for the balloon to pick up charges when dragged across the sweater, to match the behavior in the original Java version.

The balloon should move only when the mouse cursor is on it

If you move the balloon to the edge of the window, then hold down the mouse button and continue to move the cursor, then bring the cursor back to the window the balloon moves before the mouse cursor gets to it. This makes the balloon become detached from the mouse cursor.

The behavior should be as in the original Java version, where the balloon only moves when the mouse cursor is over it.

Switch to the new sweater image

Our artist gave us a new sweater, but it is not rendering the texture properly on iOS. @jonathanolson helped fix rendering problems on IE but they did not solve it on iOS. We should either (a) fix the SVG for iOS or (b) use a raster.

Rewrite the radio buttons with sun

The bootstrap radio buttons under the sweater look fuzzy on chrome, and get cropped in awkward ways depending on the zoom level of the browser. At our 6/12/2013 review, Noah & I decided to rewrite them using sun components.

Reduce balloon acceleration when released

The balloon moves too quickly when it is charged and released. Reduce the acceleration of the balloon so that it moves more slowly, to match the behavior in the original Java version.

Improvements for BalloonsAndStaticElectricityModel.getBalloonRestrictions

This method in BalloonsAndStaticElectricityModel.getBalloonRestrictions would benefit from some code comments. Also, it is a bit odd that it is a get function, but what it actually does is attaches a value to one of the arguments and returns the argument. May be confusing.

        getBalloonRestrictions: function( position, objWidth, objHeight ) {
          var rightBound = this.width;
          var isOutBounds = false;
          if ( this.wall.isVisible ) {
            rightBound -= this.wallWidth;
          }

          if ( position.x + objWidth > rightBound ) {
            position.x = rightBound - objWidth;
            isOutBounds = true;
          }

          if ( position.y < 0 ) {
            position.y = 0;
            isOutBounds = true;
          }

          if ( position.x < 0 ) {
            position.x = 0;
            isOutBounds = true;
          }
          else if ( position.y + objHeight > this.height ) {
            position.y = this.height - objHeight;
            isOutBounds = true;
          }
          position.isOutBounds = isOutBounds;
          return position;
        }

SweaterModel.js constants need documentation

Can you please add code comments to describe the positions in SweaterModel? Where did these values come from, what do they mean, and what might cause them to change in the future?

Wrong scaling in Firefox

HTML elements not scales correctly in Firefox (they are added in ControlPanel.js).
In IE and Chrome its ok.

untitled-2

Documentation for BalloonModel.js positions

In BalloonModel.js please document the array of positions and positions of start changes (what do the values mean and where did they come from, what possible reasons might come up for regenerating the array in the future).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.