Giter VIP home page Giter VIP logo

reactive-sandbox's People

Watchers

 avatar

reactive-sandbox's Issues

observable setup

Game engine

We create a base observable that will be our game engine, generating a value for each "frame" of the application

time = Rx.Observable.interval(timeQuantum)

Ray

  • Each ray is basically a function of time, so it'll be a map derived from the time observable
  • rayVelocity: This most likely will stay constant since we don't change velocity through time, although we could for example add gravity or something. It'll have an original value when the ray is created.
  • rayPosition: This is the integral of the rayVelocity, we'll basically use a linear interpolation to calculate the position based on the velocity.
  • Rays should go on only until a collision occurs. (when a collision occurrs, rays will be reemited (maybe).

Ray collision:

  • For each ray, we need to have another observable that will detect collisions between this ray and the game boundary / other rays. We will use this observable to stop generating coordinates for the rays

Rays:

We probably want to keep all the existing rays into a single observable collection.

  • Rays: Collection of all rays
  • Active rays: Rays (observables) that haven't completed. Used to detect collisions

Setup canon shooting intensity

In order to get to play with basic Observables, the cannon in the middle when we press a spacebar will start charging the intensity.

  • Pressing the mouse creates an observable PowerObservableStart
  • Releasing the mouse creates an observable PowerObservableRelease
  • For each PowerObservableRelease we need to create a sequence (Observable), that will have the trajectory computed (until forever?).
  • Each Ray should be rendered until there is a collision with the wall, so we would need to have a takeUntil and detect the collision of the ray with the wall.

Setup hello world react/redux component

  • Clone one of the redux boilerplates (either our own or one more up to date), strip out everything we don't need
  • Add RxJS Next dependency

State:

The state is a "Ray" collection, with each of the rays having a coordinate (x,y) and possibly a velocity (x,y).

World boundary:

  • We encircle everything around a square, which will absorb the rays

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.