Comments (2)
Game frame "engine"
An interval observable with say 30fps, so
const framesGenerator = Observable.interval(1000/30)
Ray:
For each ray, we need to have:
- Velocity: Upon creation, maps the framesGenerator to a set of velocities over time (can be constant of changing if we use gravity)
- Position: Integrates the velocity observable, so each point will be an operation over the velocity observable. Ideally takes a starting position which would be linked to the cannon position (right now it's always (0,0)
- RayCollision: Another observable that will take the Position observable and check against all the other rays (we probably need to use zip to create a list of all positions and then check if the pair we want collides with any of the other pairs
- Should emit the pair of elements that collided so we could create another ray from it if we wanted
- DrawableRay: This will be derived from the position until a ray collision occurrs. This is what we listen to to draw the state.
Rays:
- Each new ray position is pushed in an array of rays, which we need to use to detect collisions.
from reactive-sandbox.
Ray Colleciton Observable
- Using ofArrayChanges observable we can create an observable that will emit whatever ray is pushed to the array.
- Using a derived
scan
observable we can always have another observable that holds all current rays. - Using a
flatmap
operation we can get the list of all coordinates/id from these observables, which we will use to detect collisions with each of the rays.
from reactive-sandbox.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reactive-sandbox.