Git Product home page Git Product logo

Comments (3)

niccokunzmann avatar niccokunzmann commented on July 18, 2024

What would be the steps to implement this?

from flappy-svg.

vikasTmz avatar vikasTmz commented on July 18, 2024

Well if we're going to use Cannon.js (a purely physics library) , we can assume each of our characters and obstacles as some form of 2-D textured object. We can assign anisotropy properties to them using cannon.js where we can render each of their pixels (i.e map out every curve,edge corner individually) , instead of treating our characters bounded within a rectangle/square/circle. The collision detection and resolution will be handled by cannon.js.

How is this better? We can now create any form of SVG character with complex shape and geometry , load this image in Webgl using 'THREE.ImageUtils.loadTexture' and then render/store the image coordinates into a vertex array. Basically we're generating a geometry representing a parametric surface. This way collision detection will be as accurate as possible and in fact we can allow users to post their own SVGs can then create an algorithm to render out the coordinates. This will be challenging but the basic part above can be easily done.

A Demo (http://schteppe.github.io/cannon.js/examples/threejs_cloth.html). _Ignore the 3-D aspect of the demo _

from flappy-svg.

niccokunzmann avatar niccokunzmann commented on July 18, 2024

I feel like you like WebGL and because of this you would like to apply it.

My priorities are:

  • The tasks should be easy like adding a file or a layer.
  • The code should be beginner friendly.
  • There must be at least two people who understand the code, one of them having the right to merge.
  • It should work on smartphones, tablets, computers.
  • some more that may not apply here.

Given these, you can

  • create a demo with a background, a flappy and obstacles that renders it.
  • just put collision detection into WebGL or whichever framework.
  • do what you want.

Enhancing the current physics is hard, I guess, because gravity is pretty simple. Do you have in mind adding other physics simulations?

You can go ahead and implement whatever you like. If you keep my priorities in mind when adding features, I will merge it. If not, you may need to find another person to merge it. Also, both implementations may co-exist for some time and we could restructure the projects so both work.

from flappy-svg.

Related Issues (20)

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.