GithubHelp home page GithubHelp logo

carboncopy's People

Contributors

adamwkraft avatar dependabot[bot] avatar

Watchers

 avatar  avatar

carboncopy's Issues

loop de loop

https://github.com/adamwkraft/rob_and_adam_code_a_thing/blob/aabe496091420f3cf6c2f68e8c00bd12e1540d13/src/components/GameScreens/SinglePlayer/Survival.js#L69

By putting this in the body of the <Surival> it will be run on every render, which means it will update simpleGame, which in turn will update Survival.js, which means it will run again in an infinite feedback loop.

You could achieve what you're going for (load a set once they've selected survival mode I presume) in a number of different ways considering our setup. The most similar to what you have currently would be this:

const loadedRef = useRef(false);
  useEffect(() => {
    if (!loadedRef.current) {
      loadedRef.current = true;
      simpleGame.handleLoadShippedMasks('set2.zip'); // TODO: Make a Survival Set.
    }
  }, [simpleGame]);

This way the ref keeps track of it and only runs the load function once. I'm really not happy with how I've set up the game logic, and likely a better approach will present itself as we keep building, but this should work for now.

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.