Git Product home page Git Product logo

phase-0-javascript-events-acting-on-events-lab's People

Contributors

alexgriff avatar bal360 avatar dependabot[bot] avatar drakeltheryuujin avatar ihollander avatar jlboba avatar lizbur10 avatar matt-eva avatar maxwellbenton avatar paulnicholsen27 avatar sgharms avatar thuyanduong-flatiron avatar

Stargazers

 avatar  avatar  avatar

Watchers

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

phase-0-javascript-events-acting-on-events-lab's Issues

Dodger Lab MoveLeft Bounds Issue

Canvas Link

https://learning.flatironschool.com/courses/6956/assignments/239271?module_item_id=562278

Concern

We do still have a problem, though. Even though we're only going one pixel at a time, eventually our dodger will zoom (well, relatively speaking) right out of view.

How can we prevent this? We need to check where the left edge of the dodger is and only move it if it hasn't yet reached the left edge of the game field.

We're doing essentially the same thing, but we first ensure that the dodger's left edge has not reached the left edge of its container.

Now try moving the dodger past the left edge. No can do!

Finally, implement the code needed to prevent the dodger from escaping off the right-hand side. How can we check whether the right edge of the dodger has reached the right edge of the game field? (Keep in mind that the dodger is 40px wide.)

RIGHT IS WORKING.

LEFT FAILS, When I cannot move it to the left of 0. But when I can, it passes.
TESTBED (npm test -> indexTest.js) IS WRONG. Somehow the test class is wrong and I didn't modify it. I commented the code:

//dodger.style.bottom = "0px";
//dodger.style.left = "0px";

THEN THE LEFT PASSED.

Additional Context

moveDodgerLeft()
1) moves the DODGER to the left

moveDodgerRight()
โœ“ moves the DODGER to the right

1 passing (315ms)
1 failing

  1. moveDodgerLeft()
    moves the DODGER to the left:

    AssertionError: expected +0 to be below +0

    • expected - actual

    at Context. (test/indexTest.js:17:31)
    at process.processImmediate (node:internal/timers:476:21)

Suggested Changes

Fix the test. Then regrade all of the assignments. I think the logic is just backwards for said test. Testbed fails when starting at the left corner.

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.