Code Monkey home page Code Monkey logo

echo's People

Contributors

01010111 avatar austineast avatar blackgoku36 avatar csclyde avatar gama11 avatar gioele-bencivenga avatar itulau avatar mondayhopscotch avatar msghero avatar rblsb avatar xanozoid avatar yanrishatum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

echo's Issues

Passing the world instance to linecast repositiones new bodies at 0,0

There is a bug linecasting. I added a new body at runtime, and if the world instance was passed into linecast, it would always set new bodies to 0, 0

public function tick(Delta: Float) {
 if (!enabled) return;
 if (linecastBodies.length == 0) return;
 try {
   var rayResult = ray.linecast(linecastBodies, /** world **/); // passing the world instance in here produces the bug 
     if (rayResult != null && !rayResult.data[0].inverse_normal) {
       result = rayResult;
     } else {
       result = null;
     }
 }
 catch (e) {
   //
 }
}

Possible issue colliding scaled bodies?

I am trying to collide a rectangle body that grows in size.

To grow the rectangle I use body.shape.scale_y and offset the y position so that the body appears to grow in height only (rather than what it is actually doing, growing in both directions from the center).

It looks like collision is based on the original size of the rectangle rather than the scaled, see the video. I would expect collision when the top of the vertical rectangle meets the horizontal rectangle (as shown in the second video).

scaled-collision.mp4

The following video shows the body colliding normally (with no scale applied).

normal-collision.mp4

I've attached the code I was using to debug this, which extends BaseState from the samples project so can easily be dropped into there to test after renaming to GrowRectangle.hx.

GrowRectangle.hx.txt

World History Memory Management

need to set up some logic/test to ensure memory is managed for the world state history. adding IPool integration into History a possible solution

Need Unit Tests

There should be Unit tests to help prevent regressions as progress on the library continue.

Obtain collision point data

Hi, I've noticed that the contacts variable from CollisionData is not really being used. So, is there any other way currently to obtain the contact point(s) from the collision of shapes?

Layers/masks not public docs?

Hey, I'm wondering why body.layers and layer_mask are hidden by default and then not directly used in world.listen(). It doesn't have to copy Nape or anything, but I'm trying to see if maintaining arrays of bodies is the intended approach. For instance:

/// constructor

players = [];
enemies = [];
pAttacks = [];
eAttacks = [];
platforms = [];

/// listener setup

world.listen(players, platforms, playerPlatformParams);
// etc for every pair of interacting arrays with unique callbacks

/// on new body, with custom type field

if (body.type == E_ATTACK) eAttacks.push(body);
// etc for every type

Even still, I currently plan to use layers to not interact in some cases where the listener condition would get a bit ugly.

Site is down

Hi there! Your website is down very often.
Suggestion: Maybe you could host your content (demo/api) on GitHub pages?

Enter and exit collision callbacks do not work

I've tried linux and html5 builds, enter and exit callbacks are not called at all.

A brief investigation shown that echo.Listener.last_collisions is always the same object as echo.Listener.collisions, so condition
listener.last_collisions.find((f) -> return f.a == c.a && f.b == c.b || f.a == c.b && f.b == c.a) == null
in Collision.hx:118 and Collision.hx:128 is always false.

A possible fix is to revert commit 8c3b101

Improve memory management

Tests on the JS build are very performant, getting a stable 60 fps with a large amount of colliding bodies. But doing the same tests on a Hashlink Build cause a LOT of slowdown, with fps easily getting in the teens.

I believe that this is due to too much garbage collection, but a full investigation is needed.

I will be trying to profile the samples (maybe making some OpenFL samples that compile with hxcpp and profiling with hxscout), but any help optimizing is appreciated :)

Body Anchor

Could there possibly be an implementation of an anchor property for bodies?
Integrating the library in Top/Left anchored engines is a bit of a hassle and needs a lot of unnecessary code ala:

pos.x = x - bounds.width/2;

I know it would 'break' centered polygons, but if the anchors are 0.5 by default, it would be up to the implementer to make it work correctly.

Am I Using Macros.add_data correctly?

So I want to add a isOnFloor data to the body using your example

--macro echo.Macros.add_data("isOnFloor", "Bool")

But when I try to access it just spits an error

image

This is the hxml if it will help

-cp src

-lib heaps
-lib hlsdl
-lib deepnightLibs
-lib ldtk-haxe-api
-lib echo

-hl bin/Test.hl

-main Main
-D windowSize=1024x576

--macro echo.Macros.add_data("entity", "objects.Entity")
--macro echo.Macros.add_data("isOnFloor", "Bool")

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.