Git Product home page Git Product logo

Comments (4)

Mugen87 avatar Mugen87 commented on May 27, 2024 1

Closing. After some considerations we are not going to add (official) pixi.js examples. The implementation of Yuka is just not designed for a 2D game. The combination might work in certain scenarios but it's best to use a 3D engine.

from yuka.

Mugen87 avatar Mugen87 commented on May 27, 2024

Hey, really like the project!

Thank you for the feedback! Unfortunately, I'm not familiar with pixi.js so I'm not sure how easy it is to combine both projects.

The basic idea of using this library is to implement game logic via Yuka's game entity concept. A game entity can have a so called render component which is basically an object primitive of a rendering engine. For example an instance of THREE.Mesh or PIXI.Sprite.

You just copy the transformation of your game entities to your render components each simulation step and ensure they are nicely drawn by your selected rendering engine. This works properly with three.js or Babylon.js however pixi.js is problematic since it's a pure 2D engine. Meaning it defines the sprite's position in pixels/screen coordinates. In Yuka, three.js and Babylon.js, the position values are defined in world units/world coordinates.

I actually don't know how to bring these two different concepts in a meaningful way together with Pixi.js. I've created a fiddle to illustrate the issue:

https://jsfiddle.net/s6mctj3r/4/

from yuka.

bpkennedy avatar bpkennedy commented on May 27, 2024

Interesting! I do see in the fiddle that the sprite's are moving around a bit, although I don't quite understand how. I will spend some more time fiddling with them and see if I can understand better. Thanks for illustrating the issue!

from yuka.

Mugen87 avatar Mugen87 commented on May 27, 2024

I do see in the fiddle that the sprite's are moving around a bit, although I don't quite understand how.

The problem is that the game entities position values lie in a range let's say [-50,50] world units. Pixi interprets these units as screen coordinates/pixels which usually have a different range (check the app.screen object). Hence, you see only a minor movement.

from yuka.

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.